Class PickupAndDeliverShipmentLoadActivityLevelConstraint
java.lang.Object
com.graphhopper.jsprit.core.problem.constraint.PickupAndDeliverShipmentLoadActivityLevelConstraint
- All Implemented Interfaces:
Constraint,HardActivityConstraint,HardConstraint
public class PickupAndDeliverShipmentLoadActivityLevelConstraint
extends Object
implements HardActivityConstraint
Constraint that ensures capacity constraint at each activity.
This is critical to consistently calculate pd-problems with capacity constraints. Critical means that is MUST be visited. It also assumes that pd-activities are visited in the order they occur in a tour.
- Author:
- schroeder
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.graphhopper.jsprit.core.problem.constraint.HardActivityConstraint
HardActivityConstraint.ConstraintsStatus -
Constructor Summary
ConstructorsConstructorDescriptionConstructs the constraint ensuring capacity constraint at each activity. -
Method Summary
Modifier and TypeMethodDescriptionfulfilled(JobInsertionContext iFacts, TourActivity prevAct, TourActivity newAct, TourActivity nextAct, double prevActDepTime) Checks whether there is enough capacity to insert newAct between prevAct and nextAct.
-
Constructor Details
-
PickupAndDeliverShipmentLoadActivityLevelConstraint
public PickupAndDeliverShipmentLoadActivityLevelConstraint(RouteAndActivityStateGetter stateManager) Constructs the constraint ensuring capacity constraint at each activity.This is critical to consistently calculate pd-problems with capacity constraints. Critical means that is MUST be visited. It also assumes that pd-activities are visited in the order they occur in a tour.
- Parameters:
stateManager- the stateManager
-
-
Method Details
-
fulfilled
public HardActivityConstraint.ConstraintsStatus fulfilled(JobInsertionContext iFacts, TourActivity prevAct, TourActivity newAct, TourActivity nextAct, double prevActDepTime) Checks whether there is enough capacity to insert newAct between prevAct and nextAct.- Specified by:
fulfilledin interfaceHardActivityConstraint- Parameters:
iFacts- JobInsertionContext provides additional information that might be important when evaluating the insertion of newActprevAct- the previous activity, i.e. the activity before the new activitynewAct- the new activity to be inserted in between prevAct and nextActnextAct- the next activity, i.e. the activity after the new activityprevActDepTime- the departure time at previous activity (prevAct) with the new vehicle (iFacts.getNewVehicle())- Returns:
- fulfilled if hard constraint is met, other not fulfilled.
-