Class ActivityContext
java.lang.Object
com.graphhopper.jsprit.core.problem.misc.ActivityContext
Provides insertion context information about a particular activity.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns arrival time at associated activity.doubleReturns end time of associated activity.intReturns the insertion index of the associated vehicle.voidsetArrivalTime(double arrivalTime) Sets arrivalTime of associated vehicle at activity.voidsetEndTime(double endTime) Sets end time of associated activity.voidsetInsertionIndex(int insertionIndex) Sets insertion index of associated activity.
-
Constructor Details
-
ActivityContext
public ActivityContext()
-
-
Method Details
-
getArrivalTime
public double getArrivalTime()Returns arrival time at associated activity.- Returns:
- arrival time
-
getEndTime
public double getEndTime()Returns end time of associated activity.- Returns:
- end time
-
getInsertionIndex
public int getInsertionIndex()Returns the insertion index of the associated vehicle.The associated activity is not inserted yet. The actual insertion position is still to be evaluated. Thus this insertion index is related to the potential insertion index which is the position before the activity at this index in the existing route.
if insertionIndex == 0, the associated activity will be inserted between start of vehicle and the first activity in activity sequence.
if insertionIndex == relatedRoute.getActivities().size(), the associated activity will be inserted between the last activity in the activity sequence and the end of vehicle.
- Returns:
- insertion index
-
setArrivalTime
public void setArrivalTime(double arrivalTime) Sets arrivalTime of associated vehicle at activity.- Parameters:
arrivalTime- arrival time of associated vehicle at activity
-
setEndTime
public void setEndTime(double endTime) Sets end time of associated activity.- Parameters:
endTime- end time
-
setInsertionIndex
public void setInsertionIndex(int insertionIndex) Sets insertion index of associated activity.- Parameters:
insertionIndex- insertion index of associated activity
-