Class ServiceLoadRouteLevelConstraint
java.lang.Object
com.graphhopper.jsprit.core.problem.constraint.ServiceLoadRouteLevelConstraint
- All Implemented Interfaces:
Constraint,HardConstraint,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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanfulfilled(JobInsertionContext insertionContext) Returns whether a job can be inserted in route.
-
Constructor Details
-
ServiceLoadRouteLevelConstraint
-
-
Method Details
-
fulfilled
Description copied from interface:HardRouteConstraintReturns whether a job can be inserted in route.- Specified by:
fulfilledin interfaceHardRouteConstraint- 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
-