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
ConstructorDescriptionWorkingHours
(long hoursBeginMillis, long hoursEndMillis) Deprecated.WorkingHours
(long hoursBeginMillis, long hoursEndMillis, ZoneId zoneId) The constructor forWorkingHours
using 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 forWorkingHours
usingInstants
.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 forWorkingHours
usingAbstractDutyHours(ZonedDateTime, ZonedDateTime)
.WorkingHours
(GregorianCalendar hoursBegin, GregorianCalendar hoursEnd) Deprecated.please useWorkingHours(ZonedDateTime, ZonedDateTime)
instead -
Method Summary
Modifier and TypeMethodDescriptionboolean
void
addConstraint
(IWorkingHoursLevelConstraint constraint) Adds aConstraint
to theWorkingHours
so onlyResources
with that specificQualification
will be able to serve theNodes
to which thoseWorkingHours
are applied.void
addConstraint
(IMultiWorkingHoursLevelConstraint constraint) void
Adds a certainINodeColor
to theResource
.void
addQualification
(IQualification qualification) Adds aIQualification
to theIWorkingHours
, which means that by adding aIConstraint
to theINode
, they are limited to whichNodes
they 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 theNodeColorCapacityItem
which limit the amount ofColor
codedNodes
aResource
can give service to.getConnectionHook
(String toId) Gets theConstraints
set on theIResource
.Gets theIDutyHours.DutyHoursFlavour.WOH_FLAVOUR
, the default value isenum constant ordinal: 0
.boolean
Gets if theResource
is allowed to do anovernight stay
.Gets thelocalFlexTime
in milliseconds.Gets thefreePostWorkDrivingTerminationTime
in milliseconds.Gets thelocalMaxPillarAfterHoursTime
ofIPillarNode
in milliseconds.Gets thelocalMaxRouteStartReductionTime
in milliseconds.Gets thelocalMaxRouteStartReductionTime
forIPillarNode
in milliseconds.Gets theDuration
of the potential localstayout cycle
.Gets the start of the localstayout cycle
.double
Gets themaxDistance
, which is the maximal distance in km aResource
is allowed to travel without aIViolation
per day.double
Gets maximum number of hours aResource
is allowed to work per day inhours
.Gets the aMap
of theNodeColorCapacity
.Gets theINodeColor
that are in use.Map<Class<? extends IQualification>,
IQualification> Gets theIQualification
of theIWorkingHours
.boolean
hasHook()
boolean
Checks if the route is closed or not, the default value isfalse
.Checks whether thelocalMaxRouteStartReductionTime
is included in theWorkingHours
.Checks whether the potentially setlocalMaxRouteStartReductionTime
can only be used for driving, not for working.Checks whether the potentially setlocalMaxRouteStartReductionTime
forIPillarNode
can only be used for driving, not for working.boolean
Checks if anyINodeColor
has been set through the use of aNodeColorCapacityItem
.boolean
void
setIsAvailableForStay
(boolean isAvailableForStay) Sets if theResource
is allowed for anovernight stay
instead of returning to the starting location.void
setIsClosedRoute
(boolean isClosedRoute) Sets theRoute
to aclosed Route
.boolean
setLocalFlexTime
(Duration idleTimeReductionTime) Sets the amount of time aResource
can be expected to start working later and stay longer at work if needed.boolean
setLocalMaxFreePostWorkDrivingTerminationTime
(Duration postTimeReductionTime) Sets the amount of time theResource
can be expected to drive home to its starting location in its free time.boolean
setLocalMaxFreePostWorkDrivingTerminationTime
(Duration postTimeReductionTime, boolean onlyApplyOnOvertime) Sets the local max free post work driving termination time.boolean
setLocalMaxPillarAfterHoursTime
(Duration maxPillarEndOverTime) Sets the amount of time afterWorkingHours
within which aIPillarNode
can be set.boolean
setLocalMaxRouteStartReductionTime
(Duration maxRouteStartReductionTime, boolean isOnlyUsedForDriving) Sets the maximum time which theResource
can be expected to drive to the firstNode
in its private time.boolean
setLocalMaxRouteStartReductionTimePillar
(Duration maxRouteStartReductionTime, boolean isOnlyUsedForDriving) Sets thelocalMaxRouteStartReductionTime
forIPillarNode
.void
setLocalReductionTimeIsIncludedInWorkingTime
(boolean isIncludedInTotalWorkingTime) Sets whether thelocalMaxRouteStartReductionTime
is included in theWorkingHours
.void
setLocalStayOutCycleDefinition
(Duration cycle, LocalDate cycleStart) Sets theDuration
of the cycle within which the maximum number ofovernight stays
are allowed and within which the minimumrecovery time
(WorkingHours
withoutovernight stays
) has to be observed.void
setMaxDistance
(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance) Sets the maximal distance that aResource
is allowed to travel per day, cannot be null.void
setMaxHours
(Duration maxWorkingTime) Deprecated.void
setMaxWorkingTime
(Duration maxWorkingTime) Sets the maximum number of hours aResource
is allowed to work per day.void
setResourceDepot
(IResourceDepot depot) boolean
setStartTimeHook
(Duration routeStartTimeHookDuration) static IWorkingHours
takeOverProperties
(IWorkingHours src, IWorkingHours target) static IWorkingHours
takeOverProperties
(IWorkingHours src, IWorkingHours target, boolean doStartUpdate) Methods inherited from class com.dna.jopt.member.unit.hours.AbstractDutyHours
compareTo, getTimeWindow, isPrefferedHour, setIsPrefferedHour, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.dna.jopt.member.unit.hours.IDutyHours
getTimeWindow, isPrefferedHour, setIsPrefferedHour
-
Constructor Details
-
WorkingHours
The constructor forWorkingHours
usingAbstractDutyHours(ZonedDateTime, ZonedDateTime)
. TheWorkingHours
define in which timeframe aIResource
is able to serviceINode
. Internally the time eventually is handled as seconds since the epoch 1970-01-01T00:00:00Z. Thetime zone
is 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 forWorkingHours
usingInstants
. TheWorkingHours
define in which timeframe aCapacityResource
is 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 forWorkingHours
using milliseconds since 01.01.1970. TheWorkingHours
define in which timeframe aCapacityResource
is 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:IWorkingHours
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.- Specified by:
copy
in interfaceIDutyHours
- Specified by:
copy
in 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:IWorkingHours
Sets if theResource
is allowed for anovernight stay
instead of returning to the starting location. TheNode
also needsINode.setIsStayNode(boolean)
set totrue
so this function can be used.- Specified by:
setIsAvailableForStay
in interfaceIWorkingHours
- Parameters:
isAvailableForStay
- boolean, the default value istrue
.
-
getIsAvailableForStay
public boolean getIsAvailableForStay()Description copied from interface:IWorkingHours
Gets if theResource
is allowed to do anovernight stay
. TheNode
also needsINode.setIsStayNode(boolean)
set totrue
so this function can be used.This method is specific for the set
WorkingHours
and can therefore be specific for certain days in the week (noovernight stays
on Fridays.- Specified by:
getIsAvailableForStay
in interfaceIWorkingHours
- Returns:
- boolean, the default value is
true
.
-
getFlavour
Description copied from interface:IDutyHours
Gets theIDutyHours.DutyHoursFlavour.WOH_FLAVOUR
, the default value isenum constant ordinal: 0
.- Specified by:
getFlavour
in interfaceIDutyHours
- Returns:
- the enum constant ordinal
-
setMaxWorkingTime
Description copied from interface:IWorkingHours
Sets the maximum number of hours aResource
is allowed to work per day.- Specified by:
setMaxWorkingTime
in interfaceIWorkingHours
- Parameters:
maxWorkingTime
- the maximal working time
-
setMaxHours
Deprecated.Description copied from interface:IWorkingHours
Decrecated methodSets the
maxHours
aResource
is allowed to work per day.- Specified by:
setMaxHours
in interfaceIWorkingHours
- Parameters:
maxWorkingTime
- the double to be set formaxHours
-
getMaxHours
public double getMaxHours()Description copied from interface:IWorkingHours
Gets maximum number of hours aResource
is allowed to work per day inhours
. By default it is not usable and the value is -1.- Specified by:
getMaxHours
in interfaceIWorkingHours
- Returns:
- the double
maxHours
.
-
setMaxDistance
public void setMaxDistance(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance) Description copied from interface:IWorkingHours
Sets the maximal distance that aResource
is allowed to travel per day, cannot be null.- Specified by:
setMaxDistance
in interfaceIWorkingHours
- Parameters:
maxDistance
- the quantity, will becasted
to kilometre
-
getMaxDistanceKm
public double getMaxDistanceKm()Description copied from interface:IWorkingHours
Gets themaxDistance
, which is the maximal distance in km aResource
is allowed to travel without aIViolation
per day.- Specified by:
getMaxDistanceKm
in interfaceIWorkingHours
- Returns:
- double
maxDistance
in km. By default it is not usable and the value is -1.
-
setIsClosedRoute
public void setIsClosedRoute(boolean isClosedRoute) Description copied from interface:IWorkingHours
Sets theRoute
to aclosed Route
. Aclosed Route
is aRoute
where theResource
is going to its home afterwards. Anopen Route
is aRoute
where theResource
is simply staying at the lastNode
ifOverNightStay
also has been activated or where theResource
has to travel home outside of theWorkingHours
. The default value is true.- Specified by:
setIsClosedRoute
in interfaceIWorkingHours
- Parameters:
isClosedRoute
- the boolean if the Route is a closed Route- See Also:
-
isClosedRoute
public boolean isClosedRoute()Description copied from interface:IWorkingHours
Checks if the route is closed or not, the default value isfalse
. Aclosed Route
is aRoute
where theResource
is going to its home afterwards. Anopen Route
is aRoute
where theResource
is simply staying at the lastNode
ifOverNightStay
also has been activated or where theResource
has to travel home outside of theWorkingHours
. The default value is true.- Specified by:
isClosedRoute
in interfaceIWorkingHours
- Returns:
- the boolean
isClosedRoute
- See Also:
-
setLocalStayOutCycleDefinition
Description copied from interface:IWorkingHours
Sets theDuration
of the cycle within which the maximum number ofovernight stays
are allowed and within which the minimumrecovery time
(WorkingHours
withoutovernight stays
) has to be observed. Therecovery time
is set inIResource.setStayOutCycleDefinition(Duration, LocalDate)
.Without setting the cycle the maximal number of
overnight stays
will not be refreshed and count for the full duration of theWorkingHours
. The cycle can be applied to the localResource
which means it will stay the same for thisResource
throughout theOptimization
. If like here setlocally
it is only valid for thisWorkingHours
and the cycle can change depending on the dates or time in the week. It can for example be set that noovernight stays
are allowed on Fridays.- Specified by:
setLocalStayOutCycleDefinition
in interfaceIWorkingHours
- Parameters:
cycle
- duration of the cyclecycleStart
- the localDate of the cycle start
-
getLocalStayOutCycle
Description copied from interface:IWorkingHours
Gets theDuration
of the potential localstayout cycle
.For more information please see
IWorkingHours.setLocalStayOutCycleDefinition(Duration, LocalDate)
.- Specified by:
getLocalStayOutCycle
in interfaceIWorkingHours
- Returns:
- the duration of the local stayOutCycle
-
getLocalStayOutCycleStart
Description copied from interface:IWorkingHours
Gets the start of the localstayout cycle
.For more information please see
IWorkingHours.setLocalStayOutCycleDefinition(Duration, LocalDate)
.- Specified by:
getLocalStayOutCycleStart
in interfaceIWorkingHours
- Returns:
- the date of the localStayCycleStart
-
setLocalReductionTimeIsIncludedInWorkingTime
public void setLocalReductionTimeIsIncludedInWorkingTime(boolean isIncludedInTotalWorkingTime) Description copied from interface:IWorkingHours
Sets whether thelocalMaxRouteStartReductionTime
is included in theWorkingHours
. The default value isfalse
. Iffalse
andIWorkingHours.setLocalMaxRouteStartReductionTime(Duration, boolean)
is set totrue
the driving time to the firstNode
has to be done in theResources
private timeFor more information please see
IWorkingHours.setLocalMaxRouteStartReductionTime(Duration, boolean)
.- Specified by:
setLocalReductionTimeIsIncludedInWorkingTime
in 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:IWorkingHours
Sets the maximum time which theResource
can be expected to drive to the firstNode
in its private time.If the
OpeningHours
of aNode
and theWorkingHours
of aResource
start at 8 the driving time is an hour and theResource
'slocalMaxRouteStartReductionTime
is 30 Minutes theResource
will start driving towards theNode
at 7.30 (outside of itsWorkingHours
) and arrive there at 8.30.The
Boolean
defines whether thelocalMaxRouteStartReductionTime
can only be used for driving or not and is usually set totrue
. TheResource
can not work in thelocalMaxRouteStartReductionTime
in that case.If like here set
locally
thelocalMaxRouteStartReductionTime
is only valid for these specificWorkingHours
.- Specified by:
setLocalMaxRouteStartReductionTime
in 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:IWorkingHours
Sets thelocalMaxRouteStartReductionTime
forIPillarNode
. Overwrites the setlocalMaxRouteStartReductionTime
and sets the new value forPillars
. If nolocalMaxRouteStartReductionTime
has been set, sets the new value forPillars
only.For more information please see
IWorkingHours.setLocalMaxRouteStartReductionTime(Duration, boolean)
.- Specified by:
setLocalMaxRouteStartReductionTimePillar
in 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:IWorkingHours
Checks whether the potentially setlocalMaxRouteStartReductionTime
can 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:
isLocalReductionTimeOnlyUsedForDriving
in interfaceIWorkingHours
- Returns:
- the checked status or an empty Optional if no
localMaxRouteStartReductionTime
has been set
-
isLocalReductionTimeOnlyUsedForDrivingPillar
Description copied from interface:IWorkingHours
Checks whether the potentially setlocalMaxRouteStartReductionTime
forIPillarNode
can 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:
isLocalReductionTimeOnlyUsedForDrivingPillar
in interfaceIWorkingHours
- Returns:
- the checked status or an empty Optional if no
localMaxRouteStartReductionTime
has been set
-
isLocalReductionTimeIncludedInWorkingTime
Description copied from interface:IWorkingHours
Checks whether thelocalMaxRouteStartReductionTime
is included in theWorkingHours
. The default value isfalse
. Iffalse
andIWorkingHours.setLocalMaxRouteStartReductionTime(Duration, boolean)
is set totrue
the driving time to the firstNode
has to be done in theResources
private timeFor more information please see
IWorkingHours.setLocalMaxRouteStartReductionTime(Duration, boolean)
.- Specified by:
isLocalReductionTimeIncludedInWorkingTime
in interfaceIWorkingHours
- Returns:
- the status of an empty Optional if no
localMaxRouteStartReductionTime
has been set
-
getLocalMaxRouteStartReductionTimeMillis
Description copied from interface:IWorkingHours
Gets thelocalMaxRouteStartReductionTime
in milliseconds.For more information please see
IWorkingHours.setLocalMaxRouteStartReductionTime(Duration, boolean)
.- Specified by:
getLocalMaxRouteStartReductionTimeMillis
in interfaceIWorkingHours
- Returns:
- the status or an empty optional if no
localMaxRouteStartReductionTime
has been set
-
getLocalMaxRouteStartReductionTimeMillisPillar
Description copied from interface:IWorkingHours
Gets thelocalMaxRouteStartReductionTime
forIPillarNode
in milliseconds.For more information please see
IWorkingHours.setLocalMaxRouteStartReductionTimePillar(Duration, boolean)
andIWorkingHours.setLocalMaxRouteStartReductionTime(Duration, boolean)
.- Specified by:
getLocalMaxRouteStartReductionTimeMillisPillar
in interfaceIWorkingHours
- Returns:
- the status or an empty optional if no
localMaxRouteStartReductionTime
has been set
-
setLocalFlexTime
Description copied from interface:IWorkingHours
Sets the amount of time aResource
can be expected to start working later and stay longer at work if needed.If the first
Node
is at 11, theResources WorkingHours
started at 8 and thelocalFlexTime
is set to 3 hours, theResource
starts working at 11 and has to stay 3 hours longer at work than usual. If thelocalFlexTime
in the above example is set to 2 hours, theResource
will be idle from 10-11 but it is considered working time.- Specified by:
setLocalFlexTime
in interfaceIWorkingHours
- Parameters:
idleTimeReductionTime
- the duration of the idle time reduction time- Returns:
- true if the setting was accepted
-
getLocalFlexTimeMillis
Description copied from interface:IWorkingHours
Gets thelocalFlexTime
in milliseconds.For more information please see
IWorkingHours.setLocalFlexTime(Duration)
.- Specified by:
getLocalFlexTimeMillis
in interfaceIWorkingHours
- Returns:
- the long local flex time in milliseconds, an empty Optional if no
localFlexTime
has been set
-
setStartTimeHook
- Specified by:
setStartTimeHook
in interfaceIWorkingHours
-
getRouteStartShiftMillisHook
- Specified by:
getRouteStartShiftMillisHook
in interfaceIWorkingHours
-
addConnectionHook
- Specified by:
addConnectionHook
in interfaceIWorkingHours
-
setConnectionHooks
- Specified by:
setConnectionHooks
in interfaceIWorkingHours
-
getConnectionHook
- Specified by:
getConnectionHook
in interfaceIWorkingHours
-
getConnectionHooks
- Specified by:
getConnectionHooks
in interfaceIWorkingHours
-
hasHook
public boolean hasHook()- Specified by:
hasHook
in interfaceIWorkingHours
-
setLocalMaxFreePostWorkDrivingTerminationTime
Description copied from interface:IWorkingHours
Sets the amount of time theResource
can be expected to drive home to its starting location in its free time.If returning from the last
Node
to the starting location takes 1 hour and thefreePostWorkDrivingTerminationTime
is 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 time
locally. Therefore different times can be set for differentWorkingHours
. If the time should be valid for all theWorkingHours
of aResource
please useIResource.setMaxFreePostWorkDrivingTerminationTime(Duration)
.- Specified by:
setLocalMaxFreePostWorkDrivingTerminationTime
in 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:IWorkingHours
Sets 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:
setLocalMaxFreePostWorkDrivingTerminationTime
in interfaceIWorkingHours
- Parameters:
postTimeReductionTime
- the post time reduction timeonlyApplyOnOvertime
- the only apply on overtime- Returns:
- true, if successful
-
getLocalMaxFreePostWorkDrivingTerminationTimeMillis
Description copied from interface:IWorkingHours
Gets thefreePostWorkDrivingTerminationTime
in milliseconds.For more information please see
IWorkingHours.setLocalMaxFreePostWorkDrivingTerminationTime(Duration)
.- Specified by:
getLocalMaxFreePostWorkDrivingTerminationTimeMillis
in interfaceIWorkingHours
- Returns:
- the value or an empty Optional if no
freePostWorkDrivingTerminationTime
has been set
-
isLocalOnlyApplyFreePostWorkDrivingOnOvertime
- Specified by:
isLocalOnlyApplyFreePostWorkDrivingOnOvertime
in interfaceIWorkingHours
-
setLocalMaxPillarAfterHoursTime
Description copied from interface:IWorkingHours
Sets the amount of time afterWorkingHours
within which aIPillarNode
can be set. TheResources
have to visit thisPillar
even 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 theWorkingHours
of aPillar
please useIResource.setMaxPillarAfterHoursTime(Duration)
- Specified by:
setLocalMaxPillarAfterHoursTime
in 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:IWorkingHours
Gets thelocalMaxPillarAfterHoursTime
ofIPillarNode
in milliseconds.For more information please see
IWorkingHours.setLocalMaxPillarAfterHoursTime(Duration)
.- Specified by:
getLocalMaxPillarAfterHoursTime
in interfaceIWorkingHours
- Returns:
- the long localMaxPillarAfterHoursTime
-
addConstraint
Description copied from interface:IWorkingHours
Adds aConstraint
to theWorkingHours
so onlyResources
with that specificQualification
will be able to serve theNodes
to which thoseWorkingHours
are applied.For examples see
UKPostCodeQualification
andUKPostCodeConstraint
- Specified by:
addConstraint
in interfaceIWorkingHours
- Parameters:
constraint
- the iWorkingHoursLevelConstraint to add to the workingHours
-
addConstraint
- Specified by:
addConstraint
in interfaceIWorkingHours
-
getConstraints
Description copied from interface:IWorkingHours
Gets theConstraints
set on theIResource
. TheResource
can only work onNodes
within within the range of itsConstraint
.An example of its implementation is
UKPostCodeConstraint
.- Specified by:
getConstraints
in interfaceIWorkingHours
- Returns:
- the workingHours constraints
-
getMultiConstraints
- Specified by:
getMultiConstraints
in interfaceIWorkingHours
-
isNodeColorCodingInUse
public boolean isNodeColorCodingInUse()Description copied from interface:IWorkingHours
Checks if anyINodeColor
has been set through the use of aNodeColorCapacityItem
.- Specified by:
isNodeColorCodingInUse
in interfaceIWorkingHours
- Returns:
- true if this is the case
-
addNodeColorCapacity
Description copied from interface:IWorkingHours
Adds a certainINodeColor
to theResource
. This way can be made sure thatNodes
with a certainColor
are 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:
addNodeColorCapacity
in interfaceIWorkingHours
- Parameters:
item
- the nodeColorCapacityItem- See Also:
-
getNodeColorCapacityMap
Description copied from interface:IWorkingHours
Gets the aMap
of theNodeColorCapacity
. For more information please seeINodeColor
andNodeColorCapacityItem
.- Specified by:
getNodeColorCapacityMap
in interfaceIWorkingHours
- Returns:
- the map of colorCapacity
-
getPresentColorCodes
Description copied from interface:IWorkingHours
Gets theINodeColor
that are in use.- Specified by:
getPresentColorCodes
in interfaceIWorkingHours
- Returns:
- the Color codes
- See Also:
-
getColorCapacityItemByColorCode
Description copied from interface:IWorkingHours
Gets theNodeColorCapacityItem
which limit the amount ofColor
codedNodes
aResource
can give service to. This way can be made sure thatNodes
with a certainColor
are not overrepresented and can be used for white space generation.- Specified by:
getColorCapacityItemByColorCode
in 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:IWorkingHours
Adds aIQualification
to theIWorkingHours
, which means that by adding aIConstraint
to theINode
, they are limited to whichNodes
they can give service.- Specified by:
addQualification
in interfaceIWorkingHours
- Parameters:
qualification
- the IQualification that is to be added
-
getQualifications
Description copied from interface:IWorkingHours
Gets theIQualification
of theIWorkingHours
.- Specified by:
getQualifications
in interfaceIWorkingHours
- Returns:
- the node qualifications
- See Also:
-
setResourceDepot
- Specified by:
setResourceDepot
in interfaceIWorkingHours
-
getResourceDepot
- Specified by:
getResourceDepot
in interfaceIWorkingHours
-
WorkingHours(ZonedDateTime, ZonedDateTime)
instead