Interface IResource

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

public interface IResource extends IBasicResource, IOptimizationElement
The resources are required to execute a schedule as returned by the IOptimization. A resource can be a vehicle, an employee or an abstract working unit. A resource has different attributes like timely availability, skills and capacity.

Implementation example:


 // Define the working hours
 List<IWorkingHours> workingHours = new ArrayList<IWorkingHours>();

    workingHours.add(
        new WorkingHours(
            ZonedDateTime.of(2020, MAY.getValue(), 6, 8, 0, 0, 0, ZoneId.of("Europe/Berlin")),
            ZonedDateTime.of(2020, MAY.getValue(), 6, 17, 0, 0, 0, ZoneId.of("Europe/Berlin"))));

    Duration maxWorkingTime = Duration.ofHours(13);

    Quantity<Length> maxDistanceKmW = Quantities.getQuantity(1200.0, KILO(METRE));

 // Define the resource
    CapacityResource rep1 =
        new CapacityResource("Jack", 50.775346, 6.083887, maxWorkingTime, maxDistanceKmW, workingHours);

    rep1.setCost(0, 1, 1);

 // Adding a (optional) qualification to the resource:
    IQualification typeQualification = new TypeQualification();
    ((TypeQualification) typeQualification).addType("plumbing");
    rep1.addQualification(typeQualification);

    this.addElement(rep1);

 
Since:
30/09/2018
Version:
13/08/2019
Author:
DNA
  • Method Details

    • getCapacity

      double[] getCapacity()
      Gets the capacity of goods a Resource can carry.

      For more information please see addCapacity(double).

      Returns:
      the double value of every member of capacity
    • addCapacity

      void addCapacity(double capacity)
      Deprecated.
      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.

      Adds the capacity.
      Parameters:
      capacity - the double capacity to be added
    • setInitialLoad

      void setInitialLoad(double[] initialLoad)
      Sets the the amount of a good that is already being carried by the Resource.

      For more information please see addCapacity(double). If no capacity is defined, it is assumed, the initial load equals the maximal capacity.

      Parameters:
      initialLoad - the double List initialLoad
    • setCapacity

      void setCapacity(double[] capacity)
      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.

      Parameters:
      capacity - the new capacity
    • setCapacity

      void setCapacity(double[] capacity, double[] minDegratedCapacity, double[] capacityDegPerStop)
      Sets the capacity.
      Parameters:
      capacity - the capacity
      minDegratedCapacity - the min degrated capacity
      capacityDegPerStop - the capacity deg per stop
    • getInitialLoad

      double[] getInitialLoad()
      Gets the amount of a good that is already being carried by the Resource.

      For more information please see addCapacity(double).

      Returns:
      the double List initialLoad
    • getMaxTotalStaysOut

      int getMaxTotalStaysOut()
      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.
      Returns:
      the int totalStaysOut
    • getMaxStaysOutInRow

      int getMaxStaysOutInRow()
      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.
      Returns:
      the int staysOutInRow
    • getMinRecoverHours

      int getMinRecoverHours()
      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.
      Returns:
      the int minRecoverHours
    • getStayOutCycle

      Optional<Duration> getStayOutCycle()
      Gets the stay out cycle within which the maximum number of overnight stays are allowed and within which the the minimum recovery time (days without overnight stays) has to be observed. 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.

      Returns:
      the stay out cycle or an empty Optional if no stay out cycle has been defined
    • getStayOutCycleStart

      Optional<LocalDate> getStayOutCycleStart()
      Gets the starting day of the stay out cycle within which the maximum number of overnight stays are allowed and within which the the minimum recovery time (days without overnight stays) has to be observed. 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.

      Returns:
      the start of the cycle or an empty Optional if no stay out cycle has been defined
    • setStayOutPolicy

      void setStayOutPolicy(javax.measure.Quantity<javax.measure.quantity.Length> minDistanceForStayOut, Duration minTimeForStayOut)
      Sets the minimal distance and time the Resource needs to be away from its starting location to be able to a overnight stay. 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.
      Parameters:
      minDistanceForStayOut - the Quantity<Length> minimal distance from the starting location
      minTimeForStayOut - the duration it would take to reach the starting location
    • setStayOutPolicyReturnTimeActive

      void setStayOutPolicyReturnTimeActive(boolean stayOutPolicyReturnTimeActive)
      Sets whether the Resource needs to take longer to return to her starting location than the set threshold to be able to use an overnight stay.
      Parameters:
      stayOutPolicyReturnTimeActive - the boolean whether the return time threshold is active
      See Also:
    • setStayOutPolicyReturnDistanceActive

      void setStayOutPolicyReturnDistanceActive(boolean stayOutPolicyReturnDistanceActive)
      Sets whether the Resource needs to be further away from its starting location than the set threshold to be able to use an overnight stay.
      Parameters:
      stayOutPolicyReturnDistanceActive - the boolean whether the return distance threshold is active
      See Also:
    • isStayOutPolicyReturnTimeActive

      boolean isStayOutPolicyReturnTimeActive()
      Checks whether the Resource needs to take longer to return to her starting location than the set threshold to be able to use an overnight stay.
      Returns:
      the boolean whether the return time threshold is active
      See Also:
    • isStayOutPolicyReturnDistanceActive

      boolean isStayOutPolicyReturnDistanceActive()
      Checks whether the Resource needs to be further away from its starting location than the set threshold to be able to use an overnight stay.
      Returns:
      the boolean whether the return distance threshold is active
      See Also:
    • setStayOutPolicyReturnTime

      void setStayOutPolicyReturnTime(Duration minTimeForStayOut)
      Sets the minimal time a Resource would need to return to her starting location to be able to use an overnight stay. If this threshold is not surpassed the Resource has to return home and start from there the next day.
      Parameters:
      minTimeForStayOut - the duration threshold within which the Resource is not allowed to use an overnight stay
      See Also:
    • setStayOutPolicyReturnDistance

      void setStayOutPolicyReturnDistance(javax.measure.Quantity<javax.measure.quantity.Length> minDistanceForStayOut)
      Sets the minimal distance a Resource needs to be away from his starting location in order to be able to use an overnight stay. If this threshold is not surpassed the Resource has to return home and start from there the next day.
      Parameters:
      minDistanceForStayOut - the quantity length threshold for an overnight stay
      See Also:
    • getConnectionTimeEfficiencyFactor

      double getConnectionTimeEfficiencyFactor()
      Sets the CapacityResource.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.

      Returns:
      the double getConnectionTimeEfficiencyFactor
    • setConnectionTimeEfficiencyFactor

      void setConnectionTimeEfficiencyFactor(double connectionTimeEfficiencyFactor)
      Sets connectionTimeEfficiencyFactor, the default value is 1.0. The input must be >= 0, otherwise an IllegalStateException is thrown.
      Parameters:
      connectionTimeEfficiencyFactor - double to be set
    • setMaxFlexPreWorkingHoursDrvingTime

      @Deprecated boolean setMaxFlexPreWorkingHoursDrvingTime(Duration preWorkTime)
      Deprecated.
      Deprecated method.
      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
    • getMaxRouteStartReductionTimeMillis

      Optional<Long> getMaxRouteStartReductionTimeMillis()
      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 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).

      Returns:
      the optional Long milliseconds of the routestart reduction time
    • isReductionTimeIncludedInWorkingTime

      Optional<Boolean> isReductionTimeIncludedInWorkingTime()
      Checks whether the route start reduction time is included in the WorkingHours. The default value is false. If false and 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 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).

      Returns:
      the optional with the boolean or an empty optional if no reduction time has been set
    • isReductionTimeOnlyUsedForDriving

      Optional<Boolean> isReductionTimeOnlyUsedForDriving()
      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 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).

      Returns:
      the optional boolean if the time can only be used for driving, returns an empty optional if no reduction time has been set
    • getMaxRouteStartReductionTimeMillisPillar

      Optional<Long> getMaxRouteStartReductionTimeMillisPillar()
      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 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).

      Returns:
      the optional long milliseconds, returns an empty optional if no reduction time has been set
    • isReductionTimeOnlyUsedForDrivingPillar

      Optional<Boolean> isReductionTimeOnlyUsedForDrivingPillar()
      Checks if a route start reduction time for IPillarNode has been set.

      For more information please see setMaxRouteStartReductionTimePillar(Duration, boolean). For a method that only affects a specific set of WorkingHours please see IWorkingHours.setLocalMaxRouteStartReductionTimePillar(Duration, boolean).

      Returns:
      the optional boolean whether reduction time for pillars has been set
    • setMaxRouteStartReductionTime

      boolean setMaxRouteStartReductionTime(Duration maxRouteStartReductionTime, boolean isOnlyUsedForDriving)
      Sets the maximum time which the Resource can be expected to drive to the first Node in its private time.

      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)

      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

      boolean setMaxRouteStartReductionTimePillar(Duration maxRouteStartReductionTime, boolean isOnlyUsedForDriving)
      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 setMaxRouteStartReductionTime(Duration, boolean).

      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
    • setReductionTimeIsIncludedInWorkingTime

      void setReductionTimeIsIncludedInWorkingTime(boolean isIncludedInTotalWorkingTime)
      Sets whether the route start reduction time is included in the WorkingHours. The default value is false. If false and 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.

      Parameters:
      isIncludedInTotalWorkingTime - the boolean whether reduction time is included in the WorkingHours
    • setMaxPillarAfterHoursTime

      boolean setMaxPillarAfterHoursTime(Duration maxPillarEndOverTime)
      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).

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

      Optional<Long> getMaxPillarAfterHoursTime()
      Gets the maximal pillar after hours time in milliseconds.

      For more information please see setMaxPillarAfterHoursTime(Duration).

      Returns:
      the optional long pillar after hours time
    • setStaysOut

      void setStaysOut(int totalStays, int staysInRow, int minRecoverHours)
      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 setStayOutCycleDefinition(Duration, LocalDate). For the local method that only affects specific WorkingHours please see IWorkingHours.setLocalStayOutCycleDefinition(Duration, LocalDate).

      Parameters:
      totalStays - the int for maximum stays out
      staysInRow - 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

      void setStayOutCycleDefinition(Duration cycle, LocalDate cycleStart)
      Sets the Duration of the cycle within which the maximum number of overnight stays are allowed and within which the minimum recovery time (WorkingHours without overnight stays) has to be observed. 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).

      Parameters:
      cycle - the duration of the cycle
      cycleStart - the localDate day of the cycle start
    • setStayOutPolicyActive

      void setStayOutPolicyActive(boolean stayOutPolicyActive)
      Deprecated.
      please use the above mentioned methods instead
      Parameters:
      stayOutPolicyActive - the boolean whether the return distance and the return time threshold are active
    • setStayOutPolicy

      @Deprecated void setStayOutPolicy(double minDistanceMeter, double minTimeSeconds)
      Deprecated.
      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.

      Parameters:
      minDistanceMeter - the double distance threshold to be set in meter
      minTimeSeconds - the double time threshold to be set in seconds
    • getStayOutPolicyMinDistance

      double getStayOutPolicyMinDistance()
      Gets the distance threshold to be able to use an overnight stay in meter.

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

      Returns:
      the double distance threshold in meter
    • getStayOutPolicyMinTime

      double getStayOutPolicyMinTime()
      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 setStayOutPolicy(Quantity, Duration).

      Returns:
      the double return time threshold in seconds
    • getMaxFreePostWorkDrivingTerminationTimeMillis

      Optional<Long> getMaxFreePostWorkDrivingTerminationTimeMillis()
      Gets the amount of time in milliseconds that the Resource can be expected to drive home to its starting location in its free time.

      For more information please see setMaxFreePostWorkDrivingTerminationTime(Duration).

      Returns:
      the optional long milliseconds or an empty optional if no free post work driving termination time has been set
    • setMaxFreePostWorkDrivingTerminationTime

      void setMaxFreePostWorkDrivingTerminationTime(Duration nonPenalizedDrivingHomeOnOwnTimeDuration)
      Sets the amount of time that the Resource can be expected to drive home to its starting location in its free time.

      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)

      Parameters:
      nonPenalizedDrivingHomeOnOwnTimeDuration - the duration of the drive home that has to be done in the free time
    • setMaxFreePostWorkDrivingTerminationTime

      void setMaxFreePostWorkDrivingTerminationTime(Duration nonPenalizedDrivingHomeOnOwnTimeDuration, boolean onlyApplyOnOvertime)
      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).
      Parameters:
      nonPenalizedDrivingHomeOnOwnTimeDuration - the non penalized driving home on own time duration
      onlyApplyOnOvertime - the only apply on overtime
    • isOnlyApplyFreePostWorkDrivingOnOvertime

      Optional<Boolean> isOnlyApplyFreePostWorkDrivingOnOvertime()
    • getStayOutPolicyReturnTime

      Duration getStayOutPolicyReturnTime()
      Gets the time threshold that needs to be surpassed in order to be able to use an overnight stay as Duration.
      Returns:
      the duration of the time threshold
      See Also:
    • getStayOutPolicyReturnDistance

      javax.measure.Quantity<javax.measure.quantity.Length> getStayOutPolicyReturnDistance()
      Gets the distance threshold that needs to be surpassed in order to be able to use an overnight stay as Quantity Length.
      Returns:
      the quantity length distance threshold
      See Also:
    • addConstraint

      void addConstraint(IResourceLevelConstraint constraint)
      Adds an IConstraint to the Resource so it can only give service to the Nodes that have the appropriate IQualification.

      Used by UKPostCode.

      Parameters:
      constraint - the iResourceLevelConstraint to which it will be limited
    • getConstraints

      List<IResourceLevelConstraint> getConstraints()
      Gets the IConstraint from the Resource that it is limited to.

      For more information please see addConstraint(IResourceLevelConstraint).

      Returns:
      the constraint of the resource
    • setMaxDrivingDistanceFirstNode

      void setMaxDrivingDistanceFirstNode(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance)
      Sets the maximal distance that the Resource needs to drive to the first Node.
      Parameters:
      maxDistance - the quantity length maximal distance to the first Node
    • getMaxDrivingDistanceFirstNode

      Optional<javax.measure.Quantity<javax.measure.quantity.Length>> getMaxDrivingDistanceFirstNode()
      Gets the maximal distance that the Resource needs to drive to the first Node.
      Returns:
      the optional quantity length of the distance, an empty optional if no value has been set
      See Also:
    • setMaxDrivingDistanceLastNode

      void setMaxDrivingDistanceLastNode(javax.measure.Quantity<javax.measure.quantity.Length> maxDistance)
      Sets the maximal distance that the Resource needs to drive to the last Node.
      Parameters:
      maxDistance - the quantity length maximal distance
    • getMaxDrivingDistanceLastNode

      Optional<javax.measure.Quantity<javax.measure.quantity.Length>> getMaxDrivingDistanceLastNode()
      Gets the maximal distance that the Resource needs to drive to the last Node.
      Returns:
      the optional quantity length distance or an empty optional
      See Also:
    • setMaxDrivingTimeFirstNode

      void setMaxDrivingTimeFirstNode(Duration maxTime)
      Sets the maximal driving time that the Resource is supposed to drive to the first Node.
      Parameters:
      maxTime - the duration maximal time
    • getMaxDrivingTimeFirstNode

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

      void setMaxDrivingTimeLastNode(Duration maxTime)
      Sets the maximal driving time that the Resource is supposed to drive to the last Node.
      Parameters:
      maxTime - the duration maximal time
    • getMaxDrivingTimeLastNode

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

      void setResourceDepot(IResourceDepot depot)
      Sets the resource depot.
      Parameters:
      depot - the new resource depot
    • getResourceDepot

      Optional<IResourceDepot> getResourceDepot()
      Gets the resource depot.
      Returns:
      the resource depot
    • getOverallVisitDurationEfficiencyFactor

      double getOverallVisitDurationEfficiencyFactor()
      Gets the overall visit duration efficiency factor.
      Returns:
      the overall visit duration efficiency factor
    • setOverallVisitDurationEfficiencyFactor

      boolean setOverallVisitDurationEfficiencyFactor(double factor)
      Sets the overall visit duration efficiency factor.
      Parameters:
      factor - the factor
      Returns:
      true, if successful
    • getMinimalDegratedCapacity

      double[] getMinimalDegratedCapacity()
      Gets the minimal degrated capacity.
      Returns:
      the minimal degrated capacity
    • getCapacityDegradationPerStop

      double[] getCapacityDegradationPerStop()
      Gets the capacity degradation per stop.
      Returns:
      the capacity degradation per stop
    • setMinimalDegratedCapacity

      void setMinimalDegratedCapacity(double[] minDegratedCapacity)
      Sets the minimal degrated capacity.
      Parameters:
      minDegratedCapacity - the new minimal degrated capacity
    • setCapacityDegradationPerStop

      void setCapacityDegradationPerStop(double[] capacityDegPerStop)
      Sets the capacity degradation per stop.
      Parameters:
      capacityDegPerStop - the new capacity degradation per stop
    • setAverageCO2EmissionFactor

      void setAverageCO2EmissionFactor(double emissionFactor)
      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.
      Parameters:
      emissionFactor - the new average CO2 emission factor
    • getAverageCO2EmissionFactor

      double getAverageCO2EmissionFactor()
      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.
      Returns:
      the average CO2 emission factor