Class CapacityResource

All Implemented Interfaces:
IOptimizationElement, IBasicResource, IResource, Serializable, Comparable<IBasicResource>

public class CapacityResource extends AbstractBasicCapacityResource implements IResource
This 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:
  • 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 the 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.
      Parameters:
      resourceId - the string name of the resource
      latitude - the double latitude of the resources home location
      longitude - the double longitude of the resources home location
      maxTime - the duration maximum time that could be used for work
      maxDistance - the length maximal distance the capacityResource is allowed to drive
      workingHours - 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.
      This is a 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.

      Parameters:
      resourceId - resourceId
      latitude - latitude
      longitude - longitude
      maxHours - maxHours
      maxDistance - maxDistance
      workingHours - workingHours
    • CapacityResource

      @Deprecated public CapacityResource(String resourceId, double latitude, double longitude, double maxHours, double maxDistance, WorkingHours[] workingHours)
      Deprecated.
      Parameters:
      resourceId - the resource id
      latitude - the latitude
      longitude - the longitude
      maxHours - the max hours
      maxDistance - the max distance
      workingHours - 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:
      hashCode in class AbstractBasicCapacityResource
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class AbstractBasicCapacityResource
    • setMaxPillarAfterHoursTime

      public boolean setMaxPillarAfterHoursTime(Duration maxPillarEndOverTime)
      Description copied from interface: IResource
      Sets the amount of time after 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).

      Specified by:
      setMaxPillarAfterHoursTime in interface IResource
      Parameters:
      maxPillarEndOverTime - the duration after WorkingHours within which a Pillar still has to be given service
      Returns:
      true if the setting was accepted
    • getMaxPillarAfterHoursTime

      public Optional<Long> getMaxPillarAfterHoursTime()
      Description copied from interface: IResource
      Gets the maximal pillar after hours time in milliseconds.

      For more information please see IResource.setMaxPillarAfterHoursTime(Duration).

      Specified by:
      getMaxPillarAfterHoursTime in interface IResource
      Returns:
      the optional long pillar after hours time
    • setReductionTimeIsIncludedInWorkingTime

      public void setReductionTimeIsIncludedInWorkingTime(boolean isIncludedInTotalWorkingTime)
      Description copied from interface: IResource
      Sets whether the 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.

      Specified by:
      setReductionTimeIsIncludedInWorkingTime in interface IResource
      Parameters:
      isIncludedInTotalWorkingTime - the boolean whether reduction time is included in the WorkingHours
    • setMaxRouteStartReductionTime

      public boolean setMaxRouteStartReductionTime(Duration maxRouteStartReductionTime, boolean isOnlyUsedForDriving)
      Description copied from interface: IResource
      Sets the maximum time which the 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)

      Specified by:
      setMaxRouteStartReductionTime in interface IResource
      Parameters:
      maxRouteStartReductionTime - the duration time the resource has to drive to work on its own time
      isOnlyUsedForDriving - 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: IResource
      Sets the 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).

      Specified by:
      setMaxRouteStartReductionTimePillar in interface IResource
      Parameters:
      maxRouteStartReductionTime - the duration time the resource has to drive to work on its own time
      isOnlyUsedForDriving - if the route start reduction time can only be used for driving
      Returns:
      false if reductionTime is null or negative
    • isReductionTimeOnlyUsedForDriving

      public Optional<Boolean> isReductionTimeOnlyUsedForDriving()
      Description copied from interface: IResource
      Checks whether the potentially set 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).

      Specified by:
      isReductionTimeOnlyUsedForDriving in interface IResource
      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

      public Optional<Boolean> isReductionTimeIncludedInWorkingTime()
      Description copied from interface: IResource
      Checks whether the 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).

      Specified by:
      isReductionTimeIncludedInWorkingTime in interface IResource
      Returns:
      the optional with the boolean or an empty optional if no reduction time has been set
    • getMaxRouteStartReductionTimeMillis

      public Optional<Long> getMaxRouteStartReductionTimeMillis()
      Description copied from interface: IResource
      Gets the maximum time which the 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).

      Specified by:
      getMaxRouteStartReductionTimeMillis in interface IResource
      Returns:
      the optional Long milliseconds of the routestart reduction time
    • isReductionTimeOnlyUsedForDrivingPillar

      public Optional<Boolean> isReductionTimeOnlyUsedForDrivingPillar()
      Description copied from interface: IResource
      Checks if a 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).

      Specified by:
      isReductionTimeOnlyUsedForDrivingPillar in interface IResource
      Returns:
      the optional boolean whether reduction time for pillars has been set
    • getMaxRouteStartReductionTimeMillisPillar

      public Optional<Long> getMaxRouteStartReductionTimeMillisPillar()
      Description copied from interface: IResource
      Gets the 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).

      Specified by:
      getMaxRouteStartReductionTimeMillisPillar in interface IResource
      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: IResource
      Sets the amount of time that the 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)

      Specified by:
      setMaxFreePostWorkDrivingTerminationTime in interface IResource
      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: IResource
      Sets the local max free post work driving termination time. If onlyApplyOnOvertime is true, the post driving time is only utilized if the route shows overtime. Moreover, the maximal utilized time is the overtime itself (or, if lower, the postWorkingHourTimeReductionTime).
      Specified by:
      setMaxFreePostWorkDrivingTerminationTime in interface IResource
      Parameters:
      postTimeReductionTime - the non penalized driving home on own time duration
      onlyApplyOnOvertime - the only apply on overtime
    • isOnlyApplyFreePostWorkDrivingOnOvertime

      public Optional<Boolean> isOnlyApplyFreePostWorkDrivingOnOvertime()
      Specified by:
      isOnlyApplyFreePostWorkDrivingOnOvertime in interface IResource
    • getMaxFreePostWorkDrivingTerminationTimeMillis

      public Optional<Long> getMaxFreePostWorkDrivingTerminationTimeMillis()
      Description copied from interface: IResource
      Gets the amount of time in milliseconds that the Resource can be expected to drive home to its starting location in its free time.

      For more information please see IResource.setMaxFreePostWorkDrivingTerminationTime(Duration).

      Specified by:
      getMaxFreePostWorkDrivingTerminationTimeMillis in interface IResource
      Returns:
      the optional long milliseconds or an empty optional if no free post work driving termination time has been set
    • setMaxFlexPreWorkingHoursDrvingTime

      @Deprecated public boolean setMaxFlexPreWorkingHoursDrvingTime(Duration preWorkTime)
      Deprecated.
      Description copied from interface: IResource
      Deprecated method.
      Specified by:
      setMaxFlexPreWorkingHoursDrvingTime in interface IResource
      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: IResource
      Sets the 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).

      Specified by:
      setStaysOut in interface IResource
      Parameters:
      totalStaysOut - the int for maximum stays out
      staysOutInRow - the int for maximum stays out in row
      minRecoverHours - the int for minimum number of hours at base before new stay out is allowed
    • setStayOutCycleDefinition

      public void setStayOutCycleDefinition(Duration cycle, LocalDate cycleStart)
      Description copied from interface: IResource
      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. 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).

      Specified by:
      setStayOutCycleDefinition in interface IResource
      Parameters:
      cycle - the duration of the cycle
      cycleStart - the localDate day of the cycle start
    • getMaxTotalStaysOut

      public int getMaxTotalStaysOut()
      Description copied from interface: IResource
      Gets the 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.
      Specified by:
      getMaxTotalStaysOut in interface IResource
      Returns:
      the int totalStaysOut
    • getMaxStaysOutInRow

      public int getMaxStaysOutInRow()
      Description copied from interface: IResource
      Gets maximum number of 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.
      Specified by:
      getMaxStaysOutInRow in interface IResource
      Returns:
      the int staysOutInRow
    • getMinRecoverHours

      public int getMinRecoverHours()
      Description copied from interface: IResource
      Gets the number of defined working hours (often days) between two 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.
      Specified by:
      getMinRecoverHours in interface IResource
      Returns:
      the int minRecoverHours
    • getStayOutCycle

      public Optional<Duration> getStayOutCycle()
      Description copied from interface: IResource
      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. 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.

      Specified by:
      getStayOutCycle in interface IResource
      Returns:
      the stay out cycle or an empty Optional if no stay out cycle has been defined
    • getStayOutCycleStart

      public Optional<LocalDate> getStayOutCycleStart()
      Description copied from interface: IResource
      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. 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.

      Specified by:
      getStayOutCycleStart in interface IResource
      Returns:
      the start of the cycle or an empty Optional if no stay out cycle has been defined
    • setStayOutPolicyActive

      @Deprecated public void setStayOutPolicyActive(boolean stayOutPolicyActive)
      Deprecated.
      Description copied from interface: IResource
      Specified by:
      setStayOutPolicyActive in interface IResource
      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: IResource
      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.
      Specified by:
      setStayOutPolicyReturnTimeActive in interface IResource
      Parameters:
      stayOutPolicyReturnTimeActive - the boolean whether the return time threshold is active
      See Also:
    • isStayOutPolicyReturnTimeActive

      public boolean isStayOutPolicyReturnTimeActive()
      Description copied from interface: IResource
      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.
      Specified by:
      isStayOutPolicyReturnTimeActive in interface IResource
      Returns:
      the boolean whether the return time threshold is active
      See Also:
    • setStayOutPolicyReturnDistanceActive

      public void setStayOutPolicyReturnDistanceActive(boolean stayOutPolicyReturnDistanceActive)
      Description copied from interface: IResource
      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.
      Specified by:
      setStayOutPolicyReturnDistanceActive in interface IResource
      Parameters:
      stayOutPolicyReturnDistanceActive - the boolean whether the return distance threshold is active
      See Also:
    • isStayOutPolicyReturnDistanceActive

      public boolean isStayOutPolicyReturnDistanceActive()
      Description copied from interface: IResource
      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.
      Specified by:
      isStayOutPolicyReturnDistanceActive in interface IResource
      Returns:
      the boolean whether the return distance threshold is active
      See Also:
    • setStayOutPolicy

      @Deprecated public void setStayOutPolicy(double minDistanceMeter, double minTimeSeconds)
      Deprecated.
      Description copied from interface: IResource
      Deprecated method.

      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.

      Specified by:
      setStayOutPolicy in interface IResource
      Parameters:
      minDistanceMeter - the double distance threshold to be set in meter
      minTimeSeconds - 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: IResource
      Sets the minimal distance and time the 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.
      Specified by:
      setStayOutPolicy in interface IResource
      Parameters:
      minDistanceForStayOut - the Quantity<Length> minimal distance from the starting location
      minTimeForStayOut - the duration it would take to reach the starting location
    • setStayOutPolicyReturnTime

      public void setStayOutPolicyReturnTime(Duration minTimeForStayOut)
      Description copied from interface: IResource
      Sets the minimal time a 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.
      Specified by:
      setStayOutPolicyReturnTime in interface IResource
      Parameters:
      minTimeForStayOut - the duration threshold within which the Resource is not allowed to use an overnight stay
      See Also:
    • getStayOutPolicyReturnTime

      public Duration getStayOutPolicyReturnTime()
      Description copied from interface: IResource
      Gets the time threshold that needs to be surpassed in order to be able to use an overnight stay as Duration.
      Specified by:
      getStayOutPolicyReturnTime in interface IResource
      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: IResource
      Sets the minimal distance a 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.
      Specified by:
      setStayOutPolicyReturnDistance in interface IResource
      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: IResource
      Gets the distance threshold that needs to be surpassed in order to be able to use an overnight stay as Quantity Length.
      Specified by:
      getStayOutPolicyReturnDistance in interface IResource
      Returns:
      the quantity length distance threshold
      See Also:
    • getStayOutPolicyMinDistance

      public double getStayOutPolicyMinDistance()
      Description copied from interface: IResource
      Gets the distance threshold to be able to use an overnight stay in meter.

      For more information please see IResource.setStayOutPolicy(Quantity, Duration).

      Specified by:
      getStayOutPolicyMinDistance in interface IResource
      Returns:
      the double distance threshold in meter
    • getStayOutPolicyMinTime

      public double getStayOutPolicyMinTime()
      Description copied from interface: IResource
      Gets the return time threshold that needs to be surpassed to be able to use an overnight stay in seconds.

      For more information please see IResource.setStayOutPolicy(Quantity, Duration).

      Specified by:
      getStayOutPolicyMinTime in interface IResource
      Returns:
      the double return time threshold in seconds
    • getConnectionTimeEfficiencyFactor

      public double getConnectionTimeEfficiencyFactor()
      Description copied from interface: IResource
      Sets the 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.

      Specified by:
      getConnectionTimeEfficiencyFactor in interface IResource
      Returns:
      the double getConnectionTimeEfficiencyFactor
    • setConnectionTimeEfficiencyFactor

      public void setConnectionTimeEfficiencyFactor(double connectionTimeEfficiencyFactor)
      Description copied from interface: IResource
      Sets connectionTimeEfficiencyFactor, the default value is 1.0. The input must be >= 0, otherwise an IllegalStateException is thrown.
      Specified by:
      setConnectionTimeEfficiencyFactor in interface IResource
      Parameters:
      connectionTimeEfficiencyFactor - double to be set
    • addCapacity

      @Deprecated public void addCapacity(double capacity)
      Deprecated.
      Description copied from interface: IResource
      Adds the capacity.
      Specified by:
      addCapacity in interface IResource
      Parameters:
      capacity - the double capacity to be added
    • setCapacity

      public void setCapacity(double[] capacity)
      Description copied from interface: IResource
      Sets the amount a Resource can carry of a specific good.

      Several goods can be defined of which each a limited amount can be carried.

      Specified by:
      setCapacity in interface IResource
      Parameters:
      capacity - the new capacity
    • getCapacity

      public double[] getCapacity()
      Description copied from interface: IResource
      Gets the capacity of goods a Resource can carry.

      For more information please see IResource.addCapacity(double).

      Specified by:
      getCapacity in interface IResource
      Returns:
      the double value of every member of capacity
    • setCapacity

      public void setCapacity(double[] capacity, double[] minDegratedCapacity, double[] capacityDegPerStop)
      Description copied from interface: IResource
      Sets the capacity.
      Specified by:
      setCapacity in interface IResource
      Parameters:
      capacity - the capacity
      minDegratedCapacity - the min degrated capacity
      capacityDegPerStop - the capacity deg per stop
    • setMinimalDegratedCapacity

      public void setMinimalDegratedCapacity(double[] minDegratedCapacity)
      Description copied from interface: IResource
      Sets the minimal degrated capacity.
      Specified by:
      setMinimalDegratedCapacity in interface IResource
      Parameters:
      minDegratedCapacity - the new minimal degrated capacity
    • getMinimalDegratedCapacity

      public double[] getMinimalDegratedCapacity()
      Description copied from interface: IResource
      Gets the minimal degrated capacity.
      Specified by:
      getMinimalDegratedCapacity in interface IResource
      Returns:
      the minimal degrated capacity
    • setCapacityDegradationPerStop

      public void setCapacityDegradationPerStop(double[] capacityDegPerStop)
      Description copied from interface: IResource
      Sets the capacity degradation per stop.
      Specified by:
      setCapacityDegradationPerStop in interface IResource
      Parameters:
      capacityDegPerStop - the new capacity degradation per stop
    • getCapacityDegradationPerStop

      public double[] getCapacityDegradationPerStop()
      Description copied from interface: IResource
      Gets the capacity degradation per stop.
      Specified by:
      getCapacityDegradationPerStop in interface IResource
      Returns:
      the capacity degradation per stop
    • setInitialLoad

      public void setInitialLoad(double[] initialLoad)
      Description copied from interface: IResource
      Sets the the amount of a good that is already being carried by the Resource.

      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:
      setInitialLoad in interface IResource
      Parameters:
      initialLoad - the double List initialLoad
    • getInitialLoad

      public double[] getInitialLoad()
      Description copied from interface: IResource
      Gets the amount of a good that is already being carried by the Resource.

      For more information please see IResource.addCapacity(double).

      Specified by:
      getInitialLoad in interface IResource
      Returns:
      the double List initialLoad
    • addConstraint

      public void addConstraint(IResourceLevelConstraint constraint)
      Description copied from interface: IResource
      Adds an IConstraint to the Resource so it can only give service to the Nodes that have the appropriate IQualification.

      Used by UKPostCode.

      Specified by:
      addConstraint in interface IResource
      Parameters:
      constraint - the iResourceLevelConstraint to which it will be limited
    • getConstraints

      public List<IResourceLevelConstraint> getConstraints()
      Description copied from interface: IResource
      Gets the IConstraint from the Resource that it is limited to.

      For more information please see IResource.addConstraint(IResourceLevelConstraint).

      Specified by:
      getConstraints in interface IResource
      Returns:
      the constraint of the resource
    • setMaxDrivingDistanceFirstNode

      public void setMaxDrivingDistanceFirstNode(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance)
      Description copied from interface: IResource
      Sets the maximal distance that the Resource needs to drive to the first Node.
      Specified by:
      setMaxDrivingDistanceFirstNode in interface IResource
      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: IResource
      Gets the maximal distance that the Resource needs to drive to the first Node.
      Specified by:
      getMaxDrivingDistanceFirstNode in interface IResource
      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: IResource
      Sets the maximal distance that the Resource needs to drive to the last Node.
      Specified by:
      setMaxDrivingDistanceLastNode in interface IResource
      Parameters:
      maxDistance - the quantity length maximal distance
    • getMaxDrivingDistanceLastNode

      public Optional<javax.measure.Quantity<javax.measure.quantity.Length>> getMaxDrivingDistanceLastNode()
      Description copied from interface: IResource
      Gets the maximal distance that the Resource needs to drive to the last Node.
      Specified by:
      getMaxDrivingDistanceLastNode in interface IResource
      Returns:
      the optional quantity length distance or an empty optional
      See Also:
    • setMaxDrivingTimeFirstNode

      public void setMaxDrivingTimeFirstNode(Duration maxTime)
      Description copied from interface: IResource
      Sets the maximal driving time that the Resource is supposed to drive to the first Node.
      Specified by:
      setMaxDrivingTimeFirstNode in interface IResource
      Parameters:
      maxTime - the duration maximal time
    • getMaxDrivingTimeFirstNode

      public Optional<Duration> getMaxDrivingTimeFirstNode()
      Description copied from interface: IResource
      Gets the maximal driving time that the Resource is supposed to drive to the first Node.
      Specified by:
      getMaxDrivingTimeFirstNode in interface IResource
      Returns:
      the optional duration or an empty optional if no value has been set
      See Also:
    • setMaxDrivingTimeLastNode

      public void setMaxDrivingTimeLastNode(Duration maxTime)
      Description copied from interface: IResource
      Sets the maximal driving time that the Resource is supposed to drive to the last Node.
      Specified by:
      setMaxDrivingTimeLastNode in interface IResource
      Parameters:
      maxTime - the duration maximal time
    • getMaxDrivingTimeLastNode

      public Optional<Duration> getMaxDrivingTimeLastNode()
      Description copied from interface: IResource
      Gets the maximal driving time that the Resource is supposed to drive to the last Node.
      Specified by:
      getMaxDrivingTimeLastNode in interface IResource
      Returns:
      the optional duration or an empty optional if no value has been set
      See Also:
    • setResourceDepot

      public void setResourceDepot(IResourceDepot depot)
      Description copied from interface: IResource
      Sets the resource depot.
      Specified by:
      setResourceDepot in interface IResource
      Parameters:
      depot - the new resource depot
    • getResourceDepot

      public Optional<IResourceDepot> getResourceDepot()
      Description copied from interface: IResource
      Gets the resource depot.
      Specified by:
      getResourceDepot in interface IResource
      Returns:
      the resource depot
    • getOverallVisitDurationEfficiencyFactor

      public double getOverallVisitDurationEfficiencyFactor()
      Description copied from interface: IResource
      Gets the overall visit duration efficiency factor.
      Specified by:
      getOverallVisitDurationEfficiencyFactor in interface IResource
      Returns:
      the overall visit duration efficiency factor
    • setOverallVisitDurationEfficiencyFactor

      public boolean setOverallVisitDurationEfficiencyFactor(double factor)
      Description copied from interface: IResource
      Sets the overall visit duration efficiency factor.
      Specified by:
      setOverallVisitDurationEfficiencyFactor in interface IResource
      Parameters:
      factor - the factor
      Returns:
      true, if successful
    • setAverageCO2EmissionFactor

      public void setAverageCO2EmissionFactor(double emissionFactor)
      Description copied from interface: IResource
      Sets 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:
      setAverageCO2EmissionFactor in interface IResource
      Parameters:
      emissionFactor - the new average CO2 emission factor
    • getAverageCO2EmissionFactor

      public double getAverageCO2EmissionFactor()
      Description copied from interface: IResource
      Gets 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:
      getAverageCO2EmissionFactor in interface IResource
      Returns:
      the average CO2 emission factor