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 SummaryNested classes/interfaces inherited from interface com.dna.jopt.member.unit.hours.IDutyHoursIDutyHours.DutyHoursFlavour
- 
Constructor SummaryConstructorsConstructorDescriptionWorkingHours(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 SummaryModifier 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.AbstractDutyHourscompareTo, getTimeWindow, isPrefferedHour, setIsPrefferedHour, toStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.ComparablecompareToMethods inherited from interface com.dna.jopt.member.unit.hours.IDutyHoursgetTimeWindow, isPrefferedHour, setIsPrefferedHour
- 
Constructor Details- 
WorkingHoursThe 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 work
- hoursEnd- the zonedDateTime when the resource is supposed to stop working
 
- 
WorkingHours
- 
WorkingHours
- 
WorkingHoursThe constructor forWorkingHoursusingInstants. TheWorkingHoursdefine in which timeframe aCapacityResourceis able to serviceINode.- Parameters:
- hoursBegin- the zonedDateTime when the resource is allowed to begin work
- hoursEnd- the zonedDateTime when the resource is supposed to stop working
- zoneId- the zoneId ID of the time zone of the beginning and ending times
 
- 
WorkingHoursThe 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 work
- hoursEndMillis- the long milliseconds since 1970-01-01T00:00:00Z when the resource is supposed to stop working
- zoneId- the zoneId ID of the time zone of the beginning and ending times
 
- 
WorkingHourspublic 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 work
- hoursEnd- the instant when the resource is supposed to stop working
- zoneId- the zoneID of the resource starting location
- maxWorkingTime- the optional of the duration of the maximal working time
- maxDistance- the optional of the quantity of the maximal distance the resource is allowed to travel
 
- 
WorkingHoursDeprecated.please useWorkingHours(ZonedDateTime, ZonedDateTime)insteadDeprecated constructor- Parameters:
- hoursBegin- the gregorianCalendar when the resource is allowed to begin work
- hoursEnd- the gregorianCalendar when the resource is supposed to stop working
 
- 
WorkingHoursDeprecated.please useWorkingHours(ZonedDateTime, ZonedDateTime)insteadDeprecated constructor- Parameters:
- hoursBegin- the localDateTime when the resource is allowed to begin work
- hoursEnd- the localDateTime when the resource is supposed to stop working
 
- 
WorkingHoursDeprecated.please useWorkingHours(ZonedDateTime, ZonedDateTime)insteadDeprecated constructor- Parameters:
- hoursBegin- the instant when the resource is allowed to begin work
- hoursEnd- the instant when the resource is supposed to stop working
 
- 
WorkingHoursDeprecated.please useWorkingHours(ZonedDateTime, ZonedDateTime)insteadDeprecated constructor- Parameters:
- interval- the range instant when the resource is supposed to start and stop working
 
- 
WorkingHoursDeprecated.please useWorkingHours(ZonedDateTime, ZonedDateTime)insteadDeprecated constructor- Parameters:
- hoursBeginMillis- the long seconds since 01.01.1970 when the resource is allowed to begin work
- hoursEndMillis- 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 work
- hoursEnd- instant when the resource is supposed to stop working
- maxWorkingTime- the duration of the maximal working time per day
- maxDistance- 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 work
- hoursEnd- instant when the resource is supposed to stop working
- maxWorkingTime- the optional duration of the maximal working time per day
- maxDistance- 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 work
- maxWorkingTime- duration of the maximal working time per day
- maxDistance- quantity length maximal distance the resource should travel per day
 
 
- 
- 
Method Details- 
copyDescription 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 interface- IDutyHours
- Specified by:
- copyin interface- IWorkingHours
- Returns:
- a copy of the WorkingHours
 
- 
takeOverProperties
- 
takeOverPropertiespublic static IWorkingHours takeOverProperties(IWorkingHours src, IWorkingHours target, boolean doStartUpdate) 
- 
setIsAvailableForStaypublic 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 interface- IWorkingHours
- Parameters:
- isAvailableForStay- boolean, the default value is- true.
 
- 
getIsAvailableForStaypublic 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 interface- IWorkingHours
- Returns:
- boolean, the default value is true.
 
- 
getFlavourDescription copied from interface:IDutyHoursGets theIDutyHours.DutyHoursFlavour.WOH_FLAVOUR, the default value isenum constant ordinal: 0.- Specified by:
- getFlavourin interface- IDutyHours
- Returns:
- the enum constant ordinal
 
- 
setMaxWorkingTimeDescription copied from interface:IWorkingHoursSets the maximum number of hours aResourceis allowed to work per day.- Specified by:
- setMaxWorkingTimein interface- IWorkingHours
- Parameters:
- maxWorkingTime- the maximal working time
 
- 
setMaxHoursDeprecated.Description copied from interface:IWorkingHoursDecrecated methodSets the maxHoursaResourceis allowed to work per day.- Specified by:
- setMaxHoursin interface- IWorkingHours
- Parameters:
- maxWorkingTime- the double to be set for- maxHours
 
- 
getMaxHourspublic 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 interface- IWorkingHours
- Returns:
- the double maxHours.
 
- 
setMaxDistancepublic 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 interface- IWorkingHours
- Parameters:
- maxDistance- the quantity, will be- castedto kilometre
 
- 
getMaxDistanceKmpublic 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 interface- IWorkingHours
- Returns:
- double maxDistancein km. By default it is not usable and the value is -1.
 
- 
setIsClosedRoutepublic 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 interface- IWorkingHours
- Parameters:
- isClosedRoute- the boolean if the Route is a closed Route
- See Also:
 
- 
isClosedRoutepublic 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 interface- IWorkingHours
- Returns:
- the boolean isClosedRoute
- See Also:
 
- 
setLocalStayOutCycleDefinitionDescription 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 interface- IWorkingHours
- Parameters:
- cycle- duration of the cycle
- cycleStart- the localDate of the cycle start
 
- 
getLocalStayOutCycleDescription copied from interface:IWorkingHoursGets theDurationof the potential localstayout cycle.For more information please see IWorkingHours.setLocalStayOutCycleDefinition(Duration, LocalDate).- Specified by:
- getLocalStayOutCyclein interface- IWorkingHours
- Returns:
- the duration of the local stayOutCycle
 
- 
getLocalStayOutCycleStartDescription copied from interface:IWorkingHoursGets the start of the localstayout cycle.For more information please see IWorkingHours.setLocalStayOutCycleDefinition(Duration, LocalDate).- Specified by:
- getLocalStayOutCycleStartin interface- IWorkingHours
- Returns:
- the date of the localStayCycleStart
 
- 
setLocalReductionTimeIsIncludedInWorkingTimepublic 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 interface- IWorkingHours
- Parameters:
- isIncludedInTotalWorkingTime- the boolean whether reduction time is included in the WorkingHours
 
- 
setLocalMaxRouteStartReductionTimepublic 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 interface- IWorkingHours
- Parameters:
- maxRouteStartReductionTime- the duration of the maxRouteStartReductionTime
- isOnlyUsedForDriving- the boolean whether the time can only be used for driving
- Returns:
- false if reductionTime is null or negative
 
- 
setLocalMaxRouteStartReductionTimePillarpublic 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 interface- IWorkingHours
- Parameters:
- maxRouteStartReductionTime- the duration of the localMaxStartReductionTimePillar
- isOnlyUsedForDriving- the boolean whether it is only used for driving
- Returns:
- false if reductionTime is null or negative
 
- 
isLocalReductionTimeOnlyUsedForDrivingDescription 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 interface- IWorkingHours
- Returns:
- the checked status or an empty Optional if no localMaxRouteStartReductionTimehas been set
 
- 
isLocalReductionTimeOnlyUsedForDrivingPillarDescription 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 interface- IWorkingHours
- Returns:
- the checked status or an empty Optional if no localMaxRouteStartReductionTimehas been set
 
- 
isLocalReductionTimeIncludedInWorkingTimeDescription 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 interface- IWorkingHours
- Returns:
- the status of an empty Optional if no localMaxRouteStartReductionTimehas been set
 
- 
getLocalMaxRouteStartReductionTimeMillisDescription copied from interface:IWorkingHoursGets thelocalMaxRouteStartReductionTimein milliseconds.For more information please see IWorkingHours.setLocalMaxRouteStartReductionTime(Duration, boolean).- Specified by:
- getLocalMaxRouteStartReductionTimeMillisin interface- IWorkingHours
- Returns:
- the status or an empty optional if no localMaxRouteStartReductionTimehas been set
 
- 
getLocalMaxRouteStartReductionTimeMillisPillarDescription copied from interface:IWorkingHoursGets thelocalMaxRouteStartReductionTimeforIPillarNodein milliseconds.For more information please see IWorkingHours.setLocalMaxRouteStartReductionTimePillar(Duration, boolean)andIWorkingHours.setLocalMaxRouteStartReductionTime(Duration, boolean).- Specified by:
- getLocalMaxRouteStartReductionTimeMillisPillarin interface- IWorkingHours
- Returns:
- the status or an empty optional if no localMaxRouteStartReductionTimehas been set
 
- 
setLocalFlexTimeDescription 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 interface- IWorkingHours
- Parameters:
- idleTimeReductionTime- the duration of the idle time reduction time
- Returns:
- true if the setting was accepted
 
- 
getLocalFlexTimeMillisDescription copied from interface:IWorkingHoursGets thelocalFlexTimein milliseconds.For more information please see IWorkingHours.setLocalFlexTime(Duration).- Specified by:
- getLocalFlexTimeMillisin interface- IWorkingHours
- Returns:
- the long local flex time in milliseconds, an empty Optional if no localFlexTimehas been set
 
- 
setStartTimeHook- Specified by:
- setStartTimeHookin interface- IWorkingHours
 
- 
getRouteStartShiftMillisHook- Specified by:
- getRouteStartShiftMillisHookin interface- IWorkingHours
 
- 
addConnectionHook- Specified by:
- addConnectionHookin interface- IWorkingHours
 
- 
setConnectionHooks- Specified by:
- setConnectionHooksin interface- IWorkingHours
 
- 
getConnectionHook- Specified by:
- getConnectionHookin interface- IWorkingHours
 
- 
getConnectionHooks- Specified by:
- getConnectionHooksin interface- IWorkingHours
 
- 
hasHookpublic boolean hasHook()- Specified by:
- hasHookin interface- IWorkingHours
 
- 
setLocalMaxFreePostWorkDrivingTerminationTimeDescription 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 interface- IWorkingHours
- Parameters:
- postTimeReductionTime- the duration free time that needs to be used to drive home
- Returns:
- true if the setting was accepted
 
- 
setLocalMaxFreePostWorkDrivingTerminationTimepublic 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 interface- IWorkingHours
- Parameters:
- postTimeReductionTime- the post time reduction time
- onlyApplyOnOvertime- the only apply on overtime
- Returns:
- true, if successful
 
- 
getLocalMaxFreePostWorkDrivingTerminationTimeMillisDescription copied from interface:IWorkingHoursGets thefreePostWorkDrivingTerminationTimein milliseconds.For more information please see IWorkingHours.setLocalMaxFreePostWorkDrivingTerminationTime(Duration).- Specified by:
- getLocalMaxFreePostWorkDrivingTerminationTimeMillisin interface- IWorkingHours
- Returns:
- the value or an empty Optional if no freePostWorkDrivingTerminationTimehas been set
 
- 
isLocalOnlyApplyFreePostWorkDrivingOnOvertime- Specified by:
- isLocalOnlyApplyFreePostWorkDrivingOnOvertimein interface- IWorkingHours
 
- 
setLocalMaxPillarAfterHoursTimeDescription 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 interface- IWorkingHours
- Parameters:
- maxPillarEndOverTime- the duration after WorkingHours within which a Pillar still has to be given service
- Returns:
- true if the setting was accepted
 
- 
getLocalMaxPillarAfterHoursTimeDescription copied from interface:IWorkingHoursGets thelocalMaxPillarAfterHoursTimeofIPillarNodein milliseconds.For more information please see IWorkingHours.setLocalMaxPillarAfterHoursTime(Duration).- Specified by:
- getLocalMaxPillarAfterHoursTimein interface- IWorkingHours
- Returns:
- the long localMaxPillarAfterHoursTime
 
- 
addConstraintDescription copied from interface:IWorkingHoursAdds aConstraintto theWorkingHoursso onlyResourceswith that specificQualificationwill be able to serve theNodesto which thoseWorkingHoursare applied.For examples see UKPostCodeQualificationandUKPostCodeConstraint- Specified by:
- addConstraintin interface- IWorkingHours
- Parameters:
- constraint- the iWorkingHoursLevelConstraint to add to the workingHours
 
- 
addConstraint- Specified by:
- addConstraintin interface- IWorkingHours
 
- 
getConstraintsDescription 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 interface- IWorkingHours
- Returns:
- the workingHours constraints
 
- 
getMultiConstraints- Specified by:
- getMultiConstraintsin interface- IWorkingHours
 
- 
isNodeColorCodingInUsepublic boolean isNodeColorCodingInUse()Description copied from interface:IWorkingHoursChecks if anyINodeColorhas been set through the use of aNodeColorCapacityItem.- Specified by:
- isNodeColorCodingInUsein interface- IWorkingHours
- Returns:
- true if this is the case
 
- 
addNodeColorCapacityDescription 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 interface- IWorkingHours
- Parameters:
- item- the nodeColorCapacityItem
- See Also:
 
- 
getNodeColorCapacityMapDescription copied from interface:IWorkingHoursGets the aMapof theNodeColorCapacity. For more information please seeINodeColorandNodeColorCapacityItem.- Specified by:
- getNodeColorCapacityMapin interface- IWorkingHours
- Returns:
- the map of colorCapacity
 
- 
getPresentColorCodesDescription copied from interface:IWorkingHoursGets theINodeColorthat are in use.- Specified by:
- getPresentColorCodesin interface- IWorkingHours
- Returns:
- the Color codes
- See Also:
 
- 
getColorCapacityItemByColorCodeDescription 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 interface- IWorkingHours
- Parameters:
- colorCode- the int code of the color
- Returns:
- the NodeColorCapacityItem or an empty Optional if no colorCapaciy has been set.
- See Also:
 
- 
addQualificationDescription copied from interface:IWorkingHoursAdds aIQualificationto theIWorkingHours, which means that by adding aIConstraintto theINode, they are limited to whichNodesthey can give service.- Specified by:
- addQualificationin interface- IWorkingHours
- Parameters:
- qualification- the IQualification that is to be added
 
- 
getQualificationsDescription copied from interface:IWorkingHoursGets theIQualificationof theIWorkingHours.- Specified by:
- getQualificationsin interface- IWorkingHours
- Returns:
- the node qualifications
- See Also:
 
- 
setResourceDepot- Specified by:
- setResourceDepotin interface- IWorkingHours
 
- 
getResourceDepot- Specified by:
- getResourceDepotin interface- IWorkingHours
 
 
- 
WorkingHours(ZonedDateTime, ZonedDateTime)instead