Class WorkingHours
- All Implemented Interfaces:
IDutyHours,IWorkingHours,Serializable,Comparable<IDutyHours>
IResource is allowed to work. If
a Resource is working outside of its WorkingHours a Violation
will be thrown.- Since:
- 03/09/2019
- Version:
- 19/09/2019
- Author:
- DNA
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.dna.jopt.member.unit.hours.IDutyHours
IDutyHours.DutyHoursFlavour -
Constructor Summary
ConstructorsConstructorDescriptionWorkingHours(long hoursBeginMillis, long hoursEndMillis) Deprecated.WorkingHours(long hoursBeginMillis, long hoursEndMillis, ZoneId zoneId) The constructor forWorkingHoursusing milliseconds since 01.01.1970.WorkingHours(TimeWindow window) WorkingHours(com.google.common.collect.Range<Instant> interval) Deprecated.please useWorkingHours(ZonedDateTime, ZonedDateTime)insteadWorkingHours(com.google.common.collect.Range<Instant> interval, Duration maxWorkingTime, javax.measure.Quantity<javax.measure.quantity.Length> maxDistance) Deprecated.please useWorkingHours(ZonedDateTime, ZonedDateTime)instead.WorkingHours(Instant hoursBegin, Instant hoursEnd) Deprecated.please useWorkingHours(ZonedDateTime, ZonedDateTime)insteadWorkingHours(Instant hoursBegin, Instant hoursEnd, Duration maxWorkingTime, javax.measure.Quantity<javax.measure.quantity.Length> maxDistance) Deprecated.please useWorkingHours(ZonedDateTime, ZonedDateTime)instead.WorkingHours(Instant hoursBegin, Instant hoursEnd, ZoneId zoneId) The constructor forWorkingHoursusingInstants.WorkingHours(Instant hoursBegin, Instant hoursEnd, ZoneId zoneId, Optional<Duration> maxWorkingTime, Optional<javax.measure.Quantity<javax.measure.quantity.Length>> maxDistance) WorkingHours(Instant hoursBegin, Instant hoursEnd, Optional<Duration> maxWorkingTime, Optional<javax.measure.Quantity<javax.measure.quantity.Length>> maxDistance) Deprecated.please useWorkingHours(ZonedDateTime, ZonedDateTime)instead.WorkingHours(LocalDateTime hoursBegin, LocalDateTime hoursEnd) Deprecated.please useWorkingHours(ZonedDateTime, ZonedDateTime)insteadWorkingHours(ZonedDateTime hoursBegin, Duration maxTime) WorkingHours(ZonedDateTime hoursBegin, ZonedDateTime hoursEnd) The constructor forWorkingHoursusingAbstractDutyHours(ZonedDateTime, ZonedDateTime).WorkingHours(GregorianCalendar hoursBegin, GregorianCalendar hoursEnd) Deprecated.please useWorkingHours(ZonedDateTime, ZonedDateTime)instead -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidaddConstraint(IWorkingHoursLevelConstraint constraint) Adds aConstraintto theWorkingHoursso onlyResourceswith that specificQualificationwill be able to serve theNodesto which thoseWorkingHoursare applied.voidaddConstraint(IMultiWorkingHoursLevelConstraint constraint) voidAdds a certainINodeColorto theResource.voidaddQualification(IQualification qualification) Adds aIQualificationto theIWorkingHours, which means that by adding aIConstraintto theINode, they are limited to whichNodesthey can give service.copy()Returns a copy ofWorkingHours(this.getBegin(), this.getEnd(), this.getZoneId())and invokestakeOverProperties(com.dna.jopt.member.unit.hours.IWorkingHours, com.dna.jopt.member.unit.hours.IWorkingHours)to also copy the properties.getColorCapacityItemByColorCode(int colorCode) Gets theNodeColorCapacityItemwhich limit the amount ofColorcodedNodesaResourcecan give service to.getConnectionHook(String toId) Gets theConstraintsset on theIResource.Gets theIDutyHours.DutyHoursFlavour.WOH_FLAVOUR, the default value isenum constant ordinal: 0.booleanGets if theResourceis allowed to do anovernight stay.Gets thelocalFlexTimein milliseconds.Gets thefreePostWorkDrivingTerminationTimein milliseconds.Gets thelocalMaxPillarAfterHoursTimeofIPillarNodein milliseconds.Gets thelocalMaxRouteStartReductionTimein milliseconds.Gets thelocalMaxRouteStartReductionTimeforIPillarNodein milliseconds.Gets theDurationof the potential localstayout cycle.Gets the start of the localstayout cycle.doubleGets themaxDistance, which is the maximal distance in km aResourceis allowed to travel without aIViolationper day.doubleGets maximum number of hours aResourceis allowed to work per day inhours.Gets the aMapof theNodeColorCapacity.Gets theINodeColorthat are in use.Map<Class<? extends IQualification>,IQualification> Gets theIQualificationof theIWorkingHours.booleanhasHook()booleanChecks if the route is closed or not, the default value isfalse.Checks whether thelocalMaxRouteStartReductionTimeis included in theWorkingHours.Checks whether the potentially setlocalMaxRouteStartReductionTimecan only be used for driving, not for working.Checks whether the potentially setlocalMaxRouteStartReductionTimeforIPillarNodecan only be used for driving, not for working.booleanChecks if anyINodeColorhas been set through the use of aNodeColorCapacityItem.booleanvoidsetIsAvailableForStay(boolean isAvailableForStay) Sets if theResourceis allowed for anovernight stayinstead of returning to the starting location.voidsetIsClosedRoute(boolean isClosedRoute) Sets theRouteto aclosed Route.booleansetLocalFlexTime(Duration idleTimeReductionTime) Sets the amount of time aResourcecan be expected to start working later and stay longer at work if needed.booleansetLocalMaxFreePostWorkDrivingTerminationTime(Duration postTimeReductionTime) Sets the amount of time theResourcecan be expected to drive home to its starting location in its free time.booleansetLocalMaxFreePostWorkDrivingTerminationTime(Duration postTimeReductionTime, boolean onlyApplyOnOvertime) Sets the local max free post work driving termination time.booleansetLocalMaxPillarAfterHoursTime(Duration maxPillarEndOverTime) Sets the amount of time afterWorkingHourswithin which aIPillarNodecan be set.booleansetLocalMaxRouteStartReductionTime(Duration maxRouteStartReductionTime, boolean isOnlyUsedForDriving) Sets the maximum time which theResourcecan be expected to drive to the firstNodein its private time.booleansetLocalMaxRouteStartReductionTimePillar(Duration maxRouteStartReductionTime, boolean isOnlyUsedForDriving) Sets thelocalMaxRouteStartReductionTimeforIPillarNode.voidsetLocalReductionTimeIsIncludedInWorkingTime(boolean isIncludedInTotalWorkingTime) Sets whether thelocalMaxRouteStartReductionTimeis included in theWorkingHours.voidsetLocalStayOutCycleDefinition(Duration cycle, LocalDate cycleStart) Sets theDurationof the cycle within which the maximum number ofovernight staysare allowed and within which the minimumrecovery time(WorkingHourswithoutovernight stays) has to be observed.voidsetMaxDistance(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance) Sets the maximal distance that aResourceis allowed to travel per day, cannot be null.voidsetMaxHours(Duration maxWorkingTime) Deprecated.voidsetMaxWorkingTime(Duration maxWorkingTime) Sets the maximum number of hours aResourceis allowed to work per day.voidsetResourceDepot(IResourceDepot depot) booleansetStartTimeHook(Duration routeStartTimeHookDuration) static IWorkingHourstakeOverProperties(IWorkingHours src, IWorkingHours target) static IWorkingHourstakeOverProperties(IWorkingHours src, IWorkingHours target, boolean doStartUpdate) Methods inherited from class com.dna.jopt.member.unit.hours.AbstractDutyHours
compareTo, getTimeWindow, isPrefferedHour, setIsPrefferedHour, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.dna.jopt.member.unit.hours.IDutyHours
getTimeWindow, isPrefferedHour, setIsPrefferedHour
-
Constructor Details
-
WorkingHours
The constructor forWorkingHoursusingAbstractDutyHours(ZonedDateTime, ZonedDateTime). TheWorkingHoursdefine in which timeframe aIResourceis able to serviceINode. Internally the time eventually is handled as seconds since the epoch 1970-01-01T00:00:00Z. Thetime zoneis derived from theZonedDateTime. Both times need to be in the same time zone.Implementation example:
List<IWorkingHours> workingHours = new ArrayList<IWorkingHours>(); ZoneId zoneId = ZoneId.of("Europe/Berlin"); workingHours.add( new WorkingHours( ZonedDateTime.of(2020, MAY.getValue(), 6, 8, 0, 0, 0, zoneId), ZonedDateTime.of(2020, MAY.getValue(), 6, 17, 0, 0, 0, zoneId)));- Parameters:
hoursBegin- the zonedDateTime when the resource is allowed to begin workhoursEnd- the zonedDateTime when the resource is supposed to stop working
-
WorkingHours
-
WorkingHours
-
WorkingHours
The constructor forWorkingHoursusingInstants. TheWorkingHoursdefine in which timeframe aCapacityResourceis able to serviceINode.- Parameters:
hoursBegin- the zonedDateTime when the resource is allowed to begin workhoursEnd- the zonedDateTime when the resource is supposed to stop workingzoneId- the zoneId ID of the time zone of the beginning and ending times
-
WorkingHours
The constructor forWorkingHoursusing milliseconds since 01.01.1970. TheWorkingHoursdefine in which timeframe aCapacityResourceis able to serviceINode.Using
WorkingHours(ZonedDateTime, ZonedDateTime)is preferred.- Parameters:
hoursBeginMillis- the long milliseconds since 1970-01-01T00:00:00Z when the resource is allowed to begin workhoursEndMillis- the long milliseconds since 1970-01-01T00:00:00Z when the resource is supposed to stop workingzoneId- the zoneId ID of the time zone of the beginning and ending times
-
WorkingHours
public WorkingHours(Instant hoursBegin, Instant hoursEnd, ZoneId zoneId, Optional<Duration> maxWorkingTime, Optional<javax.measure.Quantity<javax.measure.quantity.Length>> maxDistance) - Parameters:
hoursBegin- the instant when the resource is allowed to workhoursEnd- the instant when the resource is supposed to stop workingzoneId- the zoneID of the resource starting locationmaxWorkingTime- the optional of the duration of the maximal working timemaxDistance- the optional of the quantity of the maximal distance the resource is allowed to travel
-
WorkingHours
Deprecated.please useWorkingHours(ZonedDateTime, ZonedDateTime)insteadDeprecated constructor- Parameters:
hoursBegin- the gregorianCalendar when the resource is allowed to begin workhoursEnd- the gregorianCalendar when the resource is supposed to stop working
-
WorkingHours
Deprecated.please useWorkingHours(ZonedDateTime, ZonedDateTime)insteadDeprecated constructor- Parameters:
hoursBegin- the localDateTime when the resource is allowed to begin workhoursEnd- the localDateTime when the resource is supposed to stop working
-
WorkingHours
Deprecated.please useWorkingHours(ZonedDateTime, ZonedDateTime)insteadDeprecated constructor- Parameters:
hoursBegin- the instant when the resource is allowed to begin workhoursEnd- the instant when the resource is supposed to stop working
-
WorkingHours
Deprecated.please useWorkingHours(ZonedDateTime, ZonedDateTime)insteadDeprecated constructor- Parameters:
interval- the range instant when the resource is supposed to start and stop working
-
WorkingHours
Deprecated.please useWorkingHours(ZonedDateTime, ZonedDateTime)insteadDeprecated constructor- Parameters:
hoursBeginMillis- the long seconds since 01.01.1970 when the resource is allowed to begin workhoursEndMillis- the long seconds since 01.01.1970 when the resource is supposed to stop working
-
WorkingHours
@Deprecated public WorkingHours(Instant hoursBegin, Instant hoursEnd, Duration maxWorkingTime, javax.measure.Quantity<javax.measure.quantity.Length> maxDistance) Deprecated.please useWorkingHours(ZonedDateTime, ZonedDateTime)instead. TheDeprecated constructor- Parameters:
hoursBegin- the instant when the resource is allowed to begin workhoursEnd- instant when the resource is supposed to stop workingmaxWorkingTime- the duration of the maximal working time per daymaxDistance- the quantity length maximal distance the resource should travel per day
-
WorkingHours
@Deprecated public WorkingHours(Instant hoursBegin, Instant hoursEnd, Optional<Duration> maxWorkingTime, Optional<javax.measure.Quantity<javax.measure.quantity.Length>> maxDistance) Deprecated.please useWorkingHours(ZonedDateTime, ZonedDateTime)instead. TheDeprecated constructor- Parameters:
hoursBegin- the instant when the resource is allowed to begin workhoursEnd- instant when the resource is supposed to stop workingmaxWorkingTime- the optional duration of the maximal working time per daymaxDistance- the optional quantity length maximal distance the resource should travel per day
-
WorkingHours
@Deprecated public WorkingHours(com.google.common.collect.Range<Instant> interval, Duration maxWorkingTime, javax.measure.Quantity<javax.measure.quantity.Length> maxDistance) Deprecated.please useWorkingHours(ZonedDateTime, ZonedDateTime)instead. TheDeprecated constructor- Parameters:
interval- the range instant when the resource is allowed to workmaxWorkingTime- duration of the maximal working time per daymaxDistance- quantity length maximal distance the resource should travel per day
-
-
Method Details
-
copy
Description copied from interface:IWorkingHoursReturns a copy ofWorkingHours(this.getBegin(), this.getEnd(), this.getZoneId())and invokestakeOverProperties(com.dna.jopt.member.unit.hours.IWorkingHours, com.dna.jopt.member.unit.hours.IWorkingHours)to also copy the properties.- Specified by:
copyin interfaceIDutyHours- Specified by:
copyin interfaceIWorkingHours- Returns:
- a copy of the WorkingHours
-
takeOverProperties
-
takeOverProperties
public static IWorkingHours takeOverProperties(IWorkingHours src, IWorkingHours target, boolean doStartUpdate) -
setIsAvailableForStay
public void setIsAvailableForStay(boolean isAvailableForStay) Description copied from interface:IWorkingHoursSets if theResourceis allowed for anovernight stayinstead of returning to the starting location. TheNodealso needsINode.setIsStayNode(boolean)set totrueso this function can be used.- Specified by:
setIsAvailableForStayin interfaceIWorkingHours- Parameters:
isAvailableForStay- boolean, the default value istrue.
-
getIsAvailableForStay
public boolean getIsAvailableForStay()Description copied from interface:IWorkingHoursGets if theResourceis allowed to do anovernight stay. TheNodealso needsINode.setIsStayNode(boolean)set totrueso this function can be used.This method is specific for the set
WorkingHoursand can therefore be specific for certain days in the week (noovernight stayson Fridays.- Specified by:
getIsAvailableForStayin interfaceIWorkingHours- Returns:
- boolean, the default value is
true.
-
getFlavour
Description copied from interface:IDutyHoursGets theIDutyHours.DutyHoursFlavour.WOH_FLAVOUR, the default value isenum constant ordinal: 0.- Specified by:
getFlavourin interfaceIDutyHours- Returns:
- the enum constant ordinal
-
setMaxWorkingTime
Description copied from interface:IWorkingHoursSets the maximum number of hours aResourceis allowed to work per day.- Specified by:
setMaxWorkingTimein interfaceIWorkingHours- Parameters:
maxWorkingTime- the maximal working time
-
setMaxHours
Deprecated.Description copied from interface:IWorkingHoursDecrecated methodSets the
maxHoursaResourceis allowed to work per day.- Specified by:
setMaxHoursin interfaceIWorkingHours- Parameters:
maxWorkingTime- the double to be set formaxHours
-
getMaxHours
public double getMaxHours()Description copied from interface:IWorkingHoursGets maximum number of hours aResourceis allowed to work per day inhours. By default it is not usable and the value is -1.- Specified by:
getMaxHoursin interfaceIWorkingHours- Returns:
- the double
maxHours.
-
setMaxDistance
public void setMaxDistance(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance) Description copied from interface:IWorkingHoursSets the maximal distance that aResourceis allowed to travel per day, cannot be null.- Specified by:
setMaxDistancein interfaceIWorkingHours- Parameters:
maxDistance- the quantity, will becastedto kilometre
-
getMaxDistanceKm
public double getMaxDistanceKm()Description copied from interface:IWorkingHoursGets themaxDistance, which is the maximal distance in km aResourceis allowed to travel without aIViolationper day.- Specified by:
getMaxDistanceKmin interfaceIWorkingHours- Returns:
- double
maxDistancein km. By default it is not usable and the value is -1.
-
setIsClosedRoute
public void setIsClosedRoute(boolean isClosedRoute) Description copied from interface:IWorkingHoursSets theRouteto aclosed Route. Aclosed Routeis aRoutewhere theResourceis going to its home afterwards. Anopen Routeis aRoutewhere theResourceis simply staying at the lastNodeifOverNightStayalso has been activated or where theResourcehas to travel home outside of theWorkingHours. The default value is true.- Specified by:
setIsClosedRoutein interfaceIWorkingHours- Parameters:
isClosedRoute- the boolean if the Route is a closed Route- See Also:
-
isClosedRoute
public boolean isClosedRoute()Description copied from interface:IWorkingHoursChecks if the route is closed or not, the default value isfalse. Aclosed Routeis aRoutewhere theResourceis going to its home afterwards. Anopen Routeis aRoutewhere theResourceis simply staying at the lastNodeifOverNightStayalso has been activated or where theResourcehas to travel home outside of theWorkingHours. The default value is true.- Specified by:
isClosedRoutein interfaceIWorkingHours- Returns:
- the boolean
isClosedRoute - See Also:
-
setLocalStayOutCycleDefinition
Description copied from interface:IWorkingHoursSets theDurationof the cycle within which the maximum number ofovernight staysare allowed and within which the minimumrecovery time(WorkingHourswithoutovernight stays) has to be observed. Therecovery timeis set inIResource.setStayOutCycleDefinition(Duration, LocalDate).Without setting the cycle the maximal number of
overnight stayswill not be refreshed and count for the full duration of theWorkingHours. The cycle can be applied to the localResourcewhich means it will stay the same for thisResourcethroughout theOptimization. If like here setlocallyit is only valid for thisWorkingHoursand the cycle can change depending on the dates or time in the week. It can for example be set that noovernight staysare allowed on Fridays.- Specified by:
setLocalStayOutCycleDefinitionin interfaceIWorkingHours- Parameters:
cycle- duration of the cyclecycleStart- the localDate of the cycle start
-
getLocalStayOutCycle
Description copied from interface:IWorkingHoursGets theDurationof the potential localstayout cycle.For more information please see
IWorkingHours.setLocalStayOutCycleDefinition(Duration, LocalDate).- Specified by:
getLocalStayOutCyclein interfaceIWorkingHours- Returns:
- the duration of the local stayOutCycle
-
getLocalStayOutCycleStart
Description copied from interface:IWorkingHoursGets the start of the localstayout cycle.For more information please see
IWorkingHours.setLocalStayOutCycleDefinition(Duration, LocalDate).- Specified by:
getLocalStayOutCycleStartin interfaceIWorkingHours- Returns:
- the date of the localStayCycleStart
-
setLocalReductionTimeIsIncludedInWorkingTime
public void setLocalReductionTimeIsIncludedInWorkingTime(boolean isIncludedInTotalWorkingTime) Description copied from interface:IWorkingHoursSets whether thelocalMaxRouteStartReductionTimeis included in theWorkingHours. The default value isfalse. IffalseandIWorkingHours.setLocalMaxRouteStartReductionTime(Duration, boolean)is set totruethe driving time to the firstNodehas to be done in theResourcesprivate timeFor more information please see
IWorkingHours.setLocalMaxRouteStartReductionTime(Duration, boolean).- Specified by:
setLocalReductionTimeIsIncludedInWorkingTimein interfaceIWorkingHours- Parameters:
isIncludedInTotalWorkingTime- the boolean whether reduction time is included in the WorkingHours
-
setLocalMaxRouteStartReductionTime
public boolean setLocalMaxRouteStartReductionTime(Duration maxRouteStartReductionTime, boolean isOnlyUsedForDriving) Description copied from interface:IWorkingHoursSets the maximum time which theResourcecan be expected to drive to the firstNodein its private time.If the
OpeningHoursof aNodeand theWorkingHoursof aResourcestart at 8 the driving time is an hour and theResource'slocalMaxRouteStartReductionTimeis 30 Minutes theResourcewill start driving towards theNodeat 7.30 (outside of itsWorkingHours) and arrive there at 8.30.The
Booleandefines whether thelocalMaxRouteStartReductionTimecan only be used for driving or not and is usually set totrue. TheResourcecan not work in thelocalMaxRouteStartReductionTimein that case.If like here set
locallythelocalMaxRouteStartReductionTimeis only valid for these specificWorkingHours.- Specified by:
setLocalMaxRouteStartReductionTimein interfaceIWorkingHours- Parameters:
maxRouteStartReductionTime- the duration of the maxRouteStartReductionTimeisOnlyUsedForDriving- the boolean whether the time can only be used for driving- Returns:
- false if reductionTime is null or negative
-
setLocalMaxRouteStartReductionTimePillar
public boolean setLocalMaxRouteStartReductionTimePillar(Duration maxRouteStartReductionTime, boolean isOnlyUsedForDriving) Description copied from interface:IWorkingHoursSets thelocalMaxRouteStartReductionTimeforIPillarNode. Overwrites the setlocalMaxRouteStartReductionTimeand sets the new value forPillars. If nolocalMaxRouteStartReductionTimehas been set, sets the new value forPillarsonly.For more information please see
IWorkingHours.setLocalMaxRouteStartReductionTime(Duration, boolean).- Specified by:
setLocalMaxRouteStartReductionTimePillarin interfaceIWorkingHours- Parameters:
maxRouteStartReductionTime- the duration of the localMaxStartReductionTimePillarisOnlyUsedForDriving- the boolean whether it is only used for driving- Returns:
- false if reductionTime is null or negative
-
isLocalReductionTimeOnlyUsedForDriving
Description copied from interface:IWorkingHoursChecks whether the potentially setlocalMaxRouteStartReductionTimecan only be used for driving, not for working. Per default this is set totrue.For more information please see
IWorkingHours.setLocalMaxRouteStartReductionTime(Duration, boolean)- Specified by:
isLocalReductionTimeOnlyUsedForDrivingin interfaceIWorkingHours- Returns:
- the checked status or an empty Optional if no
localMaxRouteStartReductionTimehas been set
-
isLocalReductionTimeOnlyUsedForDrivingPillar
Description copied from interface:IWorkingHoursChecks whether the potentially setlocalMaxRouteStartReductionTimeforIPillarNodecan only be used for driving, not for working. Per default this is set totrue.For more information please see
IWorkingHours.setLocalMaxRouteStartReductionTime(Duration, boolean)andIWorkingHours.setLocalMaxRouteStartReductionTimePillar(Duration, boolean).- Specified by:
isLocalReductionTimeOnlyUsedForDrivingPillarin interfaceIWorkingHours- Returns:
- the checked status or an empty Optional if no
localMaxRouteStartReductionTimehas been set
-
isLocalReductionTimeIncludedInWorkingTime
Description copied from interface:IWorkingHoursChecks whether thelocalMaxRouteStartReductionTimeis included in theWorkingHours. The default value isfalse. IffalseandIWorkingHours.setLocalMaxRouteStartReductionTime(Duration, boolean)is set totruethe driving time to the firstNodehas to be done in theResourcesprivate timeFor more information please see
IWorkingHours.setLocalMaxRouteStartReductionTime(Duration, boolean).- Specified by:
isLocalReductionTimeIncludedInWorkingTimein interfaceIWorkingHours- Returns:
- the status of an empty Optional if no
localMaxRouteStartReductionTimehas been set
-
getLocalMaxRouteStartReductionTimeMillis
Description copied from interface:IWorkingHoursGets thelocalMaxRouteStartReductionTimein milliseconds.For more information please see
IWorkingHours.setLocalMaxRouteStartReductionTime(Duration, boolean).- Specified by:
getLocalMaxRouteStartReductionTimeMillisin interfaceIWorkingHours- Returns:
- the status or an empty optional if no
localMaxRouteStartReductionTimehas been set
-
getLocalMaxRouteStartReductionTimeMillisPillar
Description copied from interface:IWorkingHoursGets thelocalMaxRouteStartReductionTimeforIPillarNodein milliseconds.For more information please see
IWorkingHours.setLocalMaxRouteStartReductionTimePillar(Duration, boolean)andIWorkingHours.setLocalMaxRouteStartReductionTime(Duration, boolean).- Specified by:
getLocalMaxRouteStartReductionTimeMillisPillarin interfaceIWorkingHours- Returns:
- the status or an empty optional if no
localMaxRouteStartReductionTimehas been set
-
setLocalFlexTime
Description copied from interface:IWorkingHoursSets the amount of time aResourcecan be expected to start working later and stay longer at work if needed.If the first
Nodeis at 11, theResources WorkingHoursstarted at 8 and thelocalFlexTimeis set to 3 hours, theResourcestarts working at 11 and has to stay 3 hours longer at work than usual. If thelocalFlexTimein the above example is set to 2 hours, theResourcewill be idle from 10-11 but it is considered working time.- Specified by:
setLocalFlexTimein interfaceIWorkingHours- Parameters:
idleTimeReductionTime- the duration of the idle time reduction time- Returns:
- true if the setting was accepted
-
getLocalFlexTimeMillis
Description copied from interface:IWorkingHoursGets thelocalFlexTimein milliseconds.For more information please see
IWorkingHours.setLocalFlexTime(Duration).- Specified by:
getLocalFlexTimeMillisin interfaceIWorkingHours- Returns:
- the long local flex time in milliseconds, an empty Optional if no
localFlexTimehas been set
-
setStartTimeHook
- Specified by:
setStartTimeHookin interfaceIWorkingHours
-
getRouteStartShiftMillisHook
- Specified by:
getRouteStartShiftMillisHookin interfaceIWorkingHours
-
addConnectionHook
- Specified by:
addConnectionHookin interfaceIWorkingHours
-
setConnectionHooks
- Specified by:
setConnectionHooksin interfaceIWorkingHours
-
getConnectionHook
- Specified by:
getConnectionHookin interfaceIWorkingHours
-
getConnectionHooks
- Specified by:
getConnectionHooksin interfaceIWorkingHours
-
hasHook
public boolean hasHook()- Specified by:
hasHookin interfaceIWorkingHours
-
setLocalMaxFreePostWorkDrivingTerminationTime
Description copied from interface:IWorkingHoursSets the amount of time theResourcecan be expected to drive home to its starting location in its free time.If returning from the last
Nodeto the starting location takes 1 hour and thefreePostWorkDrivingTerminationTimeis set to 40 minutes, those 40 minutes of the drive home are considered private time.This method sets the
local free post work driving termination timelocally. Therefore different times can be set for differentWorkingHours. If the time should be valid for all theWorkingHoursof aResourceplease useIResource.setMaxFreePostWorkDrivingTerminationTime(Duration).- Specified by:
setLocalMaxFreePostWorkDrivingTerminationTimein interfaceIWorkingHours- Parameters:
postTimeReductionTime- the duration free time that needs to be used to drive home- Returns:
- true if the setting was accepted
-
setLocalMaxFreePostWorkDrivingTerminationTime
public boolean setLocalMaxFreePostWorkDrivingTerminationTime(Duration postTimeReductionTime, boolean onlyApplyOnOvertime) Description copied from interface:IWorkingHoursSets the local max free post work driving termination time. If onlyApplyOnOvertime is true, the post driving time is only utilized if the route shows overtime. Moreover, the maximal utilized time is the overtime itself (or, if lower, the postWorkingHourTimeReductionTime).- Specified by:
setLocalMaxFreePostWorkDrivingTerminationTimein interfaceIWorkingHours- Parameters:
postTimeReductionTime- the post time reduction timeonlyApplyOnOvertime- the only apply on overtime- Returns:
- true, if successful
-
getLocalMaxFreePostWorkDrivingTerminationTimeMillis
Description copied from interface:IWorkingHoursGets thefreePostWorkDrivingTerminationTimein milliseconds.For more information please see
IWorkingHours.setLocalMaxFreePostWorkDrivingTerminationTime(Duration).- Specified by:
getLocalMaxFreePostWorkDrivingTerminationTimeMillisin interfaceIWorkingHours- Returns:
- the value or an empty Optional if no
freePostWorkDrivingTerminationTimehas been set
-
isLocalOnlyApplyFreePostWorkDrivingOnOvertime
- Specified by:
isLocalOnlyApplyFreePostWorkDrivingOnOvertimein interfaceIWorkingHours
-
setLocalMaxPillarAfterHoursTime
Description copied from interface:IWorkingHoursSets the amount of time afterWorkingHourswithin which aIPillarNodecan be set. TheResourceshave to visit thisPillareven tough it is outside ofWorkingHours.This method in only valid for a specific set of
WorkingHours. If you want to set the same time for all theWorkingHoursof aPillarplease useIResource.setMaxPillarAfterHoursTime(Duration)- Specified by:
setLocalMaxPillarAfterHoursTimein interfaceIWorkingHours- Parameters:
maxPillarEndOverTime- the duration after WorkingHours within which a Pillar still has to be given service- Returns:
- true if the setting was accepted
-
getLocalMaxPillarAfterHoursTime
Description copied from interface:IWorkingHoursGets thelocalMaxPillarAfterHoursTimeofIPillarNodein milliseconds.For more information please see
IWorkingHours.setLocalMaxPillarAfterHoursTime(Duration).- Specified by:
getLocalMaxPillarAfterHoursTimein interfaceIWorkingHours- Returns:
- the long localMaxPillarAfterHoursTime
-
addConstraint
Description copied from interface:IWorkingHoursAdds aConstraintto theWorkingHoursso onlyResourceswith that specificQualificationwill be able to serve theNodesto which thoseWorkingHoursare applied.For examples see
UKPostCodeQualificationandUKPostCodeConstraint- Specified by:
addConstraintin interfaceIWorkingHours- Parameters:
constraint- the iWorkingHoursLevelConstraint to add to the workingHours
-
addConstraint
- Specified by:
addConstraintin interfaceIWorkingHours
-
getConstraints
Description copied from interface:IWorkingHoursGets theConstraintsset on theIResource. TheResourcecan only work onNodeswithin within the range of itsConstraint.An example of its implementation is
UKPostCodeConstraint.- Specified by:
getConstraintsin interfaceIWorkingHours- Returns:
- the workingHours constraints
-
getMultiConstraints
- Specified by:
getMultiConstraintsin interfaceIWorkingHours
-
isNodeColorCodingInUse
public boolean isNodeColorCodingInUse()Description copied from interface:IWorkingHoursChecks if anyINodeColorhas been set through the use of aNodeColorCapacityItem.- Specified by:
isNodeColorCodingInUsein interfaceIWorkingHours- Returns:
- true if this is the case
-
addNodeColorCapacity
Description copied from interface:IWorkingHoursAdds a certainINodeColorto theResource. This way can be made sure thatNodeswith a certainColorare not overrepresented and can be used for white space generation.Implementation example:
double preventivePercent = 0.2; double contractorPercent = 0.5; double breakfixPercent = 0.7; workingHours.forEach(wh -> { wh.addNodeColorCapacity(new NodeColorCapacityItem(NodeColors.PREVENTIVE,preventivePercent)); wh.addNodeColorCapacity(new NodeColorCapacityItem(NodeColors.BREAKFIX,breakfixPercent)); wh.addNodeColorCapacity(new NodeColorCapacityItem(NodeColors.CONTRACTOR,contractorPercent)); }- Specified by:
addNodeColorCapacityin interfaceIWorkingHours- Parameters:
item- the nodeColorCapacityItem- See Also:
-
getNodeColorCapacityMap
Description copied from interface:IWorkingHoursGets the aMapof theNodeColorCapacity. For more information please seeINodeColorandNodeColorCapacityItem.- Specified by:
getNodeColorCapacityMapin interfaceIWorkingHours- Returns:
- the map of colorCapacity
-
getPresentColorCodes
Description copied from interface:IWorkingHoursGets theINodeColorthat are in use.- Specified by:
getPresentColorCodesin interfaceIWorkingHours- Returns:
- the Color codes
- See Also:
-
getColorCapacityItemByColorCode
Description copied from interface:IWorkingHoursGets theNodeColorCapacityItemwhich limit the amount ofColorcodedNodesaResourcecan give service to. This way can be made sure thatNodeswith a certainColorare not overrepresented and can be used for white space generation.- Specified by:
getColorCapacityItemByColorCodein interfaceIWorkingHours- Parameters:
colorCode- the int code of the color- Returns:
- the NodeColorCapacityItem or an empty Optional if no colorCapaciy has been set.
- See Also:
-
addQualification
Description copied from interface:IWorkingHoursAdds aIQualificationto theIWorkingHours, which means that by adding aIConstraintto theINode, they are limited to whichNodesthey can give service.- Specified by:
addQualificationin interfaceIWorkingHours- Parameters:
qualification- the IQualification that is to be added
-
getQualifications
Description copied from interface:IWorkingHoursGets theIQualificationof theIWorkingHours.- Specified by:
getQualificationsin interfaceIWorkingHours- Returns:
- the node qualifications
- See Also:
-
setResourceDepot
- Specified by:
setResourceDepotin interfaceIWorkingHours
-
getResourceDepot
- Specified by:
getResourceDepotin interfaceIWorkingHours
-
WorkingHours(ZonedDateTime, ZonedDateTime)instead