Hello,
We are currently using jsprit for route planning and optimisation, time and skill constraint checks are applied, but we are unable to figure out solution for following problem -
Consider we have 2 vehicles with capacity as below -
vehicle 1 -> total capacity - 5, weight capacity - 1000
vehicle 2 -> total capacity - 5, weight capacity - 800
And 4 services as below
service 1 -> weight - 900
service 2 -> weight - 400
service 3 -> weight - 200
service 4 -> weight - 200
With time window of 6 hours where in all services can be served if service 1 is allocated to vehicle 1 and remaining 3 services(service 2,3,4) are allocated to vehicle 2. But in this case, algo assigns service 2,3,4 to vehicle 1 leaving service 1 unassigned as vehicle 2 doesn’t have the load capacity.
I tried adding load contraints as below, but it didn’t work
StateManager stateManager = new StateManager(problem); stateManager.updateSkillStates(); stateManager.updateTimeWindowStates(); stateManager.updateLoadStates(); ConstraintManager constraintManager = new ConstraintManager(problem, stateManager); constraintManager.addSkillsConstraint(); constraintManager.addTimeWindowConstraint(); constraintManager.addLoadConstraint();
Please suggest.