Class CapacityResource
- All Implemented Interfaces:
IOptimizationElement,IBasicResource,IResource,Serializable,Comparable<IBasicResource>
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.
- Since:
- 13/08/2019
- Version:
- 13/08/2019
- Author:
- DNA
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.dna.jopt.member.unit.IOptimizationElement
IOptimizationElement.OptimizationElementFlavour -
Field Summary
Fields inherited from class com.dna.jopt.member.unit.AbstractOptimizationElement
dutyHours -
Constructor Summary
ConstructorsConstructorDescriptionLoad *CapacityResource(String resourceId, double latitude, double longitude, double maxHours, double maxDistance, WorkingHours[] workingHours) Deprecated.CapacityResource(String resourceId, double latitude, double longitude, double maxHours, double maxDistance, List<IDutyHours> workingHours) Deprecated.please useCapacityResource(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 theCapacityResource.CapacityResource(String resourceId, com.dna.jopt.config.types.Position pos, Duration maxTime, javax.measure.Quantity<javax.measure.quantity.Length> maxDistance, List<IWorkingHours> workingHours) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCapacity(double capacity) Deprecated.voidaddConstraint(IResourceLevelConstraint constraint) Adds anIConstraintto theResourceso it can only give service to theNodesthat have the appropriateIQualification.booleandoubleGets the average CO2 emission factor.double[]Gets the capacity of goods aResourcecan carry.double[]Gets the capacity degradation per stop.doubleSets thegetConnectionTimeEfficiencyFactor(), the default value is1.0.Gets theIConstraintfrom theResourcethat it is limited to.double[]Gets the amount of a good that is already being carried by theResource.Optional<javax.measure.Quantity<javax.measure.quantity.Length>>Gets the maximal distance that theResourceneeds to drive to the firstNode.Optional<javax.measure.Quantity<javax.measure.quantity.Length>>Gets the maximal distance that theResourceneeds to drive to the lastNode.Gets the maximal driving time that theResourceis supposed to drive to the firstNode.Gets the maximal driving time that theResourceis supposed to drive to the lastNode.Gets the amount of time in milliseconds that theResourcecan be expected to drive home to its starting location in its free time.Gets themaximal pillar after hours timein milliseconds.Gets the maximum time which theResourcecan be expected to drive to the firstNodein its private time.Gets theroute start reduction timeforIPillarNodein milliseconds.intGets maximum number ofovernight staystheResourcecan do in a row.intGets theResourcesmaximum number ofovernight stays, the default value is -1.double[]Gets the minimal degrated capacity.intGets the number of defined working hours (often days) between twoovernight stays.doubleGets the overall visit duration efficiency factor.Gets the resource depot.Gets thestay out cyclewithin which the maximum number ofovernight staysare allowed and within which the the minimumrecovery time(days withoutovernight stays) has to be observed.Gets the starting day of thestay out cyclewithin which the maximum number ofovernight staysare allowed and within which the the minimumrecovery time(days withoutovernight stays) has to be observed.doubleGets the distance threshold to be able to use anovernight stayin meter.doubleGets the return time threshold that needs to be surpassed to be able to use anovernight stayin seconds.javax.measure.Quantity<javax.measure.quantity.Length>Gets the distance threshold that needs to be surpassed in order to be able to use anovernight stayasQuantityLength.Gets the time threshold that needs to be surpassed in order to be able to use anovernight stayasDuration.inthashCode()Checks whether theroute start reduction timeis included in theWorkingHours.Checks whether the potentially setroute start reduction timecan only be used for driving, not for working.Checks if aroute start reduction timeforIPillarNodehas been set.booleanChecks whether theResourceneeds to be further away from itsstarting locationthan the set threshold to be able to use anovernight stay.booleanChecks whether theResourceneeds to take longer to return to herstarting locationthan the set threshold to be able to use anovernight stay.voidsetAverageCO2EmissionFactor(double emissionFactor) Sets the average CO2 emission-factor.voidsetCapacity(double[] capacity) Sets the amount aResourcecan carry of a specific good.voidsetCapacity(double[] capacity, double[] minDegratedCapacity, double[] capacityDegPerStop) Sets the capacity.voidsetCapacityDegradationPerStop(double[] capacityDegPerStop) Sets the capacity degradation per stop.voidsetConnectionTimeEfficiencyFactor(double connectionTimeEfficiencyFactor) Sets connectionTimeEfficiencyFactor, the default value is1.0.voidsetInitialLoad(double[] initialLoad) Sets the the amount of a good that is already being carried by theResource.voidsetMaxDrivingDistanceFirstNode(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance) Sets the maximal distance that theResourceneeds to drive to the firstNode.voidsetMaxDrivingDistanceLastNode(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance) Sets the maximal distance that theResourceneeds to drive to the lastNode.voidsetMaxDrivingTimeFirstNode(Duration maxTime) Sets the maximal driving time that theResourceis supposed to drive to the firstNode.voidsetMaxDrivingTimeLastNode(Duration maxTime) Sets the maximal driving time that theResourceis supposed to drive to the lastNode.booleansetMaxFlexPreWorkingHoursDrvingTime(Duration preWorkTime) Deprecated.voidsetMaxFreePostWorkDrivingTerminationTime(Duration nonPenalizedDrivingHomeOnOwnTimeDuration) Sets the amount of time that theResourcecan be expected to drive home to its starting location in its free time.voidsetMaxFreePostWorkDrivingTerminationTime(Duration postTimeReductionTime, boolean onlyApplyOnOvertime) Sets the local max free post work driving termination time.booleansetMaxPillarAfterHoursTime(Duration maxPillarEndOverTime) Sets the amount of time afterWorkingHourswithin which aIPillarNodecan be set.booleansetMaxRouteStartReductionTime(Duration maxRouteStartReductionTime, boolean isOnlyUsedForDriving) Sets the maximum time which theResourcecan be expected to drive to the firstNodein its private time.booleansetMaxRouteStartReductionTimePillar(Duration maxRouteStartReductionTime, boolean isOnlyUsedForDriving) Sets theroute start reduction timeforIPillarNode.voidsetMinimalDegratedCapacity(double[] minDegratedCapacity) Sets the minimal degrated capacity.booleansetOverallVisitDurationEfficiencyFactor(double factor) Sets the overall visit duration efficiency factor.voidsetReductionTimeIsIncludedInWorkingTime(boolean isIncludedInTotalWorkingTime) Sets whether theroute start reduction timeis included in theWorkingHours.voidsetResourceDepot(IResourceDepot depot) Sets the resource depot.voidsetStayOutCycleDefinition(Duration cycle, LocalDate cycleStart) Sets theDurationof the cycle within which the maximum number ofovernight staysare allowed and within which the minimumrecovery time(WorkingHourswithoutovernight stays) has to be observed.voidsetStayOutPolicy(double minDistanceMeter, double minTimeSeconds) Deprecated.voidsetStayOutPolicy(javax.measure.Quantity<javax.measure.quantity.Length> minDistanceForStayOut, Duration minTimeForStayOut) Sets the minimal distance and time theResourceneeds to be away from its starting location to be able to aovernight stay.voidsetStayOutPolicyActive(boolean stayOutPolicyActive) Deprecated.voidsetStayOutPolicyReturnDistance(javax.measure.Quantity<javax.measure.quantity.Length> minDistanceForStayOut) Sets the minimal distance aResourceneeds to be away from hisstarting locationin order to be able to use anovernight stay.voidsetStayOutPolicyReturnDistanceActive(boolean stayOutPolicyReturnDistanceActive) Sets whether theResourceneeds to be further away from itsstarting locationthan the set threshold to be able to use anovernight stay.voidsetStayOutPolicyReturnTime(Duration minTimeForStayOut) Sets the minimal time aResourcewould need to return to herstarting locationto be able to use anovernight stay.voidsetStayOutPolicyReturnTimeActive(boolean stayOutPolicyReturnTimeActive) Sets whether theResourceneeds to take longer to return to herstarting locationthan the set threshold to be able to use anovernight stay.voidsetStaysOut(int totalStaysOut, int staysOutInRow, int minRecoverHours) Sets thetotal stays, thestays in a rowand theminimum recovery timeof astay out cycle.Methods inherited from class com.dna.jopt.member.unit.resource.AbstractBasicCapacityResource
addQualification, compareTo, copyWithNewId, getAcceptableOverdistanceMeter, getAcceptableOvertimeSeconds, getAverageSpeed, getAvgSpeed, getDestinationDistMatrixId, getDestinationLatitude, getDestinationLongitude, getDestinationPosition, getFixCost, getFlavour, getFlexTimeMillis, getMaxDistance, getMaxHours, getMaxWorkingDistance, getMaxWorkingTime, getPerHourCost, getPerHourProductionCost, 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, setPerHourProductionCost, setPerKilometerCost, setResourceId, setSkillEfficiencyFactor, setStrictOverdistanceLimit, setStrictOvertimeLimit, setWorkingHours, toStringMethods inherited from class com.dna.jopt.member.unit.AbstractOptimizationElement
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, setPositionMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.dna.jopt.member.unit.resource.IBasicResource
addQualification, getAcceptableOverdistanceMeter, getAcceptableOvertimeSeconds, getAverageSpeed, getAvgSpeed, getDestinationDistMatrixId, getDestinationLatitude, getDestinationLongitude, getDestinationPosition, getFixCost, getFlexTimeMillis, getMaxDistance, getMaxHours, getMaxWorkingDistance, getMaxWorkingTime, getPerHourCost, getPerHourProductionCost, 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, setPerHourProductionCost, setPerKilometerCost, setSkillEfficiencyFactor, setStrictOverdistanceLimit, setStrictOvertimeLimitMethods inherited from interface com.dna.jopt.member.unit.IOptimizationElement
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
-
Constructor Details
-
CapacityResource
public CapacityResource()Load * -
CapacityResource
public CapacityResource(String resourceId, double latitude, double longitude, Duration maxTime, javax.measure.Quantity<javax.measure.quantity.Length> maxDistance, List<IWorkingHours> workingHours) The constructor for theCapacityResource.Implementation example:
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.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);- Parameters:
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 operates
-
CapacityResource
public CapacityResource(String resourceId, com.dna.jopt.config.types.Position pos, Duration maxTime, javax.measure.Quantity<javax.measure.quantity.Length> maxDistance, List<IWorkingHours> workingHours) -
CapacityResource
@Deprecated public CapacityResource(String resourceId, double latitude, double longitude, double maxHours, double maxDistance, List<IDutyHours> workingHours) Deprecated.please useCapacityResource(String, double, double, Duration, Quantity, List)with updated parameters.This is adeprecatedconstructor that should not be used anymore since it is using the maximum working time as adoublewhereas the new constructor uses aDuration. Likewise thedoublemaximal distance has been replaced byQuantity<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.
- Parameters:
resourceId- resourceIdlatitude- latitudelongitude- longitudemaxHours- maxHoursmaxDistance- maxDistanceworkingHours- workingHours
-
CapacityResource
@Deprecated public CapacityResource(String resourceId, double latitude, double longitude, double maxHours, double maxDistance, WorkingHours[] workingHours) Deprecated.please useCapacityResource(String, double, double, Duration, Quantity, List)with updated parameters.- Parameters:
resourceId- the resource idlatitude- the latitudelongitude- the longitudemaxHours- the max hoursmaxDistance- the max distanceworkingHours- the working hours- Category:
- Legacy
LEGACY CONSTRUCTOR
Instantiates a new capacity resource.
PLEASE DO NOT USE THIS CONSTRUCTOR ANYMORE! IT WILL BE REMOVED IN FUTURE VERSIONS
-
-
Method Details
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractBasicCapacityResource
-
equals
- Overrides:
equalsin classAbstractBasicCapacityResource
-
setMaxPillarAfterHoursTime
Description copied from interface:IResourceSets the amount of time afterWorkingHourswithin which aIPillarNodecan be set. TheResourceshave to visit thisPillareven tough it is outside ofWorkingHours.This method sets the same time for all
WorkingHours. If you want to set the time for a specific set ofWorkingHoursplease useIWorkingHours.setLocalMaxPillarAfterHoursTime(Duration).- Specified by:
setMaxPillarAfterHoursTimein interfaceIResource- Parameters:
maxPillarEndOverTime- the duration after WorkingHours within which a Pillar still has to be given service- Returns:
- true if the setting was accepted
-
getMaxPillarAfterHoursTime
Description copied from interface:IResourceGets themaximal pillar after hours timein milliseconds.For more information please see
IResource.setMaxPillarAfterHoursTime(Duration).- Specified by:
getMaxPillarAfterHoursTimein interfaceIResource- Returns:
- the optional long pillar after hours time
-
setReductionTimeIsIncludedInWorkingTime
public void setReductionTimeIsIncludedInWorkingTime(boolean isIncludedInTotalWorkingTime) Description copied from interface:IResourceSets whether theroute start reduction timeis included in theWorkingHours. The default value isfalse. IffalseandIResource.setMaxRouteStartReductionTime(Duration, boolean)is set totruethe driving time to the firstNodehas to be done in theResourcesprivate time.For more information on
route start reduction timeplease see the link above.- Specified by:
setReductionTimeIsIncludedInWorkingTimein interfaceIResource- Parameters:
isIncludedInTotalWorkingTime- the boolean whether reduction time is included in the WorkingHours
-
setMaxRouteStartReductionTime
public boolean setMaxRouteStartReductionTime(Duration maxRouteStartReductionTime, boolean isOnlyUsedForDriving) Description copied from interface:IResourceSets the maximum time which theResourcecan be expected to drive to the firstNodein its private time.If the
OpeningHoursof aNodeand theWorkingHoursof aResourcestart at 8 the driving time is an hour and theResource'sroute start reduction timeis 30 Minutes theResourcewill start driving towards theNodeat 7.30 (outside of itsWorkingHours) and arrive there at 8.30.The
Booleandefines whether theroute start reduction timecan only be used for driving or not and is usually set totrue. TheResourcecan not work in theroute start reduction timein that case.The
route start reduction timeis valid for allWorkingHoursof aResource. If aroute start reduction timehas to be valid for only one set ofWorkingHoursplease use the local methodIWorkingHours.setLocalMaxRouteStartReductionTime(Duration, boolean)- Specified by:
setMaxRouteStartReductionTimein interfaceIResource- Parameters:
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 driving- Returns:
- false if reductionTime is null or negative
-
setMaxRouteStartReductionTimePillar
public boolean setMaxRouteStartReductionTimePillar(Duration maxRouteStartReductionTime, boolean isOnlyUsedForDriving) Description copied from interface:IResourceSets theroute start reduction timeforIPillarNode. Overwrites the setroute start reduction timethat is valid forINodesand sets the new value forPillars. If noroute start reduction timehas been set, sets the new value forPillarsonly.The
Booleandefines whether theroute start reduction timecan only be used for driving or not and is usually set totrue.For more information please see
IResource.setMaxRouteStartReductionTime(Duration, boolean).- Specified by:
setMaxRouteStartReductionTimePillarin interfaceIResource- Parameters:
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 driving- Returns:
- false if reductionTime is null or negative
-
isReductionTimeOnlyUsedForDriving
Description copied from interface:IResourceChecks whether the potentially setroute start reduction timecan only be used for driving, not for working. Per default this is set totrue. In this case theroute start reduction timeis valid for allWorkingHoursof thatResource.The
route start reduction timeis valid for allWorkingHoursof aResource. For more information please seeIResource.setMaxRouteStartReductionTime(Duration, boolean). If aroute start reduction timehas to be valid for only one set ofWorkingHoursplease use thelocalmethodIWorkingHours.setLocalMaxRouteStartReductionTime(Duration, boolean).- Specified by:
isReductionTimeOnlyUsedForDrivingin interfaceIResource- Returns:
- the optional boolean if the time can only be used for driving, returns an empty optional if no reduction time has been set
-
isReductionTimeIncludedInWorkingTime
Description copied from interface:IResourceChecks whether theroute start reduction timeis included in theWorkingHours. The default value isfalse. IffalseandIResource.setMaxRouteStartReductionTime(Duration, boolean)is set totruethe driving time to the firstNodehas to be done in theResourcesprivate time.The
route start reduction timeis valid for allWorkingHoursof aResource. For more information please seeIResource.setMaxRouteStartReductionTime(Duration, boolean). If aroute start reduction timehas to be valid for only one set ofWorkingHoursplease use thelocalmethodIWorkingHours.setLocalMaxRouteStartReductionTime(Duration, boolean).- Specified by:
isReductionTimeIncludedInWorkingTimein interfaceIResource- Returns:
- the optional with the boolean or an empty optional if no reduction time has been set
-
getMaxRouteStartReductionTimeMillis
Description copied from interface:IResourceGets the maximum time which theResourcecan be expected to drive to the firstNodein its private time. Theroute start reduction timeaffects all theWorkingHoursof thatResource.The
route start reduction timeis valid for allWorkingHoursof aResource. For more information please seeIResource.setMaxRouteStartReductionTime(Duration, boolean). If aroute start reduction timehas to be valid for only one set ofWorkingHoursplease use thelocalmethodIWorkingHours.setLocalMaxRouteStartReductionTime(Duration, boolean).- Specified by:
getMaxRouteStartReductionTimeMillisin interfaceIResource- Returns:
- the optional Long milliseconds of the routestart reduction time
-
isReductionTimeOnlyUsedForDrivingPillar
Description copied from interface:IResourceChecks if aroute start reduction timeforIPillarNodehas been set.For more information please see
IResource.setMaxRouteStartReductionTimePillar(Duration, boolean). For a method that only affects a specific set ofWorkingHoursplease seeIWorkingHours.setLocalMaxRouteStartReductionTimePillar(Duration, boolean).- Specified by:
isReductionTimeOnlyUsedForDrivingPillarin interfaceIResource- Returns:
- the optional boolean whether reduction time for pillars has been set
-
getMaxRouteStartReductionTimeMillisPillar
Description copied from interface:IResourceGets theroute start reduction timeforIPillarNodein milliseconds.The
route start reduction timeis valid for allWorkingHoursof aResource. For more information please seeIResource.setMaxRouteStartReductionTime(Duration, boolean). If aroute start reduction timehas to be valid for only one set ofWorkingHoursplease use thelocalmethodIWorkingHours.setLocalMaxRouteStartReductionTime(Duration, boolean).- Specified by:
getMaxRouteStartReductionTimeMillisPillarin interfaceIResource- Returns:
- the optional long milliseconds, returns an empty optional if no reduction time has been set
-
setMaxFreePostWorkDrivingTerminationTime
public void setMaxFreePostWorkDrivingTerminationTime(Duration nonPenalizedDrivingHomeOnOwnTimeDuration) Description copied from interface:IResourceSets the amount of time that theResourcecan be expected to drive home to its starting location in its free time.If returning from the last
Nodeto the starting location takes 1 hour and thefreePostWorkDrivingTerminationTimeis set to 40 minutes, those 40 minutes of the drive home are considered private time.This method sets the
free post work drivingfor all theWorkingHoursof theResource. If different times hove to be set for specificWorkingHoursplease useIWorkingHours.setLocalMaxFreePostWorkDrivingTerminationTime(Duration)- Specified by:
setMaxFreePostWorkDrivingTerminationTimein interfaceIResource- Parameters:
nonPenalizedDrivingHomeOnOwnTimeDuration- the duration of the drive home that has to be done in the free time
-
setMaxFreePostWorkDrivingTerminationTime
public void setMaxFreePostWorkDrivingTerminationTime(Duration postTimeReductionTime, boolean onlyApplyOnOvertime) Description copied from interface:IResourceSets 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:
setMaxFreePostWorkDrivingTerminationTimein interfaceIResource- Parameters:
postTimeReductionTime- the non penalized driving home on own time durationonlyApplyOnOvertime- the only apply on overtime
-
isOnlyApplyFreePostWorkDrivingOnOvertime
- Specified by:
isOnlyApplyFreePostWorkDrivingOnOvertimein interfaceIResource
-
getMaxFreePostWorkDrivingTerminationTimeMillis
Description copied from interface:IResourceGets the amount of time in milliseconds that theResourcecan be expected to drive home to its starting location in its free time.For more information please see
IResource.setMaxFreePostWorkDrivingTerminationTime(Duration).- Specified by:
getMaxFreePostWorkDrivingTerminationTimeMillisin interfaceIResource- Returns:
- the optional long milliseconds or an empty optional if no free post work driving termination time has been set
-
setMaxFlexPreWorkingHoursDrvingTime
Deprecated.Description copied from interface:IResourceDeprecated method.- Specified by:
setMaxFlexPreWorkingHoursDrvingTimein interfaceIResource- Parameters:
preWorkTime- the duration time a resource can be expected to drive to the first node on its own time- Returns:
- false if faulty input
-
setStaysOut
public void setStaysOut(int totalStaysOut, int staysOutInRow, int minRecoverHours) Description copied from interface:IResourceSets thetotal stays, thestays in a rowand theminimum recovery timeof astay out cycle. Theminimum recovery timeis counted in number ofWorkingHours, which often but not necessarily are days.For more information on
stay out cyclethat is valid for allWorkingHoursof aResourceplease seeIResource.setStayOutCycleDefinition(Duration, LocalDate). For thelocalmethod that only affects specificWorkingHoursplease seeIWorkingHours.setLocalStayOutCycleDefinition(Duration, LocalDate).- Specified by:
setStaysOutin interfaceIResource- Parameters:
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 allowed
-
setStayOutCycleDefinition
Description copied from interface:IResourceSets theDurationof the cycle within which the maximum number ofovernight staysare allowed and within which the minimumrecovery time(WorkingHourswithoutovernight stays) has to be observed. Theminimum recovery timeis counted in number ofWorkingHours, which often but not necessarily are days.Without setting the cycle the maximal number of
overnight stayswill not be refreshed and count for the full duration of theWorkingHours. The cycle is applied to allWorkingHoursof theResourcethroughout theOptimization.If the cycle should only be applied to specific
WorkingHoursso it can change depending on the dates or days in the week (i.e. noovernight stayson Fridays please useIWorkingHours.setLocalStayOutCycleDefinition(Duration, LocalDate).- Specified by:
setStayOutCycleDefinitionin interfaceIResource- Parameters:
cycle- the duration of the cyclecycleStart- the localDate day of the cycle start
-
getMaxTotalStaysOut
public int getMaxTotalStaysOut()Description copied from interface:IResourceGets theResourcesmaximum number ofovernight stays, the default value is -1. In order to be able to do anovernight stay,IWorkingHours.setIsAvailableForStay(boolean)andINode.setIsStayNode(boolean)have to betrue.- Specified by:
getMaxTotalStaysOutin interfaceIResource- Returns:
- the int totalStaysOut
-
getMaxStaysOutInRow
public int getMaxStaysOutInRow()Description copied from interface:IResourceGets maximum number ofovernight staystheResourcecan do in a row. The default value is -1. In order to be able to do anovernight stay,IWorkingHours.setIsAvailableForStay(boolean)andINode.setIsStayNode(boolean)have to betrue.- Specified by:
getMaxStaysOutInRowin interfaceIResource- Returns:
- the int staysOutInRow
-
getMinRecoverHours
public int getMinRecoverHours()Description copied from interface:IResourceGets the number of defined working hours (often days) between twoovernight stays. The default value is 1. In order to be able to do anovernight stay,IWorkingHours.setIsAvailableForStay(boolean)andINode.setIsStayNode(boolean)have to betrue.- Specified by:
getMinRecoverHoursin interfaceIResource- Returns:
- the int minRecoverHours
-
getStayOutCycle
Description copied from interface:IResourceGets thestay out cyclewithin which the maximum number ofovernight staysare allowed and within which the the minimumrecovery time(days withoutovernight stays) has to be observed. Thestay out cycleof this method is valid for all theWorkingHoursof theResource.For more information please see
IWorkingHours.setLocalStayOutCycleDefinition(Duration, LocalDate). The linkedlocal stay out cycleis only valid for theWorkingHoursit has been set tough.- Specified by:
getStayOutCyclein interfaceIResource- Returns:
- the stay out cycle or an empty
Optionalif nostay out cyclehas been defined
-
getStayOutCycleStart
Description copied from interface:IResourceGets the starting day of thestay out cyclewithin which the maximum number ofovernight staysare allowed and within which the the minimumrecovery time(days withoutovernight stays) has to be observed. Thestay out cycleof this method is valid for all theWorkingHoursof theResource. *For more information please see
IWorkingHours.setLocalStayOutCycleDefinition(Duration, LocalDate). The linkedlocal stay out cycleis only valid for theWorkingHoursit has been set tough.- Specified by:
getStayOutCycleStartin interfaceIResource- Returns:
- the start of the cycle or an empty
Optionalif nostay out cycle has been defined
-
setStayOutPolicyActive
Deprecated.Description copied from interface:IResourceDeprecated methodSets both
IResource.setStayOutPolicyReturnDistanceActive(boolean)andIResource.setStayOutPolicyReturnTimeActive(boolean)to
true.For more information please see
IResource.setStayOutPolicy(Quantity, Duration).- Specified by:
setStayOutPolicyActivein interfaceIResource- Parameters:
stayOutPolicyActive- the boolean whether the return distance and the return time threshold are active
-
setStayOutPolicyReturnTimeActive
public void setStayOutPolicyReturnTimeActive(boolean stayOutPolicyReturnTimeActive) Description copied from interface:IResourceSets whether theResourceneeds to take longer to return to herstarting locationthan the set threshold to be able to use anovernight stay.- Specified by:
setStayOutPolicyReturnTimeActivein interfaceIResource- Parameters:
stayOutPolicyReturnTimeActive- the boolean whether the return time threshold is active- See Also:
-
isStayOutPolicyReturnTimeActive
public boolean isStayOutPolicyReturnTimeActive()Description copied from interface:IResourceChecks whether theResourceneeds to take longer to return to herstarting locationthan the set threshold to be able to use anovernight stay.- Specified by:
isStayOutPolicyReturnTimeActivein interfaceIResource- Returns:
- the boolean whether the return time threshold is active
- See Also:
-
setStayOutPolicyReturnDistanceActive
public void setStayOutPolicyReturnDistanceActive(boolean stayOutPolicyReturnDistanceActive) Description copied from interface:IResourceSets whether theResourceneeds to be further away from itsstarting locationthan the set threshold to be able to use anovernight stay.- Specified by:
setStayOutPolicyReturnDistanceActivein interfaceIResource- Parameters:
stayOutPolicyReturnDistanceActive- the boolean whether the return distance threshold is active- See Also:
-
isStayOutPolicyReturnDistanceActive
public boolean isStayOutPolicyReturnDistanceActive()Description copied from interface:IResourceChecks whether theResourceneeds to be further away from itsstarting locationthan the set threshold to be able to use anovernight stay.- Specified by:
isStayOutPolicyReturnDistanceActivein interfaceIResource- Returns:
- the boolean whether the return distance threshold is active
- See Also:
-
setStayOutPolicy
Deprecated.Description copied from interface:IResourceDeprecated method.Sets the minimal distance in
meterand time insecondstheResourcewould need to return to his starting location which makes it eligible to do anovernight stay.- Specified by:
setStayOutPolicyin interfaceIResource- Parameters:
minDistanceMeter- the double distance threshold to be set in meterminTimeSeconds- the double time threshold to be set in seconds
-
setStayOutPolicy
public void setStayOutPolicy(javax.measure.Quantity<javax.measure.quantity.Length> minDistanceForStayOut, Duration minTimeForStayOut) Description copied from interface:IResourceSets the minimal distance and time theResourceneeds to be away from its starting location to be able to aovernight stay. If this threshold is not surpassed theResourcehas to return home and start from there the next day. This is treated as ahard constraint.- Specified by:
setStayOutPolicyin interfaceIResource- Parameters:
minDistanceForStayOut- theQuantity<Length>minimal distance from the starting locationminTimeForStayOut- the duration it would take to reach the starting location
-
setStayOutPolicyReturnTime
Description copied from interface:IResourceSets the minimal time aResourcewould need to return to herstarting locationto be able to use anovernight stay. If this threshold is not surpassed theResourcehas to return home and start from there the next day.- Specified by:
setStayOutPolicyReturnTimein interfaceIResource- Parameters:
minTimeForStayOut- the duration threshold within which the Resource is not allowed to use an overnight stay- See Also:
-
getStayOutPolicyReturnTime
Description copied from interface:IResourceGets the time threshold that needs to be surpassed in order to be able to use anovernight stayasDuration.- Specified by:
getStayOutPolicyReturnTimein interfaceIResource- Returns:
- the duration of the time threshold
- See Also:
-
setStayOutPolicyReturnDistance
public void setStayOutPolicyReturnDistance(javax.measure.Quantity<javax.measure.quantity.Length> minDistanceForStayOut) Description copied from interface:IResourceSets the minimal distance aResourceneeds to be away from hisstarting locationin order to be able to use anovernight stay. If this threshold is not surpassed theResourcehas to return home and start from there the next day.- Specified by:
setStayOutPolicyReturnDistancein interfaceIResource- Parameters:
minDistanceForStayOut- the quantity length threshold for an overnight stay- See Also:
-
getStayOutPolicyReturnDistance
public javax.measure.Quantity<javax.measure.quantity.Length> getStayOutPolicyReturnDistance()Description copied from interface:IResourceGets the distance threshold that needs to be surpassed in order to be able to use anovernight stayasQuantityLength.- Specified by:
getStayOutPolicyReturnDistancein interfaceIResource- Returns:
- the quantity length distance threshold
- See Also:
-
getStayOutPolicyMinDistance
public double getStayOutPolicyMinDistance()Description copied from interface:IResourceGets the distance threshold to be able to use anovernight stayin meter.For more information please see
IResource.setStayOutPolicy(Quantity, Duration).- Specified by:
getStayOutPolicyMinDistancein interfaceIResource- Returns:
- the double distance threshold in meter
-
getStayOutPolicyMinTime
public double getStayOutPolicyMinTime()Description copied from interface:IResourceGets the return time threshold that needs to be surpassed to be able to use anovernight stayin seconds.For more information please see
IResource.setStayOutPolicy(Quantity, Duration).- Specified by:
getStayOutPolicyMinTimein interfaceIResource- Returns:
- the double return time threshold in seconds
-
getConnectionTimeEfficiencyFactor
public double getConnectionTimeEfficiencyFactor()Description copied from interface:IResourceSets thegetConnectionTimeEfficiencyFactor(), the default value is1.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.
- Specified by:
getConnectionTimeEfficiencyFactorin interfaceIResource- Returns:
- the double getConnectionTimeEfficiencyFactor
-
setConnectionTimeEfficiencyFactor
public void setConnectionTimeEfficiencyFactor(double connectionTimeEfficiencyFactor) Description copied from interface:IResourceSets connectionTimeEfficiencyFactor, the default value is1.0. The input must be>= 0, otherwise anIllegalStateExceptionis thrown.- Specified by:
setConnectionTimeEfficiencyFactorin interfaceIResource- Parameters:
connectionTimeEfficiencyFactor- double to be set
-
addCapacity
Deprecated.Description copied from interface:IResourceAdds the capacity.- Specified by:
addCapacityin interfaceIResource- Parameters:
capacity- the double capacity to be added
-
setCapacity
public void setCapacity(double[] capacity) Description copied from interface:IResourceSets the amount aResourcecan carry of a specific good.Several goods can be defined of which each a limited amount can be carried.
- Specified by:
setCapacityin interfaceIResource- Parameters:
capacity- the new capacity
-
getCapacity
public double[] getCapacity()Description copied from interface:IResourceGets the capacity of goods aResourcecan carry.For more information please see
IResource.addCapacity(double).- Specified by:
getCapacityin interfaceIResource- Returns:
- the double value of every member of capacity
-
setCapacity
public void setCapacity(double[] capacity, double[] minDegratedCapacity, double[] capacityDegPerStop) Description copied from interface:IResourceSets the capacity.- Specified by:
setCapacityin interfaceIResource- Parameters:
capacity- the capacityminDegratedCapacity- the min degrated capacitycapacityDegPerStop- the capacity deg per stop
-
setMinimalDegratedCapacity
public void setMinimalDegratedCapacity(double[] minDegratedCapacity) Description copied from interface:IResourceSets the minimal degrated capacity.- Specified by:
setMinimalDegratedCapacityin interfaceIResource- Parameters:
minDegratedCapacity- the new minimal degrated capacity
-
getMinimalDegratedCapacity
public double[] getMinimalDegratedCapacity()Description copied from interface:IResourceGets the minimal degrated capacity.- Specified by:
getMinimalDegratedCapacityin interfaceIResource- Returns:
- the minimal degrated capacity
-
setCapacityDegradationPerStop
public void setCapacityDegradationPerStop(double[] capacityDegPerStop) Description copied from interface:IResourceSets the capacity degradation per stop.- Specified by:
setCapacityDegradationPerStopin interfaceIResource- Parameters:
capacityDegPerStop- the new capacity degradation per stop
-
getCapacityDegradationPerStop
public double[] getCapacityDegradationPerStop()Description copied from interface:IResourceGets the capacity degradation per stop.- Specified by:
getCapacityDegradationPerStopin interfaceIResource- Returns:
- the capacity degradation per stop
-
setInitialLoad
public void setInitialLoad(double[] initialLoad) Description copied from interface:IResourceSets the the amount of a good that is already being carried by theResource.For more information please see
IResource.addCapacity(double). If no capacity is defined, it is assumed, the initial load equals the maximal capacity.- Specified by:
setInitialLoadin interfaceIResource- Parameters:
initialLoad- the double List initialLoad
-
getInitialLoad
public double[] getInitialLoad()Description copied from interface:IResourceGets the amount of a good that is already being carried by theResource.For more information please see
IResource.addCapacity(double).- Specified by:
getInitialLoadin interfaceIResource- Returns:
- the double List initialLoad
-
addConstraint
Description copied from interface:IResourceAdds anIConstraintto theResourceso it can only give service to theNodesthat have the appropriateIQualification.Used by
UKPostCode.- Specified by:
addConstraintin interfaceIResource- Parameters:
constraint- the iResourceLevelConstraint to which it will be limited
-
getConstraints
Description copied from interface:IResourceGets theIConstraintfrom theResourcethat it is limited to.For more information please see
IResource.addConstraint(IResourceLevelConstraint).- Specified by:
getConstraintsin interfaceIResource- Returns:
- the constraint of the resource
-
setMaxDrivingDistanceFirstNode
public void setMaxDrivingDistanceFirstNode(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance) Description copied from interface:IResourceSets the maximal distance that theResourceneeds to drive to the firstNode.- Specified by:
setMaxDrivingDistanceFirstNodein interfaceIResource- Parameters:
maxDistance- the quantity length maximal distance to the first Node
-
getMaxDrivingDistanceFirstNode
public Optional<javax.measure.Quantity<javax.measure.quantity.Length>> getMaxDrivingDistanceFirstNode()Description copied from interface:IResourceGets the maximal distance that theResourceneeds to drive to the firstNode.- Specified by:
getMaxDrivingDistanceFirstNodein interfaceIResource- Returns:
- the optional quantity length of the distance, an empty optional if no value has been set
- See Also:
-
setMaxDrivingDistanceLastNode
public void setMaxDrivingDistanceLastNode(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance) Description copied from interface:IResourceSets the maximal distance that theResourceneeds to drive to the lastNode.- Specified by:
setMaxDrivingDistanceLastNodein interfaceIResource- Parameters:
maxDistance- the quantity length maximal distance
-
getMaxDrivingDistanceLastNode
public Optional<javax.measure.Quantity<javax.measure.quantity.Length>> getMaxDrivingDistanceLastNode()Description copied from interface:IResourceGets the maximal distance that theResourceneeds to drive to the lastNode.- Specified by:
getMaxDrivingDistanceLastNodein interfaceIResource- Returns:
- the optional quantity length distance or an empty optional
- See Also:
-
setMaxDrivingTimeFirstNode
Description copied from interface:IResourceSets the maximal driving time that theResourceis supposed to drive to the firstNode.- Specified by:
setMaxDrivingTimeFirstNodein interfaceIResource- Parameters:
maxTime- the duration maximal time
-
getMaxDrivingTimeFirstNode
Description copied from interface:IResourceGets the maximal driving time that theResourceis supposed to drive to the firstNode.- Specified by:
getMaxDrivingTimeFirstNodein interfaceIResource- Returns:
- the optional duration or an empty optional if no value has been set
- See Also:
-
setMaxDrivingTimeLastNode
Description copied from interface:IResourceSets the maximal driving time that theResourceis supposed to drive to the lastNode.- Specified by:
setMaxDrivingTimeLastNodein interfaceIResource- Parameters:
maxTime- the duration maximal time
-
getMaxDrivingTimeLastNode
Description copied from interface:IResourceGets the maximal driving time that theResourceis supposed to drive to the lastNode.- Specified by:
getMaxDrivingTimeLastNodein interfaceIResource- Returns:
- the optional duration or an empty optional if no value has been set
- See Also:
-
setResourceDepot
Description copied from interface:IResourceSets the resource depot.- Specified by:
setResourceDepotin interfaceIResource- Parameters:
depot- the new resource depot
-
getResourceDepot
Description copied from interface:IResourceGets the resource depot.- Specified by:
getResourceDepotin interfaceIResource- Returns:
- the resource depot
-
getOverallVisitDurationEfficiencyFactor
public double getOverallVisitDurationEfficiencyFactor()Description copied from interface:IResourceGets the overall visit duration efficiency factor.- Specified by:
getOverallVisitDurationEfficiencyFactorin interfaceIResource- Returns:
- the overall visit duration efficiency factor
-
setOverallVisitDurationEfficiencyFactor
public boolean setOverallVisitDurationEfficiencyFactor(double factor) Description copied from interface:IResourceSets the overall visit duration efficiency factor.- Specified by:
setOverallVisitDurationEfficiencyFactorin interfaceIResource- Parameters:
factor- the factor- Returns:
- true, if successful
-
setAverageCO2EmissionFactor
public void setAverageCO2EmissionFactor(double emissionFactor) Description copied from interface:IResourceSets the average CO2 emission-factor. The default value is 0.377 [kgCO2/km]. This is approximately the emission factor of a vehicle with an average fuel consumption of 12-litre diesel per 100 km.- Specified by:
setAverageCO2EmissionFactorin interfaceIResource- Parameters:
emissionFactor- the new average CO2 emission factor
-
getAverageCO2EmissionFactor
public double getAverageCO2EmissionFactor()Description copied from interface:IResourceGets the average CO2 emission factor. The default value is 0.377 [kgCO2/km]. This is approximately the emission factor of a vehicle with an average fuel consumption of 12-litre diesel per 100 km.- Specified by:
getAverageCO2EmissionFactorin interfaceIResource- Returns:
- the average CO2 emission factor
-
CapacityResource(String, double, double, Duration, Quantity, List)with updated parameters.