Class InsertionData
java.lang.Object
com.graphhopper.jsprit.core.algorithm.recreate.InsertionData
- Direct Known Subclasses:
InsertionData.NoInsertionFound
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
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInsertionData(double insertionCost, int pickupInsertionIndex, int deliveryInsertionIndex, Vehicle vehicle, Driver driver) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFailedConstrainName(String name) static InsertionDataReturns an instance of InsertionData that represents an EmptyInsertionData (which might indicate that no insertion has been found).doubleGet the cost breakdown showing contribution from each component.intReturns insertionIndex of deliveryActivity.doubleReturns insertion costs (which might be the additional costs of inserting the corresponding job).intReturns insertionIndex of pickkupActivity.Returns the vehicle to be employed.Returns the vehicle to be employed.doublebooleanisFound()Returns true if this represents a valid insertion, false if no insertion was found.voidsetAdditionalTime(double additionalTime) voidsetCostBreakdown(InsertionCostBreakdown costBreakdown) Set the cost breakdown.voidsetVehicleDepartureTime(double departureTime) toString()
-
Field Details
-
NO_INDEX
public static int NO_INDEX
-
-
Constructor Details
-
InsertionData
-
-
Method Details
-
isFound
public boolean isFound()Returns true if this represents a valid insertion, false if no insertion was found. Use this instead ofinstanceof NoInsertionFoundchecks.- Returns:
- true if insertion is valid, false otherwise
-
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
-
getFailedConstraintNames
-
setAdditionalTime
public void setAdditionalTime(double additionalTime) - Parameters:
additionalTime- the additionalTime to set
-
toString
-
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
Returns the vehicle to be employed.- Returns:
-
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
Get the cost breakdown showing contribution from each component.- Returns:
- the cost breakdown, or null if not captured
-
setCostBreakdown
Set the cost breakdown.- Parameters:
costBreakdown- the breakdown to set
-