public class WorkingHours extends AbstractDutyHours implements IWorkingHours
IResource
is allowed to work. If
a Resource
is working outside of its WorkingHours
a Violation
will be thrown.IDutyHours.DutyHoursFlavour
Constructor and Description |
---|
WorkingHours(GregorianCalendar hoursBegin,
GregorianCalendar hoursEnd)
Deprecated.
please use
WorkingHours(ZonedDateTime, ZonedDateTime)
instead |
WorkingHours(Instant hoursBegin,
Instant hoursEnd)
Deprecated.
please use
WorkingHours(ZonedDateTime, ZonedDateTime) instead |
WorkingHours(Instant hoursBegin,
Instant hoursEnd,
Duration maxWorkingTime,
javax.measure.Quantity<javax.measure.quantity.Length> maxDistance)
Deprecated.
please use
WorkingHours(ZonedDateTime, ZonedDateTime) instead. The |
WorkingHours(Instant hoursBegin,
Instant hoursEnd,
Optional<Duration> maxWorkingTime,
Optional<javax.measure.Quantity<javax.measure.quantity.Length>> maxDistance)
Deprecated.
please use
WorkingHours(ZonedDateTime, ZonedDateTime) instead. The |
WorkingHours(Instant hoursBegin,
Instant hoursEnd,
ZoneId zoneId)
The constructor for
WorkingHours using Instants . |
WorkingHours(Instant hoursBegin,
Instant hoursEnd,
ZoneId zoneId,
Optional<Duration> maxWorkingTime,
Optional<javax.measure.Quantity<javax.measure.quantity.Length>> maxDistance) |
WorkingHours(LocalDateTime hoursBegin,
LocalDateTime hoursEnd)
Deprecated.
please use
WorkingHours(ZonedDateTime, ZonedDateTime) instead |
WorkingHours(long hoursBeginMillis,
long hoursEndMillis)
Deprecated.
please use
WorkingHours(ZonedDateTime, ZonedDateTime) instead |
WorkingHours(long hoursBeginMillis,
long hoursEndMillis,
ZoneId zoneId)
The constructor for
WorkingHours using milliseconds since 01.01.1970. |
WorkingHours(com.google.common.collect.Range<Instant> interval)
Deprecated.
please use
WorkingHours(ZonedDateTime, ZonedDateTime) instead |
WorkingHours(com.google.common.collect.Range<Instant> interval,
Duration maxWorkingTime,
javax.measure.Quantity<javax.measure.quantity.Length> maxDistance)
Deprecated.
please use
WorkingHours(ZonedDateTime, ZonedDateTime) instead. The |
WorkingHours(TimeWindow window) |
WorkingHours(ZonedDateTime hoursBegin,
Duration maxTime) |
WorkingHours(ZonedDateTime hoursBegin,
ZonedDateTime hoursEnd)
The constructor for
WorkingHours using AbstractDutyHours(ZonedDateTime, ZonedDateTime) . |
Modifier and Type | Method and Description |
---|---|
boolean |
addConnectionHook(ReducedNodeEdgeConnectorItem item) |
void |
addConstraint(IMultiWorkingHoursLevelConstraint constraint) |
void |
addConstraint(IWorkingHoursLevelConstraint constraint)
Adds a
Constraint to the WorkingHours so only Resources with that
specific Qualification will be able to serve the Nodes to which those WorkingHours are applied. |
void |
addNodeColorCapacity(NodeColorCapacityItem item)
Adds a certain
INodeColor to the Resource . |
void |
addQualification(IQualification qualification)
Adds a
IQualification to the IWorkingHours , which means that by adding a IConstraint to the INode , they are limited to which Nodes they can give
service. |
IWorkingHours |
copy()
Returns a copy of
WorkingHours(this.getBegin(), this.getEnd(), this.getZoneId()) and
invokes takeOverProperties(com.dna.jopt.member.unit.hours.IWorkingHours, com.dna.jopt.member.unit.hours.IWorkingHours) to also copy the properties. |
Optional<NodeColorCapacityItem> |
getColorCapacityItemByColorCode(int colorCode)
Gets the
NodeColorCapacityItem which limit the amount of Color coded Nodes a Resource can give service to. |
Optional<ReducedNodeEdgeConnectorItem> |
getConnectionHook(String toId) |
Optional<Map<String,ReducedNodeEdgeConnectorItem>> |
getConnectionHooks() |
List<IWorkingHoursLevelConstraint> |
getConstraints()
Gets the
Constraints set on the IResource . |
IDutyHours.DutyHoursFlavour |
getFlavour()
Gets the
IDutyHours.DutyHoursFlavour.WOH_FLAVOUR , the default value is enum constant
ordinal: 0 . |
boolean |
getIsAvailableForStay()
Gets if the
Resource is allowed to do an overnight stay . |
Optional<Long> |
getLocalFlexTimeMillis()
Gets the
localFlexTime in milliseconds. |
Optional<Long> |
getLocalMaxFreePostWorkDrivingTerminationTimeMillis()
Gets the
freePostWorkDrivingTerminationTime in milliseconds. |
Optional<Long> |
getLocalMaxPillarAfterHoursTime()
Gets the
localMaxPillarAfterHoursTime of IPillarNode in milliseconds. |
Optional<Long> |
getLocalMaxRouteStartReductionTimeMillis()
Gets the
localMaxRouteStartReductionTime in milliseconds. |
Optional<Long> |
getLocalMaxRouteStartReductionTimeMillisPillar()
Gets the
localMaxRouteStartReductionTime for IPillarNode in milliseconds. |
Optional<Duration> |
getLocalStayOutCycle()
Gets the
Duration of the potential local stayout cycle . |
Optional<LocalDate> |
getLocalStayOutCycleStart()
Gets the start of the local
stayout cycle . |
double |
getMaxDistanceKm()
Gets the
maxDistance , which is the maximal distance in km a Resource is allowed to travel without a IViolation
per day. |
double |
getMaxHours()
Gets maximum number of hours a
Resource is allowed to work per day in hours . |
List<IMultiWorkingHoursLevelConstraint> |
getMultiConstraints() |
Map<Integer,NodeColorCapacityItem> |
getNodeColorCapacityMap()
Gets the a
Map of the NodeColorCapacity . |
Set<Integer> |
getPresentColorCodes()
Gets the
INodeColor that are in use. |
Map<Class<? extends IQualification>,IQualification> |
getQualifications()
Gets the
IQualification of the IWorkingHours . |
Optional<IResourceDepot> |
getResourceDepot() |
Optional<Long> |
getRouteStartShiftMillisHook() |
boolean |
hasHook() |
boolean |
isClosedRoute()
Checks if the route is closed or not, the default value is
false . |
Optional<Boolean> |
isLocalOnlyApplyFreePostWorkDrivingOnOvertime() |
Optional<Boolean> |
isLocalReductionTimeIncludedInWorkingTime()
Checks whether the
localMaxRouteStartReductionTime is included in the WorkingHours . |
Optional<Boolean> |
isLocalReductionTimeOnlyUsedForDriving()
Checks whether the potentially set
localMaxRouteStartReductionTime can only be used for
driving, not for working. |
Optional<Boolean> |
isLocalReductionTimeOnlyUsedForDrivingPillar()
Checks whether the potentially set
localMaxRouteStartReductionTime for IPillarNode can only be used for driving, not for working. |
boolean |
isNodeColorCodingInUse()
Checks if any
INodeColor has been set through the use of
a NodeColorCapacityItem . |
boolean |
setConnectionHooks(Map<String,ReducedNodeEdgeConnectorItem> map) |
void |
setIsAvailableForStay(boolean isAvailableForStay)
Sets if the
Resource is allowed for an overnight stay instead of returning to
the starting location. |
void |
setIsClosedRoute(boolean isClosedRoute)
Sets the
Route to a closed Route . |
boolean |
setLocalFlexTime(Duration idleTimeReductionTime)
Sets the amount of time a
Resource can be expected to start working later and stay
longer at work if needed. |
boolean |
setLocalMaxFreePostWorkDrivingTerminationTime(Duration postTimeReductionTime)
Sets the amount of time the
Resource 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 after
WorkingHours within which a IPillarNode can be set. |
boolean |
setLocalMaxRouteStartReductionTime(Duration maxRouteStartReductionTime,
boolean isOnlyUsedForDriving)
Sets the maximum time which the
Resource can be expected to drive to the first Node in its private time. |
boolean |
setLocalMaxRouteStartReductionTimePillar(Duration maxRouteStartReductionTime,
boolean isOnlyUsedForDriving)
Sets the
localMaxRouteStartReductionTime for IPillarNode . |
void |
setLocalReductionTimeIsIncludedInWorkingTime(boolean isIncludedInTotalWorkingTime)
Sets whether the
localMaxRouteStartReductionTime is included in the WorkingHours . |
void |
setLocalStayOutCycleDefinition(Duration cycle,
LocalDate cycleStart)
Sets the
Duration of the cycle within which the maximum number of overnight
stays are allowed and within which the minimum recovery time (WorkingHours
without overnight stays ) has to be observed. |
void |
setMaxDistance(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance)
Sets the maximal distance that a
Resource is allowed to travel per day, cannot be null. |
void |
setMaxHours(Duration maxWorkingTime)
Deprecated.
|
void |
setMaxWorkingTime(Duration maxWorkingTime)
Sets the maximum number of hours a
Resource 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) |
compareTo, getTimeWindow, isPrefferedHour, setIsPrefferedHour, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getTimeWindow, isPrefferedHour, setIsPrefferedHour
compareTo
public WorkingHours(ZonedDateTime hoursBegin, ZonedDateTime hoursEnd)
WorkingHours
using AbstractDutyHours(ZonedDateTime, ZonedDateTime)
.
The WorkingHours
define in which timeframe a IResource
is able to
service INode
. Internally the time eventually is handled as seconds since the epoch
1970-01-01T00:00:00Z. The time zone
is derived from the ZonedDateTime
. 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)));
hoursBegin
- the zonedDateTime when the resource is allowed to begin workhoursEnd
- the zonedDateTime when the resource is supposed to stop workingpublic WorkingHours(ZonedDateTime hoursBegin, Duration maxTime)
public WorkingHours(TimeWindow window)
public WorkingHours(Instant hoursBegin, Instant hoursEnd, ZoneId zoneId)
WorkingHours
using Instants
. The WorkingHours
define
in which timeframe a CapacityResource
is able to
service INode
.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 timespublic WorkingHours(long hoursBeginMillis, long hoursEndMillis, ZoneId zoneId)
WorkingHours
using milliseconds since 01.01.1970. The WorkingHours
define in which timeframe a CapacityResource
is able to service INode
.
Using WorkingHours(ZonedDateTime, ZonedDateTime)
is preferred.
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 timespublic WorkingHours(Instant hoursBegin, Instant hoursEnd, ZoneId zoneId, Optional<Duration> maxWorkingTime, Optional<javax.measure.Quantity<javax.measure.quantity.Length>> maxDistance)
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@Deprecated public WorkingHours(GregorianCalendar hoursBegin, GregorianCalendar hoursEnd)
WorkingHours(ZonedDateTime, ZonedDateTime)
insteadhoursBegin
- the gregorianCalendar when the resource is allowed to begin
workhoursEnd
- the gregorianCalendar when the resource is supposed to stop
working@Deprecated public WorkingHours(LocalDateTime hoursBegin, LocalDateTime hoursEnd)
WorkingHours(ZonedDateTime, ZonedDateTime)
insteadhoursBegin
- the localDateTime when the resource is allowed to begin workhoursEnd
- the localDateTime when the resource is supposed to stop working@Deprecated public WorkingHours(Instant hoursBegin, Instant hoursEnd)
WorkingHours(ZonedDateTime, ZonedDateTime)
insteadhoursBegin
- the instant when the resource is allowed to begin workhoursEnd
- the instant when the resource is supposed to stop working@Deprecated public WorkingHours(com.google.common.collect.Range<Instant> interval)
WorkingHours(ZonedDateTime, ZonedDateTime)
insteadinterval
- the range instant when the resource is supposed to start and stop working@Deprecated public WorkingHours(long hoursBeginMillis, long hoursEndMillis)
WorkingHours(ZonedDateTime, ZonedDateTime)
insteadhoursBeginMillis
- 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@Deprecated public WorkingHours(Instant hoursBegin, Instant hoursEnd, Duration maxWorkingTime, javax.measure.Quantity<javax.measure.quantity.Length> maxDistance)
WorkingHours(ZonedDateTime, ZonedDateTime)
instead. ThehoursBegin
- 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@Deprecated public WorkingHours(Instant hoursBegin, Instant hoursEnd, Optional<Duration> maxWorkingTime, Optional<javax.measure.Quantity<javax.measure.quantity.Length>> maxDistance)
WorkingHours(ZonedDateTime, ZonedDateTime)
instead. ThehoursBegin
- 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@Deprecated public WorkingHours(com.google.common.collect.Range<Instant> interval, Duration maxWorkingTime, javax.measure.Quantity<javax.measure.quantity.Length> maxDistance)
WorkingHours(ZonedDateTime, ZonedDateTime)
instead. Theinterval
- 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 daypublic IWorkingHours copy()
IWorkingHours
WorkingHours(this.getBegin(), this.getEnd(), this.getZoneId())
and
invokes takeOverProperties(com.dna.jopt.member.unit.hours.IWorkingHours, com.dna.jopt.member.unit.hours.IWorkingHours)
to also copy the properties.copy
in interface IDutyHours
copy
in interface IWorkingHours
public static IWorkingHours takeOverProperties(IWorkingHours src, IWorkingHours target)
public static IWorkingHours takeOverProperties(IWorkingHours src, IWorkingHours target, boolean doStartUpdate)
public void setIsAvailableForStay(boolean isAvailableForStay)
IWorkingHours
Resource
is allowed for an overnight stay
instead of returning to
the starting location. The Node
also needs INode.setIsStayNode(boolean)
set to true
so this
function can be used.setIsAvailableForStay
in interface IWorkingHours
isAvailableForStay
- boolean, the default value is true
.public boolean getIsAvailableForStay()
IWorkingHours
Resource
is allowed to do an overnight stay
. The Node
also
needs INode.setIsStayNode(boolean)
set to true
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 (no overnight stays
on Fridays.
getIsAvailableForStay
in interface IWorkingHours
true
.public IDutyHours.DutyHoursFlavour getFlavour()
IDutyHours
IDutyHours.DutyHoursFlavour.WOH_FLAVOUR
, the default value is enum constant
ordinal: 0
.getFlavour
in interface IDutyHours
public void setMaxWorkingTime(Duration maxWorkingTime)
IWorkingHours
Resource
is allowed to work per day.setMaxWorkingTime
in interface IWorkingHours
maxWorkingTime
- the maximal working time@Deprecated public void setMaxHours(Duration maxWorkingTime)
IWorkingHours
Sets the maxHours
a Resource
is allowed to work per day.
setMaxHours
in interface IWorkingHours
maxWorkingTime
- the double to be set for maxHours
public double getMaxHours()
IWorkingHours
Resource
is allowed to work per day in hours
. By
default it is not usable and the value is -1.getMaxHours
in interface IWorkingHours
maxHours
.public void setMaxDistance(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance)
IWorkingHours
Resource
is allowed to travel per day, cannot be null.setMaxDistance
in interface IWorkingHours
maxDistance
- the quantity, will be casted
to kilometrepublic double getMaxDistanceKm()
IWorkingHours
maxDistance
, which is the maximal distance in km a Resource
is allowed to travel without a IViolation
per day.getMaxDistanceKm
in interface IWorkingHours
maxDistance
in km. By default it is not usable and the value is -1.public void setIsClosedRoute(boolean isClosedRoute)
IWorkingHours
Route
to a closed Route
. A closed Route
is a Route
where the Resource
is going to its home afterwards. An open Route
is a Route
where the Resource
is simply staying at the last Node
if OverNightStay
also has been activated or where the Resource
has to travel home outside
of the WorkingHours
. The default value is true.setIsClosedRoute
in interface IWorkingHours
isClosedRoute
- the boolean if the Route is a closed RouteIBasicResource.hasAlternateDestination()
public boolean isClosedRoute()
IWorkingHours
false
. A closed
Route
is a Route
where the Resource
is going to its home afterwards. An open Route
is a Route
where the Resource
is simply staying at the last Node
if OverNightStay
also has been activated or where the Resource
has to
travel home outside of the WorkingHours
. The default value is true.isClosedRoute
in interface IWorkingHours
isClosedRoute
IBasicResource.hasAlternateDestination()
public void setLocalStayOutCycleDefinition(Duration cycle, LocalDate cycleStart)
IWorkingHours
Duration
of the cycle within which the maximum number of overnight
stays
are allowed and within which the minimum recovery time
(WorkingHours
without overnight stays
) has to be observed. The recovery time
is set in IResource.setStayOutCycleDefinition(Duration, LocalDate)
.
Without setting the cycle the maximal number of overnight stays
will not be
refreshed and count for the full duration of the WorkingHours
. The cycle can be applied
to the local Resource
which means it will stay the same for this Resource
throughout the Optimization
. If like here set locally
it is only valid for this
WorkingHours
and the cycle can change depending on the dates or time in the week. It
can for example be set that no overnight stays
are allowed on Fridays.
setLocalStayOutCycleDefinition
in interface IWorkingHours
cycle
- duration of the cyclecycleStart
- the localDate of the cycle startpublic Optional<Duration> getLocalStayOutCycle()
IWorkingHours
Duration
of the potential local stayout cycle
.
For more information please see IWorkingHours.setLocalStayOutCycleDefinition(Duration,
LocalDate)
.
getLocalStayOutCycle
in interface IWorkingHours
public Optional<LocalDate> getLocalStayOutCycleStart()
IWorkingHours
stayout cycle
.
For more information please see IWorkingHours.setLocalStayOutCycleDefinition(Duration,
LocalDate)
.
getLocalStayOutCycleStart
in interface IWorkingHours
public void setLocalReductionTimeIsIncludedInWorkingTime(boolean isIncludedInTotalWorkingTime)
IWorkingHours
localMaxRouteStartReductionTime
is included in the WorkingHours
. The default value is false
. If false
and IWorkingHours.setLocalMaxRouteStartReductionTime(Duration, boolean)
is set to true
the driving time
to the first Node
has to be done in the Resources
private time
For more information please see IWorkingHours.setLocalMaxRouteStartReductionTime(Duration,
boolean)
.
setLocalReductionTimeIsIncludedInWorkingTime
in interface IWorkingHours
isIncludedInTotalWorkingTime
- the boolean whether reduction time is included in the
WorkingHourspublic boolean setLocalMaxRouteStartReductionTime(Duration maxRouteStartReductionTime, boolean isOnlyUsedForDriving)
IWorkingHours
Resource
can be expected to drive to the first Node
in its private time.
If the OpeningHours
of a Node
and the WorkingHours
of a Resource
start at 8 the driving time is an hour and the Resource
's localMaxRouteStartReductionTime
is 30 Minutes the Resource
will start driving towards
the Node
at 7.30 (outside of its WorkingHours
) and arrive there at 8.30.
The Boolean
defines whether the localMaxRouteStartReductionTime
can only be
used for driving or not and is usually set to true
. The Resource
can not work
in the localMaxRouteStartReductionTime
in that case.
If like here set locally
the localMaxRouteStartReductionTime
is only valid
for these specific WorkingHours
.
setLocalMaxRouteStartReductionTime
in interface IWorkingHours
maxRouteStartReductionTime
- the duration of the maxRouteStartReductionTimeisOnlyUsedForDriving
- the boolean whether the time can only be used for drivingpublic boolean setLocalMaxRouteStartReductionTimePillar(Duration maxRouteStartReductionTime, boolean isOnlyUsedForDriving)
IWorkingHours
localMaxRouteStartReductionTime
for IPillarNode
. Overwrites the set localMaxRouteStartReductionTime
and sets the new value for Pillars
. If no localMaxRouteStartReductionTime
has been set, sets the new value for Pillars
only.
For more information please see IWorkingHours.setLocalMaxRouteStartReductionTime(Duration,
boolean)
.
setLocalMaxRouteStartReductionTimePillar
in interface IWorkingHours
maxRouteStartReductionTime
- the duration of the localMaxStartReductionTimePillarisOnlyUsedForDriving
- the boolean whether it is only used for drivingpublic Optional<Boolean> isLocalReductionTimeOnlyUsedForDriving()
IWorkingHours
localMaxRouteStartReductionTime
can only be used for
driving, not for working. Per default this is set to true
.
For more information please see IWorkingHours.setLocalMaxRouteStartReductionTime(Duration,
boolean)
isLocalReductionTimeOnlyUsedForDriving
in interface IWorkingHours
localMaxRouteStartReductionTime
has been setpublic Optional<Boolean> isLocalReductionTimeOnlyUsedForDrivingPillar()
IWorkingHours
localMaxRouteStartReductionTime
for IPillarNode
can only be used for driving, not for working. Per
default this is set to true
.
For more information please see IWorkingHours.setLocalMaxRouteStartReductionTime(Duration,
boolean)
and IWorkingHours.setLocalMaxRouteStartReductionTimePillar(Duration, boolean)
.
isLocalReductionTimeOnlyUsedForDrivingPillar
in interface IWorkingHours
localMaxRouteStartReductionTime
has been setpublic Optional<Boolean> isLocalReductionTimeIncludedInWorkingTime()
IWorkingHours
localMaxRouteStartReductionTime
is included in the WorkingHours
. The default value is false
. If false
and IWorkingHours.setLocalMaxRouteStartReductionTime(Duration, boolean)
is set to true
the driving time
to the first Node
has to be done in the Resources
private time
For more information please see IWorkingHours.setLocalMaxRouteStartReductionTime(Duration,
boolean)
.
isLocalReductionTimeIncludedInWorkingTime
in interface IWorkingHours
localMaxRouteStartReductionTime
has been
setpublic Optional<Long> getLocalMaxRouteStartReductionTimeMillis()
IWorkingHours
localMaxRouteStartReductionTime
in milliseconds.
For more information please see IWorkingHours.setLocalMaxRouteStartReductionTime(Duration,
boolean)
.
getLocalMaxRouteStartReductionTimeMillis
in interface IWorkingHours
localMaxRouteStartReductionTime
has been
setpublic Optional<Long> getLocalMaxRouteStartReductionTimeMillisPillar()
IWorkingHours
localMaxRouteStartReductionTime
for IPillarNode
in milliseconds.
For more information please see IWorkingHours.setLocalMaxRouteStartReductionTimePillar(Duration,
boolean)
and IWorkingHours.setLocalMaxRouteStartReductionTime(Duration, boolean)
.
getLocalMaxRouteStartReductionTimeMillisPillar
in interface IWorkingHours
localMaxRouteStartReductionTime
has been
setpublic boolean setLocalFlexTime(Duration idleTimeReductionTime)
IWorkingHours
Resource
can be expected to start working later and stay
longer at work if needed.
If the first Node
is at 11, the Resources WorkingHours
started at 8 and the
localFlexTime
is set to 3 hours, the Resource
starts working at 11 and has to
stay 3 hours longer at work than usual. If the localFlexTime
in the above example is
set to 2 hours, the Resource
will be idle from 10-11 but it is considered working time.
setLocalFlexTime
in interface IWorkingHours
idleTimeReductionTime
- the duration of the idle time reduction timepublic Optional<Long> getLocalFlexTimeMillis()
IWorkingHours
localFlexTime
in milliseconds.
For more information please see IWorkingHours.setLocalFlexTime(Duration)
.
getLocalFlexTimeMillis
in interface IWorkingHours
localFlexTime
has been setpublic boolean setStartTimeHook(Duration routeStartTimeHookDuration)
setStartTimeHook
in interface IWorkingHours
public Optional<Long> getRouteStartShiftMillisHook()
getRouteStartShiftMillisHook
in interface IWorkingHours
public boolean addConnectionHook(ReducedNodeEdgeConnectorItem item)
addConnectionHook
in interface IWorkingHours
public boolean setConnectionHooks(Map<String,ReducedNodeEdgeConnectorItem> map)
setConnectionHooks
in interface IWorkingHours
public Optional<ReducedNodeEdgeConnectorItem> getConnectionHook(String toId)
getConnectionHook
in interface IWorkingHours
public Optional<Map<String,ReducedNodeEdgeConnectorItem>> getConnectionHooks()
getConnectionHooks
in interface IWorkingHours
public boolean hasHook()
hasHook
in interface IWorkingHours
public boolean setLocalMaxFreePostWorkDrivingTerminationTime(Duration postTimeReductionTime)
IWorkingHours
Resource
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 the freePostWorkDrivingTerminationTime
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 different WorkingHours
. If the time should be
valid for all the WorkingHours
of a Resource
please use IResource.setMaxFreePostWorkDrivingTerminationTime(Duration)
.
setLocalMaxFreePostWorkDrivingTerminationTime
in interface IWorkingHours
postTimeReductionTime
- the duration free time that needs to be used to drive
homepublic boolean setLocalMaxFreePostWorkDrivingTerminationTime(Duration postTimeReductionTime, boolean onlyApplyOnOvertime)
IWorkingHours
setLocalMaxFreePostWorkDrivingTerminationTime
in interface IWorkingHours
postTimeReductionTime
- the post time reduction timeonlyApplyOnOvertime
- the only apply on overtimepublic Optional<Long> getLocalMaxFreePostWorkDrivingTerminationTimeMillis()
IWorkingHours
freePostWorkDrivingTerminationTime
in milliseconds.
For more information please see IWorkingHours.setLocalMaxFreePostWorkDrivingTerminationTime(Duration)
.
getLocalMaxFreePostWorkDrivingTerminationTimeMillis
in interface IWorkingHours
freePostWorkDrivingTerminationTime
has
been setpublic Optional<Boolean> isLocalOnlyApplyFreePostWorkDrivingOnOvertime()
isLocalOnlyApplyFreePostWorkDrivingOnOvertime
in interface IWorkingHours
public boolean setLocalMaxPillarAfterHoursTime(Duration maxPillarEndOverTime)
IWorkingHours
WorkingHours
within which a IPillarNode
can be set. The Resources
have to visit this
Pillar
even tough it is outside of WorkingHours
.
This method in only valid for a specific set of WorkingHours
. If you want to set the
same time for all the WorkingHours
of a Pillar
please use IResource.setMaxPillarAfterHoursTime(Duration)
setLocalMaxPillarAfterHoursTime
in interface IWorkingHours
maxPillarEndOverTime
- the duration after WorkingHours within which a Pillar still has to
be given servicepublic Optional<Long> getLocalMaxPillarAfterHoursTime()
IWorkingHours
localMaxPillarAfterHoursTime
of IPillarNode
in milliseconds.
For more information please see IWorkingHours.setLocalMaxPillarAfterHoursTime(Duration)
.
getLocalMaxPillarAfterHoursTime
in interface IWorkingHours
public void addConstraint(IWorkingHoursLevelConstraint constraint)
IWorkingHours
Constraint
to the WorkingHours
so only Resources
with that
specific Qualification
will be able to serve the Nodes
to which those WorkingHours
are applied.
For examples see UKPostCodeQualification
and
UKPostCodeConstraint
addConstraint
in interface IWorkingHours
constraint
- the iWorkingHoursLevelConstraint to add to the workingHourspublic void addConstraint(IMultiWorkingHoursLevelConstraint constraint)
addConstraint
in interface IWorkingHours
public List<IWorkingHoursLevelConstraint> getConstraints()
IWorkingHours
Constraints
set on the IResource
.
The Resource
can only work on Nodes
within within the range of its Constraint
.
An example of its implementation is UKPostCodeConstraint
.
getConstraints
in interface IWorkingHours
public List<IMultiWorkingHoursLevelConstraint> getMultiConstraints()
getMultiConstraints
in interface IWorkingHours
public boolean isNodeColorCodingInUse()
IWorkingHours
INodeColor
has been set through the use of
a NodeColorCapacityItem
.isNodeColorCodingInUse
in interface IWorkingHours
public void addNodeColorCapacity(NodeColorCapacityItem item)
IWorkingHours
INodeColor
to the Resource
. This
way can be made sure that Nodes
with a certain Color
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));
}
addNodeColorCapacity
in interface IWorkingHours
item
- the nodeColorCapacityItemNodeColorCapacityItem
public Map<Integer,NodeColorCapacityItem> getNodeColorCapacityMap()
IWorkingHours
Map
of the NodeColorCapacity
. For more information please see INodeColor
and NodeColorCapacityItem
.getNodeColorCapacityMap
in interface IWorkingHours
public Set<Integer> getPresentColorCodes()
IWorkingHours
INodeColor
that are in use.getPresentColorCodes
in interface IWorkingHours
NodeColorCapacityItem
public Optional<NodeColorCapacityItem> getColorCapacityItemByColorCode(int colorCode)
IWorkingHours
NodeColorCapacityItem
which limit the amount of Color
coded Nodes
a Resource
can give service to. This way can be made sure that Nodes
with a certain Color
are not overrepresented and can be used for white space
generation.getColorCapacityItemByColorCode
in interface IWorkingHours
colorCode
- the int code of the colorINodeColor
public void addQualification(IQualification qualification)
IWorkingHours
IQualification
to the IWorkingHours
, which means that by adding a IConstraint
to the INode
, they are limited to which Nodes
they can give
service.addQualification
in interface IWorkingHours
qualification
- the IQualification that is to be addedpublic Map<Class<? extends IQualification>,IQualification> getQualifications()
IWorkingHours
IQualification
of the IWorkingHours
.getQualifications
in interface IWorkingHours
IWorkingHours.addQualification(IQualification)
public void setResourceDepot(IResourceDepot depot)
setResourceDepot
in interface IWorkingHours
public Optional<IResourceDepot> getResourceDepot()
getResourceDepot
in interface IWorkingHours
Copyright © 2017–2023 DNA Evolutions GmbH. All rights reserved.