Interface IBasicResource

All Superinterfaces:
Comparable<IBasicResource>, IOptimizationElement, Serializable
All Known Subinterfaces:
IResource
All Known Implementing Classes:
AbstractBasicCapacityResource, CapacityResource

public interface IBasicResource extends IOptimizationElement, Comparable<IBasicResource>
This interface provides the basic methods to set and get the appropriate parameters for the IResource like average speed, setting an alternate destination, setting acceptable overtime etc.
Since:
03/09/2019
Version:
23/09/2019
Author:
DNA
  • Method Details

    • setMaxHours

      @Deprecated void setMaxHours(double maxHours)
      Deprecated.
      please use setMaxWorkingTime(Duration) instead
      Deprecated method

      Sets the double AbstractBasicCapacityResource.maxGlobalHours, the maximum hours a route [h] can take per day.

      Parameters:
      maxHours - the double maxGlobalHours to be set
    • setMaxWorkingTime

      void setMaxWorkingTime(Duration maxTime)
      Sets the maximum hours a IResource is allowed to work per day without throwing a Violation.
      Parameters:
      maxTime - the duration max time
    • getMaxHours

      double getMaxHours()
      Gets the double AbstractBasicCapacityResource.maxGlobalHours, the maximum hours a route [h] can take per day.
      Returns:
      the double maxGlobalHours
    • setMaxDistance

      void setMaxDistance(double maxDistance)
      Sets the max distance AbstractBasicCapacityResource.maxGlobalDistanceKilometer in [km] that a route can take.
      Parameters:
      maxDistance - the double to be set for maxGlobalDistanceKilometer
    • getMaxDistance

      double getMaxDistance()
      Gets the max distance AbstractBasicCapacityResource.maxGlobalDistanceKilometer in [km] that a route can take per day.
      Returns:
      the double maxGlobalDistanceKilometer [km] a route can take
    • setAvgSpeed

      void setAvgSpeed(double avgSpeed)
      Sets the avg speed AbstractBasicCapacityResource.avgSpeed, the default value is 22.0 m/s.
      Parameters:
      avgSpeed - the double average speed of the resource in m/s (applies if no time matrix is provided)
    • getAvgSpeed

      double getAvgSpeed()
      Gets the avg speed AbstractBasicCapacityResource.avgSpeed of which the default value is 22.0 m/s.
      Returns:
      the double average speed of the resource in m/s (applies if no time matrix is provided)
    • setCost

      void setCost(double fixCost, double perHourCost, double perKilometerCost)
      Sets three cost factors of the resource.

      The default values are:

      fixCost: 0.0

      perHourCost: 1.0

      perKilometerCost: 1.0

      Parameters:
      fixCost - the double for the fixCost
      perHourCost - the double cost per hour
      perKilometerCost - the double cost per kilometer
    • setSkillEfficiencyFactor

      @Deprecated void setSkillEfficiencyFactor(double factor)
      Deprecated.
      Sets the skill efficiency factor, which is multiplied with the service time at the Node. The default value is 1.0
      Parameters:
      factor - the double for the resource's efficiency factor
    • getSkillEfficiencyFactor

      @Deprecated double getSkillEfficiencyFactor()
      Deprecated.
      Gets the AbstractBasicCapacityResource.skillEfficiencyFactor, of which the default value is 1.0.
      Returns:
      the double skill efficiency factor
    • setDestinationLatitude

      void setDestinationLatitude(double destinationLatitude)
      Sets the latitude of an alternate destination (setAlternateDestination(boolean)) where the IResource will stop working. The Resource will have to travel back to its starting location outside of the IWorkingHours since it will start working there and not at the alternate destination.

      An application example would be a truck driver that has to park his truck in a garage outside of the city in the evening but has to start working withing the city the next morning. The drive from the garage in the evening and getting the truck from the garage to the starting location in the morning is not considered part of the WorkingHours.

      Implementation example:

      
       CapacityResource jackTheTruckDriver =
               new CapacityResource(
                   "Jack", 50.775346, 6.083887, maxWorkingTime, maxDistanceKmW, workingHours);
      
       // Defining the alternate destination where work will end
           rep1.setDestinationLatitude(51.45);
           rep1.setDestinationLongitude(7.01667);
           rep1.setAlternateDestination(true);
           rep1.setCost(0, 1, 1);
      
           this.addElement(jackTheTruckDriver);
       
      Parameters:
      destinationLatitude - the double for the alternate destination latitude
    • getDestinationLatitude

      double getDestinationLatitude()
      Gets the latitude of an alternate destination (setAlternateDestination(boolean)) where the IResource will stop working. The Resource will have to travel back to its starting location outside of the IWorkingHours since it will start working there and not at the alternate destination.

      An application example would be a truck driver that has to park his truck in a garage outside of the city in the evening but has to start working withing the city the next morning. The drive from the garage in the evening and getting the truck from the garage to the starting location in the morning is not considered part of the WorkingHours.

      Returns:
      the double for the alternate destination latitude
    • setDestinationLongitude

      void setDestinationLongitude(double destinationLongitude)
      Sets the longitude of an alternate destination (setAlternateDestination(boolean)) where the IResource will stop working. The Resource will have to travel back to its starting location outside of the IWorkingHours since it will start working there and not at the alternate destination.

      An application example would be a truck driver that has to park his truck in a garage outside of the city in the evening but has to start working withing the city the next morning. The drive from the garage in the evening and getting the truck from the garage to the starting location in the morning is not considered part of the WorkingHours.

      Implementation example:

      
       CapacityResource jackTheTruckDriver =
               new CapacityResource(
                   "Jack", 50.775346, 6.083887, maxWorkingTime, maxDistanceKmW, workingHours);
      
       // Defining the alternate destination where work will end
           rep1.setDestinationLatitude(51.45);
           rep1.setDestinationLongitude(7.01667);
           rep1.setAlternateDestination(true);
           rep1.setCost(0, 1, 1);
      
           this.addElement(jackTheTruckDriver);
       
      Parameters:
      destinationLongitude - the double for the alternate destination longitude
    • getDestinationLongitude

      double getDestinationLongitude()
      Gets the longitude of an alternate destination (setAlternateDestination(boolean)) where the IResource will stop working. The Resource will have to travel back to its starting location outside of the IWorkingHours since it will start working there and not at the alternate destination.

      An application example would be a truck driver that has to park his truck in a garage outside of the city in the evening but has to start working withing the city the next morning. The drive from the garage in the evening and getting the truck from the garage to the starting location in the morning is not considered part of the WorkingHours.

      Returns:
      the double for the alternate destination longitude
    • setAlternateDestination

      void setAlternateDestination(boolean hasAlternateDestination)
      Sets the AbstractBasicCapacityResource.hasAlternateDestination. When set to true the IResource has to stop working at this alternate destination. The Resource will have to travel back to its starting location outside of the IWorkingHours since it will start working there and not at the alternate destination.

      An application example would be a truck driver that has to park his truck in a garage outside of the city in the evening but has to start working withing the city the next morning. The drive from the garage in the evening and getting the truck from the garage to the starting location in the morning is not considered part of the WorkingHours.

      Implementation example:

      
       CapacityResource jackTheTruckDriver =
               new CapacityResource(
                   "Jack", 50.775346, 6.083887, maxWorkingTime, maxDistanceKmW, workingHours);
      
       // Defining the alternate destination where work will end
           rep1.setDestinationLatitude(51.45);
           rep1.setDestinationLongitude(7.01667);
           rep1.setAlternateDestination(true);
           rep1.setCost(0, 1, 1);
      
           this.addElement(jackTheTruckDriver);
       
      Parameters:
      hasAlternateDestination - the boolean hasAlternateDestination to be set
    • hasAlternateDestination

      boolean hasAlternateDestination()
      Gets the AbstractBasicCapacityResource.hasAlternateDestination. When set to true the IResource has to stop working at this alternate destination. The Resource will have to travel back to its starting location outside of the IWorkingHours since it will start working there and not at the alternate destination.

      An application example would be a truck driver that has to park his truck in a garage outside of the city in the evening but has to start working withing the city the next morning. The drive from the garage in the evening and getting the truck from the garage to the starting location in the morning is not considered part of the WorkingHours.

      Returns:
      the boolean hasAlternateDestination
    • setAcceptableOvertimeSeconds

      @Deprecated void setAcceptableOvertimeSeconds(double seconds)
      Deprecated.
      Deprecated method

      Sets the acceptable overtime in seconds. This does not necessarily mean that this is the maximal overtime. This is just an acceptable overtime that does not increase the total cost much. The default value is -1.

      Parameters:
      seconds - the double for new acceptable overtime seconds
    • setAcceptableOvertime

      void setAcceptableOvertime(Duration acceptableOvertime)
      Sets the acceptable overtime. When a Resource arrives in acceptable overtime a Violation will be thrown but the Node will not be filtered by a late Autofilter. Within acceptable overtime the costs are rising linearly, while outside of overtime they will rise exponentially.

      Arrival of the Resource within the acceptable overtime will not increase the total cost much.

      Parameters:
      acceptableOvertime - the Duration of acceptable overtime
    • getAcceptableOvertimeSeconds

      double getAcceptableOvertimeSeconds()
      Gets the acceptable overtime in seconds. This is just an acceptable overtime that does not increase the total cost much. When a Resource arrives in acceptable overtime a Violation will be thrown but the Node will not be filtered by a late Autofilter. Within acceptable overtime the costs are rising linearly, while outside of overtime they will rise exponentially.
      Returns:
      the double acceptableOvertimeSeconds
      See Also:
    • resetAcceptableOvertime

      void resetAcceptableOvertime()
      Resets the AbstractBasicCapacityResource.acceptableOvertimeSeconds to the default value of -1.0.
    • setStrictOvertimeLimit

      void setStrictOvertimeLimit(Duration strictOvertime)
      Sets the strict overtime limit. This value does only have an effect if the AutoFilter with ForceFiltering is used.
      Parameters:
      strictOvertime - the new strict overtime limit
    • getStrictOvertimeLimitSeconds

      double getStrictOvertimeLimitSeconds()
      Gets the strict overtime limit seconds.
      Returns:
      the strict overtime limit seconds
    • setAcceptableOverdistance

      void setAcceptableOverdistance(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance)
    • getAcceptableOverdistanceMeter

      double getAcceptableOverdistanceMeter()
      Gets the acceptable overdistance meter.
      Returns:
      the acceptable overdistance meter
    • setStrictOverdistanceLimit

      void setStrictOverdistanceLimit(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance)
      Sets the strict overdistance limit.
      Parameters:
      maxDistance - the new strict overdistance limit
    • getStrictOverdistanceLimitMeter

      double getStrictOverdistanceLimitMeter()
      Gets the strict overdistance limit meter.
      Returns:
      the strict overdistance limit meter
    • getPerKilometerCost

      double getPerKilometerCost()
      Gets AbstractBasicCapacityResource.perKilometerCost, the default value is 1.0.
      Returns:
      the double perKilometerCost
    • getPerHourCost

      double getPerHourCost()
      Gets AbstractBasicCapacityResource.perHourCost, the default value is 1.0.
      Returns:
      the double perHourCost
    • isEmptyAtEndOfRoute

      boolean isEmptyAtEndOfRoute()
      Checks AbstractBasicCapacityResource.emptyAtEndOfRoute.
      Returns:
      the boolean emptyAtEndOfRoute
    • setFixCost

      void setFixCost(double fixCost)
      Sets AbstractBasicCapacityResource.fixCost, the default value is 0.0.
      Parameters:
      fixCost - the double fixCost
    • getFixCost

      double getFixCost()
      Gets the AbstractBasicCapacityResource.fixCost, the default value is 0.0.
      Returns:
      the double fixCost
    • setPerHourCost

      void setPerHourCost(double perHourCost)
      Sets the AbstractBasicCapacityResource.perHourCost, the default value is 1.0.
      Parameters:
      perHourCost - the double perHourCost
    • setPerKilometerCost

      void setPerKilometerCost(double perKilometerCost)
      Sets the AbstractBasicCapacityResource.perKilometerCost, the default value is 1.0.
      Parameters:
      perKilometerCost - the double perKilometerCost
    • addQualification

      void addQualification(IQualification qualification)
      Puts the input in the HashMap AbstractBasicCapacityResource.qualifications, whereas the class is the key and the qualification is the value.

      A Qualification is a specific skill a Resource needs to have to give service to a Node that has a Constraint for that Qualification. Giving service to such a Node by a Resource without that Qualification will result in additional costs.

      Cannot be null.

      Parameters:
      qualification - the iQualification qualification
      See Also:
    • getQualifications

      Map<Class<? extends IQualification>,IQualification> getQualifications()
      Gets AbstractBasicCapacityResource.qualifications, whereas the class is the key and the qualification is the value.

      A Qualification is a specific skill a Resource needs to have to give service to a Node that has a Constraint for that Qualification. Giving service to such a Node by a Resource without that Qualification will result in additional costs.

      * Cannot be null.

      Returns:
      the hashmap qualifications
      See Also:
    • setFlexTime

      boolean setFlexTime(Duration flexTime)
      Sets the flexTime in seconds. The default is 0.
      Parameters:
      flexTime - the duration of the flexTimeSeconds to be set
      Returns:
      true, if successful
    • getFlexTimeMillis

      Optional<Long> getFlexTimeMillis()
    • getDestinationDistMatrixId

      int getDestinationDistMatrixId()
      Deprecated method Gets the AbstractBasicCapacityResource.distMatrixId, the default value is -1.
      Returns:
      the int distMatrixId
    • setMaxWorkingDistance

      void setMaxWorkingDistance(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance)
      Sets the maximal distance a IResource is allowed to travel per WorkingHour without throwing a IViolation.
      Parameters:
      maxDistance - the quantity length of the allowed max distance
    • setAvgSpeed

      void setAvgSpeed(javax.measure.Quantity<javax.measure.quantity.Speed> avgSpeed)
      Sets the average speed the IResource is allowed to take.
      Parameters:
      avgSpeed - the quantity speed average speed
    • getMaxWorkingDistance

      javax.measure.Quantity<javax.measure.quantity.Length> getMaxWorkingDistance()
      Gets the maximum distance a IResource is allowed to take without throwing a Violation per day.
      Returns:
      the quantity Length maximum distance
    • getMaxWorkingTime

      Duration getMaxWorkingTime()
      Gets the maximum time a IResource is allowed to be on a ILogicEntityRoute without throwing a Violation.
      Returns:
      the duration of the maximum working time
    • getAverageSpeed

      javax.measure.Quantity<javax.measure.quantity.Speed> getAverageSpeed()
      Gets the average speed a IResource is traveling with.
      Returns:
      the average speed
    • setDestinationPosition

      void setDestinationPosition(com.dna.jopt.config.types.Position destinationPosition)
    • getDestinationPosition

      com.dna.jopt.config.types.Position getDestinationPosition()
    • setPerHourProductionCost

      void setPerHourProductionCost(double perHourProductionCost)
    • getPerHourProductionCost

      double getPerHourProductionCost()