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
  • 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:
      fulfilled in interface HardActivityConstraint
      Parameters:
      iFacts - JobInsertionContext provides additional information that might be important when evaluating the insertion of newAct
      prevAct - the previous activity, i.e. the activity before the new activity
      newAct - the new activity to be inserted in between prevAct and nextAct
      nextAct - the next activity, i.e. the activity after the new activity
      prevActDepTime - the departure time at previous activity (prevAct) with the new vehicle (iFacts.getNewVehicle())
      Returns:
      fulfilled if hard constraint is met, other not fulfilled.