Class InsertionData

java.lang.Object
com.graphhopper.jsprit.core.algorithm.recreate.InsertionData
Direct Known Subclasses:
InsertionData.NoInsertionFound

public class InsertionData extends Object
Data object that collects insertion information. It collects insertionCosts, insertionIndeces, vehicle and driver to be employed and departureTime of vehicle at vehicle's start location (e.g. depot).
Author:
stefan
  • Field Details

    • NO_INDEX

      public static int NO_INDEX
  • Constructor Details

    • InsertionData

      public InsertionData(double insertionCost, int pickupInsertionIndex, int deliveryInsertionIndex, Vehicle vehicle, Driver driver)
  • Method Details

    • isFound

      public boolean isFound()
      Returns true if this represents a valid insertion, false if no insertion was found. Use this instead of instanceof NoInsertionFound checks.
      Returns:
      true if insertion is valid, false otherwise
    • createEmptyInsertionData

      public static InsertionData createEmptyInsertionData()
      Returns an instance of InsertionData that represents an EmptyInsertionData (which might indicate that no insertion has been found). It is internally instantiated as follows:
      new InsertionData(Double.MAX_VALUE, NO_INDEX, NO_INDEX, null, null);
      where NO_INDEX=-1.
      Returns:
    • getAdditionalTime

      public double getAdditionalTime()
      Returns:
      the additionalTime
    • addFailedConstrainName

      public void addFailedConstrainName(String name)
    • getFailedConstraintNames

      public List<String> getFailedConstraintNames()
    • setAdditionalTime

      public void setAdditionalTime(double additionalTime)
      Parameters:
      additionalTime - the additionalTime to set
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getDeliveryInsertionIndex

      public int getDeliveryInsertionIndex()
      Returns insertionIndex of deliveryActivity. If no insertionPosition is found, it returns NO_INDEX (=-1).
      Returns:
    • getPickupInsertionIndex

      public int getPickupInsertionIndex()
      Returns insertionIndex of pickkupActivity. If no insertionPosition is found, it returns NO_INDEX (=-1).
      Returns:
    • getInsertionCost

      public double getInsertionCost()
      Returns insertion costs (which might be the additional costs of inserting the corresponding job).
      Returns:
    • getSelectedVehicle

      public Vehicle getSelectedVehicle()
      Returns the vehicle to be employed.
      Returns:
    • getSelectedDriver

      public Driver getSelectedDriver()
      Returns the vehicle to be employed.
      Returns:
    • getVehicleDepartureTime

      public double getVehicleDepartureTime()
      Returns:
      the departureTime
    • setVehicleDepartureTime

      public void setVehicleDepartureTime(double departureTime)
      Parameters:
      departureTime - the departureTime to set
    • getCostBreakdown

      public InsertionCostBreakdown getCostBreakdown()
      Get the cost breakdown showing contribution from each component.
      Returns:
      the cost breakdown, or null if not captured
    • setCostBreakdown

      public void setCostBreakdown(InsertionCostBreakdown costBreakdown)
      Set the cost breakdown.
      Parameters:
      costBreakdown - the breakdown to set