Class ServiceLoadRouteLevelConstraint

java.lang.Object
com.graphhopper.jsprit.core.problem.constraint.ServiceLoadRouteLevelConstraint
All Implemented Interfaces:
Constraint, HardConstraint, HardRouteConstraint

public class ServiceLoadRouteLevelConstraint extends Object implements HardRouteConstraint
Ensures that capacity constraint is met, i.e. that current load plus new job size does not exceeds capacity of new vehicle.

If job is neither Pickup, Delivery nor Service, it returns true.

Author:
stefan
  • Constructor Details

  • Method Details

    • fulfilled

      public boolean fulfilled(JobInsertionContext insertionContext)
      Description copied from interface: HardRouteConstraint
      Returns whether a job can be inserted in route.
      Specified by:
      fulfilled in interface HardRouteConstraint
      Parameters:
      insertionContext - provides context information about inserting a new job, i.e. the new job (insertionContext.getJob()), the route where the new job should be inserted (insertionContext.getRoute()), the new vehicle that should operate the route plus the new job (insertionContext.getNewVehicle()) and the new departure time at this vehicle's start location (insertionContext.getNewDepartureTime()).
      Returns:
      true if constraint is met, false otherwise