public class CapacityResource extends AbstractBasicCapacityResource implements IResource
IResource
is the unit in the Optimization
that is visiting the INode
and doing the work.
A CapacityResource
has a home location, indicated by the latitude
and longitude
from which it starts ond to which it usually returns after the end of a route
.
In the constructor a maximum time
and distance
has to be specified within which
the CapacityResource
should end the route
. The IWorkingHours
specify on
which dates and at which time of the day the CapacityResource
should work. If the CapacityResource
is scheduled to work outside of these parameters IViolation
are adding more internal cost to that route.
IOptimizationElement.OptimizationElementFlavour
dutyHours
Constructor and Description |
---|
CapacityResource()
Load *
|
CapacityResource(String resourceId,
double latitude,
double longitude,
double maxHours,
double maxDistance,
List<IDutyHours> workingHours)
Deprecated.
please use
CapacityResource(String, double, double, Duration, Quantity,
List) with updated parameters. |
CapacityResource(String resourceId,
double latitude,
double longitude,
double maxHours,
double maxDistance,
WorkingHours[] workingHours)
Deprecated.
please use
CapacityResource(String, double, double, Duration, Quantity,
List) with updated parameters. |
CapacityResource(String resourceId,
double latitude,
double longitude,
Duration maxTime,
javax.measure.Quantity<javax.measure.quantity.Length> maxDistance,
List<IWorkingHours> workingHours)
The constructor for the
CapacityResource . |
CapacityResource(String resourceId,
com.dna.jopt.config.types.Position pos,
Duration maxTime,
javax.measure.Quantity<javax.measure.quantity.Length> maxDistance,
List<IWorkingHours> workingHours) |
Modifier and Type | Method and Description |
---|---|
void |
addCapacity(double capacity)
Deprecated.
|
void |
addConstraint(IResourceLevelConstraint constraint)
Adds an
IConstraint to the Resource so it
can only give service to the Nodes that have the appropriate IQualification . |
boolean |
equals(Object obj) |
double |
getAverageCO2EmissionFactor()
Gets the average CO2 emission factor.
|
double[] |
getCapacity()
Gets the capacity of goods a
Resource can carry. |
double[] |
getCapacityDegradationPerStop()
Gets the capacity degradation per stop.
|
double |
getConnectionTimeEfficiencyFactor()
Sets the
getConnectionTimeEfficiencyFactor() , the default value is
1.0 . |
List<IResourceLevelConstraint> |
getConstraints()
Gets the
IConstraint from the Resource that
it is limited to. |
double[] |
getInitialLoad()
Gets the amount of a good that is already being carried by the
Resource . |
Optional<javax.measure.Quantity<javax.measure.quantity.Length>> |
getMaxDrivingDistanceFirstNode()
Gets the maximal distance that the
Resource needs to drive to the first Node . |
Optional<javax.measure.Quantity<javax.measure.quantity.Length>> |
getMaxDrivingDistanceLastNode()
Gets the maximal distance that the
Resource needs to drive to the last Node . |
Optional<Duration> |
getMaxDrivingTimeFirstNode()
Gets the maximal driving time that the
Resource is supposed to drive to the first
Node . |
Optional<Duration> |
getMaxDrivingTimeLastNode()
Gets the maximal driving time that the
Resource is supposed to drive to the last Node . |
Optional<Long> |
getMaxFreePostWorkDrivingTerminationTimeMillis()
Gets the amount of time in milliseconds that the
Resource can be expected to drive home
to its starting location in its free time. |
Optional<Long> |
getMaxPillarAfterHoursTime()
Gets the
maximal pillar after hours time in milliseconds. |
Optional<Long> |
getMaxRouteStartReductionTimeMillis()
Gets the maximum time which the
Resource can be expected to drive to the first Node in its private time. |
Optional<Long> |
getMaxRouteStartReductionTimeMillisPillar()
Gets the
route start reduction time for IPillarNode in milliseconds. |
int |
getMaxStaysOutInRow()
Gets maximum number of
overnight stays the Resource can do in a row. |
int |
getMaxTotalStaysOut()
Gets the
Resources maximum number of overnight stays , the default value is -1. |
double[] |
getMinimalDegratedCapacity()
Gets the minimal degrated capacity.
|
int |
getMinRecoverHours()
Gets the number of defined working hours (often days) between two
overnight stays . |
double |
getOverallVisitDurationEfficiencyFactor()
Gets the overall visit duration efficiency factor.
|
Optional<IResourceDepot> |
getResourceDepot()
Gets the resource depot.
|
Optional<Duration> |
getStayOutCycle()
Gets the
stay out cycle within which the maximum number of overnight stays are
allowed and within which the the minimum recovery time (days without overnight
stays ) has to be observed. |
Optional<LocalDate> |
getStayOutCycleStart()
Gets the starting day of the
stay out cycle within which the maximum number of overnight stays are allowed and within which the the minimum recovery time (days
without overnight stays ) has to be observed. |
double |
getStayOutPolicyMinDistance()
Gets the distance threshold to be able to use an
overnight stay in meter. |
double |
getStayOutPolicyMinTime()
Gets the return time threshold that needs to be surpassed to be able to use an
overnight
stay in seconds. |
javax.measure.Quantity<javax.measure.quantity.Length> |
getStayOutPolicyReturnDistance()
Gets the distance threshold that needs to be surpassed in order to be able to use an
overnight stay as Quantity Length . |
Duration |
getStayOutPolicyReturnTime()
Gets the time threshold that needs to be surpassed in order to be able to use an
overnight stay as Duration . |
int |
hashCode() |
Optional<Boolean> |
isOnlyApplyFreePostWorkDrivingOnOvertime() |
Optional<Boolean> |
isReductionTimeIncludedInWorkingTime()
Checks whether the
route start reduction time is included in the WorkingHours . |
Optional<Boolean> |
isReductionTimeOnlyUsedForDriving()
Checks whether the potentially set
route start reduction time can only be used for
driving, not for working. |
Optional<Boolean> |
isReductionTimeOnlyUsedForDrivingPillar()
Checks if a
route start reduction time for IPillarNode has been set. |
boolean |
isStayOutPolicyReturnDistanceActive()
Checks whether the
Resource needs to be further away from its starting location
than the set threshold to be able to use an overnight stay . |
boolean |
isStayOutPolicyReturnTimeActive()
Checks whether the
Resource needs to take longer to return to her starting
location than the set threshold to be able to use an overnight stay . |
void |
setAverageCO2EmissionFactor(double emissionFactor)
Sets the average CO2 emission-factor.
|
void |
setCapacity(double[] capacity)
Sets the amount a
Resource can carry of a specific good. |
void |
setCapacity(double[] capacity,
double[] minDegratedCapacity,
double[] capacityDegPerStop)
Sets the capacity.
|
void |
setCapacityDegradationPerStop(double[] capacityDegPerStop)
Sets the capacity degradation per stop.
|
void |
setConnectionTimeEfficiencyFactor(double connectionTimeEfficiencyFactor)
Sets connectionTimeEfficiencyFactor, the default value is
1.0 . |
void |
setInitialLoad(double[] initialLoad)
Sets the the amount of a good that is already being carried by the
Resource . |
void |
setMaxDrivingDistanceFirstNode(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance)
Sets the maximal distance that the
Resource needs to drive to the first Node . |
void |
setMaxDrivingDistanceLastNode(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance)
Sets the maximal distance that the
Resource needs to drive to the last Node . |
void |
setMaxDrivingTimeFirstNode(Duration maxTime)
Sets the maximal driving time that the
Resource is supposed to drive to the first
Node . |
void |
setMaxDrivingTimeLastNode(Duration maxTime)
Sets the maximal driving time that the
Resource is supposed to drive to the last Node . |
boolean |
setMaxFlexPreWorkingHoursDrvingTime(Duration preWorkTime)
Deprecated.
|
void |
setMaxFreePostWorkDrivingTerminationTime(Duration nonPenalizedDrivingHomeOnOwnTimeDuration)
Sets the amount of time that the
Resource can be expected to drive home to its starting
location in its free time. |
void |
setMaxFreePostWorkDrivingTerminationTime(Duration postTimeReductionTime,
boolean onlyApplyOnOvertime)
Sets the local max free post work driving termination time.
|
boolean |
setMaxPillarAfterHoursTime(Duration maxPillarEndOverTime)
Sets the amount of time after
WorkingHours within which a IPillarNode can be set. |
boolean |
setMaxRouteStartReductionTime(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 |
setMaxRouteStartReductionTimePillar(Duration maxRouteStartReductionTime,
boolean isOnlyUsedForDriving)
Sets the
route start reduction time for IPillarNode . |
void |
setMinimalDegratedCapacity(double[] minDegratedCapacity)
Sets the minimal degrated capacity.
|
boolean |
setOverallVisitDurationEfficiencyFactor(double factor)
Sets the overall visit duration efficiency factor.
|
void |
setReductionTimeIsIncludedInWorkingTime(boolean isIncludedInTotalWorkingTime)
Sets whether the
route start reduction time is included in the WorkingHours . |
void |
setResourceDepot(IResourceDepot depot)
Sets the resource depot.
|
void |
setStayOutCycleDefinition(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 |
setStayOutPolicy(double minDistanceMeter,
double minTimeSeconds)
Deprecated.
|
void |
setStayOutPolicy(javax.measure.Quantity<javax.measure.quantity.Length> minDistanceForStayOut,
Duration minTimeForStayOut)
Sets the minimal distance and time the
Resource needs to be away from its starting
location to be able to a overnight stay . |
void |
setStayOutPolicyActive(boolean stayOutPolicyActive)
Deprecated.
|
void |
setStayOutPolicyReturnDistance(javax.measure.Quantity<javax.measure.quantity.Length> minDistanceForStayOut)
Sets the minimal distance a
Resource needs to be away from his starting
location in order to be able to use an overnight stay . |
void |
setStayOutPolicyReturnDistanceActive(boolean stayOutPolicyReturnDistanceActive)
Sets whether the
Resource needs to be further away from its starting location
than the set threshold to be able to use an overnight stay . |
void |
setStayOutPolicyReturnTime(Duration minTimeForStayOut)
Sets the minimal time a
Resource would need to return to her starting location
to be able to use an overnight stay . |
void |
setStayOutPolicyReturnTimeActive(boolean stayOutPolicyReturnTimeActive)
Sets whether the
Resource needs to take longer to return to her starting
location than the set threshold to be able to use an overnight stay . |
void |
setStaysOut(int totalStaysOut,
int staysOutInRow,
int minRecoverHours)
Sets the
total stays , the stays in a row and the minimum recovery time
of a stay out cycle . |
addQualification, compareTo, copyWithNewId, getAcceptableOverdistanceMeter, getAcceptableOvertimeSeconds, getAverageSpeed, getAvgSpeed, getDestinationDistMatrixId, getDestinationLatitude, getDestinationLongitude, getDestinationPosition, getFixCost, getFlavour, getFlexTimeMillis, getMaxDistance, getMaxHours, getMaxWorkingDistance, getMaxWorkingTime, getPerHourCost, getPerKilometerCost, getQualifications, getResourceId, getSkillEfficiencyFactor, getStrictOverdistanceLimitMeter, getStrictOvertimeLimitSeconds, hasAlternateDestination, hasRealGeoLocation, isEmptyAtEndOfRoute, resetAcceptableOvertime, setAcceptableOverdistance, setAcceptableOvertime, setAcceptableOvertimeSeconds, setAlternateDestination, setAvgSpeed, setAvgSpeed, setCost, setDestinationDistMatrixId, setDestinationLatitude, setDestinationLongitude, setDestinationPosition, setFixCost, setFlexTime, setMaxDistance, setMaxHours, setMaxWorkingDistance, setMaxWorkingTime, setPerHourCost, setPerKilometerCost, setResourceId, setSkillEfficiencyFactor, setStrictOverdistanceLimit, setStrictOvertimeLimit, setWorkingHours, toString
forceSetId, getConstraintAliasId, getDistMatrixId, getDutyHours, getExtraInfo, getId, getLatitude, getLocationId, getLongitude, getNodeConnection, getNodeConnectionKeySet, getNodeConnections, getPosition, getPreferredHoursInteractionController, putNodeConnection, putNodeConnectionFromElement, removeNodeConnection, setConstraintAliasId, setDistMatrixId, setDutyHours, setExtraInfo, setId, setLatitude, setLocationId, setLongitude, setPosition
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addQualification, getAcceptableOverdistanceMeter, getAcceptableOvertimeSeconds, getAverageSpeed, getAvgSpeed, getDestinationDistMatrixId, getDestinationLatitude, getDestinationLongitude, getDestinationPosition, getFixCost, getFlexTimeMillis, getMaxDistance, getMaxHours, getMaxWorkingDistance, getMaxWorkingTime, getPerHourCost, getPerKilometerCost, getQualifications, getSkillEfficiencyFactor, getStrictOverdistanceLimitMeter, getStrictOvertimeLimitSeconds, hasAlternateDestination, isEmptyAtEndOfRoute, resetAcceptableOvertime, setAcceptableOverdistance, setAcceptableOvertime, setAcceptableOvertimeSeconds, setAlternateDestination, setAvgSpeed, setAvgSpeed, setCost, setDestinationLatitude, setDestinationLongitude, setDestinationPosition, setFixCost, setFlexTime, setMaxDistance, setMaxHours, setMaxWorkingDistance, setMaxWorkingTime, setPerHourCost, setPerKilometerCost, setSkillEfficiencyFactor, setStrictOverdistanceLimit, setStrictOvertimeLimit
forceSetId, getConstraintAliasId, getDistMatrixId, getDutyHours, getExtraInfo, getFlavour, getId, getLatitude, getLocationId, getLongitude, getNodeConnection, getNodeConnectionKeySet, getNodeConnections, getPosition, getPreferredHoursInteractionController, hasRealGeoLocation, putNodeConnection, putNodeConnectionFromElement, removeNodeConnection, setConstraintAliasId, setDistMatrixId, setDutyHours, setExtraInfo, setId, setLatitude, setLocationId, setLongitude, setPosition
compareTo
public CapacityResource()
public CapacityResource(String resourceId, double latitude, double longitude, Duration maxTime, javax.measure.Quantity<javax.measure.quantity.Length> maxDistance, List<IWorkingHours> workingHours)
CapacityResource
.
Implementation example:
Duration maxWorkingTime = Duration.ofHours(13);
Quantity<Length> maxDistanceKmW = Quantities.getQuantity(1200.0, KILO(METRE));
CapacityResource rep1 =
new CapacityResource(
"Jack", 50.775346, 6.083887, maxWorkingTime, maxDistanceKmW, workingHours);
rep1.setDestinationLatitude(51.45);
rep1.setDestinationLongitude(7.01667);
rep1.setAlternateDestination(true);
rep1.setCost(0, 1, 1);
// Adding a qualification to the resource:
IQualification typeQualification = new TypeQualification();
((TypeQualification) typeQualification).addType("plumbing");
rep1.addQualification(typeQualification);
this.addElement(rep1);
Attention: Make sure that each Resource has its own independent list of WorkingHours. Further,
make sure that each WorkingHour Object is also unique and is not shared in the List of another
resource.resourceId
- the string name of the resourcelatitude
- the double latitude of the resources home locationlongitude
- the double longitude of the resources home locationmaxTime
- the duration maximum time that could be used for workmaxDistance
- the length maximal distance the capacityResource is allowed to driveworkingHours
- the iWorkinghours within which the capacityResource operatespublic CapacityResource(String resourceId, com.dna.jopt.config.types.Position pos, Duration maxTime, javax.measure.Quantity<javax.measure.quantity.Length> maxDistance, List<IWorkingHours> workingHours)
@Deprecated public CapacityResource(String resourceId, double latitude, double longitude, double maxHours, double maxDistance, List<IDutyHours> workingHours)
CapacityResource(String, double, double, Duration, Quantity,
List)
with updated parameters.deprecated
constructor that should not be used anymore since it is using the
maximum working time as a double
whereas the new constructor uses a Duration
.
Likewise the double
maximal distance has been replaced by Quantity<length>
.
Attention: Make sure that each Resource has its own independent list of WorkingHours. Further, make sure that each WorkingHour Object is also unique and is not shared in the List of another resource.
resourceId
- resourceIdlatitude
- latitudelongitude
- longitudemaxHours
- maxHoursmaxDistance
- maxDistanceworkingHours
- workingHours@Deprecated public CapacityResource(String resourceId, double latitude, double longitude, double maxHours, double maxDistance, WorkingHours[] workingHours)
CapacityResource(String, double, double, Duration, Quantity,
List)
with updated parameters.resourceId
- the resource idlatitude
- the latitudelongitude
- the longitudemaxHours
- the max hoursmaxDistance
- the max distanceworkingHours
- the working hoursLEGACY CONSTRUCTOR
Instantiates a new capacity resource.
PLEASE DO NOT USE THIS CONSTRUCTOR ANYMORE! IT WILL BE REMOVED IN FUTURE VERSIONS
public int hashCode()
hashCode
in class AbstractBasicCapacityResource
public boolean equals(Object obj)
equals
in class AbstractBasicCapacityResource
public boolean setMaxPillarAfterHoursTime(Duration maxPillarEndOverTime)
IResource
WorkingHours
within which a IPillarNode
can be set. The Resources
have to visit this
Pillar
even tough it is outside of WorkingHours
.
This method sets the same time for all WorkingHours
. If you want to set the time for
a specific set of WorkingHours
please use IWorkingHours.setLocalMaxPillarAfterHoursTime(Duration)
.
setMaxPillarAfterHoursTime
in interface IResource
maxPillarEndOverTime
- the duration after WorkingHours within which a Pillar still has to
be given servicepublic Optional<Long> getMaxPillarAfterHoursTime()
IResource
maximal pillar after hours time
in milliseconds.
For more information please see IResource.setMaxPillarAfterHoursTime(Duration)
.
getMaxPillarAfterHoursTime
in interface IResource
public void setReductionTimeIsIncludedInWorkingTime(boolean isIncludedInTotalWorkingTime)
IResource
route start reduction time
is included in the WorkingHours
.
The default value is false
. If false
and IResource.setMaxRouteStartReductionTime(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 on route start reduction time
please see the link above.
setReductionTimeIsIncludedInWorkingTime
in interface IResource
isIncludedInTotalWorkingTime
- the boolean whether reduction time is included in the
WorkingHourspublic boolean setMaxRouteStartReductionTime(Duration maxRouteStartReductionTime, boolean isOnlyUsedForDriving)
IResource
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 route start
reduction time
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 route start reduction time
can only be used
for driving or not and is usually set to true
. The Resource
can not work in the
route start reduction time
in that case.
The route start reduction time
is valid for all WorkingHours
of a Resource
. If a route start reduction time
has to be valid for only one set of WorkingHours
please use the local method IWorkingHours.setLocalMaxRouteStartReductionTime(Duration,
boolean)
setMaxRouteStartReductionTime
in interface IResource
maxRouteStartReductionTime
- the duration time the resource has to drive to work on its
own timeisOnlyUsedForDriving
- if the route start reduction time can only be used for drivingpublic boolean setMaxRouteStartReductionTimePillar(Duration maxRouteStartReductionTime, boolean isOnlyUsedForDriving)
IResource
route start reduction time
for IPillarNode
. Overwrites the set route start reduction
time
that is valid for INodes
and sets the new value for Pillars
. If no route start reduction time
has been set, sets the new value for Pillars
only.
The Boolean
defines whether the route start reduction time
can only be used
for driving or not and is usually set to true
.
For more information please see IResource.setMaxRouteStartReductionTime(Duration, boolean)
.
setMaxRouteStartReductionTimePillar
in interface IResource
maxRouteStartReductionTime
- the duration time the resource has to drive to work on its
own timeisOnlyUsedForDriving
- if the route start reduction time can only be used for drivingpublic Optional<Boolean> isReductionTimeOnlyUsedForDriving()
IResource
route start reduction time
can only be used for
driving, not for working. Per default this is set to true
. In this case the route start reduction time
is valid for all WorkingHours
of that Resource
.
The route start reduction time
is valid for all WorkingHours
of a Resource
. For more information please see IResource.setMaxRouteStartReductionTime(Duration,
boolean)
. If a route start reduction time
has to be valid for only one set of WorkingHours
please use the local
method IWorkingHours.setLocalMaxRouteStartReductionTime(Duration,
boolean)
.
isReductionTimeOnlyUsedForDriving
in interface IResource
public Optional<Boolean> isReductionTimeIncludedInWorkingTime()
IResource
route start reduction time
is included in the WorkingHours
.
The default value is false
. If false
and IResource.setMaxRouteStartReductionTime(Duration, boolean)
is set to true
the driving time to
the first Node
has to be done in the Resources
private time.
The route start reduction time
is valid for all WorkingHours
of a Resource
. For more information please see IResource.setMaxRouteStartReductionTime(Duration,
boolean)
. If a route start reduction time
has to be valid for only one set of WorkingHours
please use the local
method IWorkingHours.setLocalMaxRouteStartReductionTime(Duration,
boolean)
.
isReductionTimeIncludedInWorkingTime
in interface IResource
public Optional<Long> getMaxRouteStartReductionTimeMillis()
IResource
Resource
can be expected to drive to the first Node
in its private time. The route start reduction time
affects all the WorkingHours
of that Resource
.
The route start reduction time
is valid for all WorkingHours
of a Resource
. For more information please see IResource.setMaxRouteStartReductionTime(Duration,
boolean)
. If a route start reduction time
has to be valid for only one set of WorkingHours
please use the local
method IWorkingHours.setLocalMaxRouteStartReductionTime(Duration,
boolean)
.
getMaxRouteStartReductionTimeMillis
in interface IResource
public Optional<Boolean> isReductionTimeOnlyUsedForDrivingPillar()
IResource
route start reduction time
for IPillarNode
has been set.
For more information please see IResource.setMaxRouteStartReductionTimePillar(Duration,
boolean)
. For a method that only affects a specific set of WorkingHours
please see
IWorkingHours.setLocalMaxRouteStartReductionTimePillar(Duration,
boolean)
.
isReductionTimeOnlyUsedForDrivingPillar
in interface IResource
public Optional<Long> getMaxRouteStartReductionTimeMillisPillar()
IResource
route start reduction time
for IPillarNode
in milliseconds.
The route start reduction time
is valid for all WorkingHours
of a Resource
. For more information please see IResource.setMaxRouteStartReductionTime(Duration,
boolean)
. If a route start reduction time
has to be valid for only one set of WorkingHours
please use the local
method IWorkingHours.setLocalMaxRouteStartReductionTime(Duration,
boolean)
.
getMaxRouteStartReductionTimeMillisPillar
in interface IResource
public void setMaxFreePostWorkDrivingTerminationTime(Duration nonPenalizedDrivingHomeOnOwnTimeDuration)
IResource
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 free post work driving
for all the WorkingHours
of the
Resource
. If different times hove to be set for specific WorkingHours
please
use IWorkingHours.setLocalMaxFreePostWorkDrivingTerminationTime(Duration)
setMaxFreePostWorkDrivingTerminationTime
in interface IResource
nonPenalizedDrivingHomeOnOwnTimeDuration
- the duration of the drive home that has to be
done in the free timepublic void setMaxFreePostWorkDrivingTerminationTime(Duration postTimeReductionTime, boolean onlyApplyOnOvertime)
IResource
setMaxFreePostWorkDrivingTerminationTime
in interface IResource
postTimeReductionTime
- the non penalized driving home on own time durationonlyApplyOnOvertime
- the only apply on overtimepublic Optional<Boolean> isOnlyApplyFreePostWorkDrivingOnOvertime()
isOnlyApplyFreePostWorkDrivingOnOvertime
in interface IResource
public Optional<Long> getMaxFreePostWorkDrivingTerminationTimeMillis()
IResource
Resource
can be expected to drive home
to its starting location in its free time.
For more information please see IResource.setMaxFreePostWorkDrivingTerminationTime(Duration)
.
getMaxFreePostWorkDrivingTerminationTimeMillis
in interface IResource
@Deprecated public boolean setMaxFlexPreWorkingHoursDrvingTime(Duration preWorkTime)
IResource
setMaxFlexPreWorkingHoursDrvingTime
in interface IResource
preWorkTime
- the duration time a resource can be expected to drive to the first node on
its own timepublic void setStaysOut(int totalStaysOut, int staysOutInRow, int minRecoverHours)
IResource
total stays
, the stays in a row
and the minimum recovery time
of a stay out cycle
. The minimum recovery time
is counted in number of WorkingHours
, which often but not necessarily are days.
For more information on stay out cycle
that is valid for all WorkingHours
of
a Resource
please see IResource.setStayOutCycleDefinition(Duration, LocalDate)
. For the
local
method that only affects specific WorkingHours
please see IWorkingHours.setLocalStayOutCycleDefinition(Duration,
LocalDate)
.
setStaysOut
in interface IResource
totalStaysOut
- the int for maximum stays outstaysOutInRow
- the int for maximum stays out in rowminRecoverHours
- the int for minimum number of hours at base before new stay out is
allowedpublic void setStayOutCycleDefinition(Duration cycle, LocalDate cycleStart)
IResource
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 minimum recovery time
is
counted in number of WorkingHours
, which often but not
necessarily are days.
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 is applied to
all WorkingHours
of the Resource
throughout the Optimization
.
If the cycle should only be applied to specific WorkingHours
so it can change
depending on the dates or days in the week (i.e. no overnight stays
on Fridays please
use IWorkingHours.setLocalStayOutCycleDefinition(Duration,
LocalDate)
.
setStayOutCycleDefinition
in interface IResource
cycle
- the duration of the cyclecycleStart
- the localDate day of the cycle startpublic int getMaxTotalStaysOut()
IResource
Resources
maximum number of overnight stays
, the default value is -1.
In order to be able to do an overnight stay
, IWorkingHours.setIsAvailableForStay(boolean)
and INode.setIsStayNode(boolean)
have to be true
.getMaxTotalStaysOut
in interface IResource
public int getMaxStaysOutInRow()
IResource
overnight stays
the Resource
can do in a row. The
default value is -1. In order to be able to do an overnight stay
, IWorkingHours.setIsAvailableForStay(boolean)
and INode.setIsStayNode(boolean)
have to be true
.getMaxStaysOutInRow
in interface IResource
public int getMinRecoverHours()
IResource
overnight stays
. The
default value is 1. In order to be able to do an overnight stay
, IWorkingHours.setIsAvailableForStay(boolean)
and INode.setIsStayNode(boolean)
have to be true
.getMinRecoverHours
in interface IResource
public Optional<Duration> getStayOutCycle()
IResource
stay out cycle
within which the maximum number of overnight stays
are
allowed and within which the the minimum recovery time
(days without overnight
stays
) has to be observed. The stay out cycle
of this method is valid for all the
WorkingHours
of the Resource
.
For more information please see IWorkingHours.setLocalStayOutCycleDefinition(Duration,
LocalDate)
. The linked local stay out cycle
is only valid for the WorkingHours
it has been set tough.
getStayOutCycle
in interface IResource
Optional
if no stay out cycle
has been
definedpublic Optional<LocalDate> getStayOutCycleStart()
IResource
stay out cycle
within which the maximum number of overnight stays
are allowed and within which the the minimum recovery time
(days
without overnight stays
) has to be observed. The stay out cycle
of this method
is valid for all the WorkingHours
of the Resource
. *
For more information please see IWorkingHours.setLocalStayOutCycleDefinition(Duration,
LocalDate)
. The linked local stay out cycle
is only valid for the WorkingHours
it has been set tough.
getStayOutCycleStart
in interface IResource
Optional
if no stay out cycle has
been defined
@Deprecated public void setStayOutPolicyActive(boolean stayOutPolicyActive)
IResource
Sets both
IResource.setStayOutPolicyReturnDistanceActive(boolean)
and
IResource.setStayOutPolicyReturnTimeActive(boolean)
to true
.
For more information please see IResource.setStayOutPolicy(Quantity, Duration)
.
setStayOutPolicyActive
in interface IResource
stayOutPolicyActive
- the boolean whether the return distance and the return time
threshold are activepublic void setStayOutPolicyReturnTimeActive(boolean stayOutPolicyReturnTimeActive)
IResource
Resource
needs to take longer to return to her starting
location
than the set threshold to be able to use an overnight stay
.setStayOutPolicyReturnTimeActive
in interface IResource
stayOutPolicyReturnTimeActive
- the boolean whether the return time threshold is activeIResource.setStayOutPolicy(Quantity, Duration)
public boolean isStayOutPolicyReturnTimeActive()
IResource
Resource
needs to take longer to return to her starting
location
than the set threshold to be able to use an overnight stay
.isStayOutPolicyReturnTimeActive
in interface IResource
IResource.setStayOutPolicy(Quantity, Duration)
public void setStayOutPolicyReturnDistanceActive(boolean stayOutPolicyReturnDistanceActive)
IResource
Resource
needs to be further away from its starting location
than the set threshold to be able to use an overnight stay
.setStayOutPolicyReturnDistanceActive
in interface IResource
stayOutPolicyReturnDistanceActive
- the boolean whether the return distance threshold is
activeIResource.setStayOutPolicy(Quantity, Duration)
public boolean isStayOutPolicyReturnDistanceActive()
IResource
Resource
needs to be further away from its starting location
than the set threshold to be able to use an overnight stay
.isStayOutPolicyReturnDistanceActive
in interface IResource
IResource.setStayOutPolicy(Quantity, Duration)
@Deprecated public void setStayOutPolicy(double minDistanceMeter, double minTimeSeconds)
IResource
Sets the minimal distance in meter
and time in seconds
the Resource
would need to return to his starting location which makes it eligible to do an overnight
stay
.
setStayOutPolicy
in interface IResource
minDistanceMeter
- the double distance threshold to be set in meterminTimeSeconds
- the double time threshold to be set in secondspublic void setStayOutPolicy(javax.measure.Quantity<javax.measure.quantity.Length> minDistanceForStayOut, Duration minTimeForStayOut)
IResource
Resource
needs to be away from its starting
location to be able to a overnight stay
. If this threshold is not surpassed the Resource
has to return home and start from there the next day. This is treated as a hard constraint
.setStayOutPolicy
in interface IResource
minDistanceForStayOut
- the Quantity<Length>
minimal distance from the starting
locationminTimeForStayOut
- the duration it would take to reach the starting locationpublic void setStayOutPolicyReturnTime(Duration minTimeForStayOut)
IResource
Resource
would need to return to her starting location
to be able to use an overnight stay
. If this threshold is not surpassed the Resource
has to return home and start from there the next day.setStayOutPolicyReturnTime
in interface IResource
minTimeForStayOut
- the duration threshold within which the Resource is not allowed to use
an overnight stayIResource.setStayOutPolicy(Quantity, Duration)
public Duration getStayOutPolicyReturnTime()
IResource
overnight stay
as Duration
.getStayOutPolicyReturnTime
in interface IResource
IResource.setStayOutPolicy(Quantity, Duration)
public void setStayOutPolicyReturnDistance(javax.measure.Quantity<javax.measure.quantity.Length> minDistanceForStayOut)
IResource
Resource
needs to be away from his starting
location
in order to be able to use an overnight stay
. If this threshold is not
surpassed the Resource
has to return home and start from there the next day.setStayOutPolicyReturnDistance
in interface IResource
minDistanceForStayOut
- the quantity length threshold for an overnight stayIResource.setStayOutPolicy(Quantity, Duration)
public javax.measure.Quantity<javax.measure.quantity.Length> getStayOutPolicyReturnDistance()
IResource
overnight stay
as Quantity
Length
.getStayOutPolicyReturnDistance
in interface IResource
IResource.setStayOutPolicy(Quantity, Duration)
public double getStayOutPolicyMinDistance()
IResource
overnight stay
in meter.
For more information please see IResource.setStayOutPolicy(Quantity, Duration)
.
getStayOutPolicyMinDistance
in interface IResource
public double getStayOutPolicyMinTime()
IResource
overnight
stay
in seconds.
For more information please see IResource.setStayOutPolicy(Quantity, Duration)
.
getStayOutPolicyMinTime
in interface IResource
public double getConnectionTimeEfficiencyFactor()
IResource
getConnectionTimeEfficiencyFactor()
, the default value is
1.0
. Depending on the vehicle in use the driving time may in- or decrease.
For example: Assuming a connection that has a base time of 20 minutes, a ConnectionTimeEfficiencyFactor of 0.5 would lead to a reduced time of 20*05 = 10 minutes.
getConnectionTimeEfficiencyFactor
in interface IResource
public void setConnectionTimeEfficiencyFactor(double connectionTimeEfficiencyFactor)
IResource
1.0
. The input must be >= 0
, otherwise an IllegalStateException
is thrown.setConnectionTimeEfficiencyFactor
in interface IResource
connectionTimeEfficiencyFactor
- double to be set@Deprecated public void addCapacity(double capacity)
IResource
addCapacity
in interface IResource
capacity
- the double capacity to be addedpublic void setCapacity(double[] capacity)
IResource
Resource
can carry of a specific good.
Several goods can be defined of which each a limited amount can be carried.
setCapacity
in interface IResource
capacity
- the new capacitypublic double[] getCapacity()
IResource
Resource
can carry.
For more information please see IResource.addCapacity(double)
.
getCapacity
in interface IResource
public void setCapacity(double[] capacity, double[] minDegratedCapacity, double[] capacityDegPerStop)
IResource
setCapacity
in interface IResource
capacity
- the capacityminDegratedCapacity
- the min degrated capacitycapacityDegPerStop
- the capacity deg per stoppublic void setMinimalDegratedCapacity(double[] minDegratedCapacity)
IResource
setMinimalDegratedCapacity
in interface IResource
minDegratedCapacity
- the new minimal degrated capacitypublic double[] getMinimalDegratedCapacity()
IResource
getMinimalDegratedCapacity
in interface IResource
public void setCapacityDegradationPerStop(double[] capacityDegPerStop)
IResource
setCapacityDegradationPerStop
in interface IResource
capacityDegPerStop
- the new capacity degradation per stoppublic double[] getCapacityDegradationPerStop()
IResource
getCapacityDegradationPerStop
in interface IResource
public void setInitialLoad(double[] initialLoad)
IResource
Resource
.
For more information please see IResource.addCapacity(double)
. If no capacity is defined, it
is assumed, the initial load equals the maximal capacity.
setInitialLoad
in interface IResource
initialLoad
- the double List initialLoadpublic double[] getInitialLoad()
IResource
Resource
.
For more information please see IResource.addCapacity(double)
.
getInitialLoad
in interface IResource
public void addConstraint(IResourceLevelConstraint constraint)
IResource
IConstraint
to the Resource
so it
can only give service to the Nodes
that have the appropriate IQualification
.
Used by UKPostCode
.
addConstraint
in interface IResource
constraint
- the iResourceLevelConstraint to which it will be limitedpublic List<IResourceLevelConstraint> getConstraints()
IResource
IConstraint
from the Resource
that
it is limited to.
For more information please see IResource.addConstraint(IResourceLevelConstraint)
.
getConstraints
in interface IResource
public void setMaxDrivingDistanceFirstNode(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance)
IResource
Resource
needs to drive to the first Node
.setMaxDrivingDistanceFirstNode
in interface IResource
maxDistance
- the quantity length maximal distance to the first Nodepublic Optional<javax.measure.Quantity<javax.measure.quantity.Length>> getMaxDrivingDistanceFirstNode()
IResource
Resource
needs to drive to the first Node
.getMaxDrivingDistanceFirstNode
in interface IResource
IResource.setMaxDrivingDistanceFirstNode(Quantity)
public void setMaxDrivingDistanceLastNode(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance)
IResource
Resource
needs to drive to the last Node
.setMaxDrivingDistanceLastNode
in interface IResource
maxDistance
- the quantity length maximal distancepublic Optional<javax.measure.Quantity<javax.measure.quantity.Length>> getMaxDrivingDistanceLastNode()
IResource
Resource
needs to drive to the last Node
.getMaxDrivingDistanceLastNode
in interface IResource
IResource.setMaxDrivingDistanceLastNode(Quantity)
public void setMaxDrivingTimeFirstNode(Duration maxTime)
IResource
Resource
is supposed to drive to the first
Node
.setMaxDrivingTimeFirstNode
in interface IResource
maxTime
- the duration maximal timepublic Optional<Duration> getMaxDrivingTimeFirstNode()
IResource
Resource
is supposed to drive to the first
Node
.getMaxDrivingTimeFirstNode
in interface IResource
IResource.setMaxDrivingTimeFirstNode(Duration)
public void setMaxDrivingTimeLastNode(Duration maxTime)
IResource
Resource
is supposed to drive to the last Node
.setMaxDrivingTimeLastNode
in interface IResource
maxTime
- the duration maximal timepublic Optional<Duration> getMaxDrivingTimeLastNode()
IResource
Resource
is supposed to drive to the last Node
.getMaxDrivingTimeLastNode
in interface IResource
IResource.setMaxDrivingDistanceLastNode(Quantity)
public void setResourceDepot(IResourceDepot depot)
IResource
setResourceDepot
in interface IResource
depot
- the new resource depotpublic Optional<IResourceDepot> getResourceDepot()
IResource
getResourceDepot
in interface IResource
public double getOverallVisitDurationEfficiencyFactor()
IResource
getOverallVisitDurationEfficiencyFactor
in interface IResource
public boolean setOverallVisitDurationEfficiencyFactor(double factor)
IResource
setOverallVisitDurationEfficiencyFactor
in interface IResource
factor
- the factorpublic void setAverageCO2EmissionFactor(double emissionFactor)
IResource
setAverageCO2EmissionFactor
in interface IResource
emissionFactor
- the new average CO2 emission factorpublic double getAverageCO2EmissionFactor()
IResource
getAverageCO2EmissionFactor
in interface IResource
Copyright © 2017–2023 DNA Evolutions GmbH. All rights reserved.