| Forum | GitHub | Maps | Blog

Guidance on when call backs are called



I want to get better familiar with when particular callbacks are executed. I have a fair idea but not sure about a couple.

HardActivityConstraint & SoftActivityConstraint- called before insertion of an activity into the current route of a vehicle.
HardRouteConstraint & SoftRouteConstraint- same as above ?

setObjectiveFunction. When is this called?

Is there a specific call at the end of a route creation that can look for problems in the route and give a cost value back or is this a matter of looking for End in a HardRouteConstraint/SoftRouteConstraint then checking the created route.

Finally - when we return false for a hard/soft route constraint are we saying “we dont like the job” or “we dont like the route”

One of the challenges we are facing relates to multiple depots and minimum loads. A route might pickup jobs from 1 or 2 depots then do the deliveries, then start another “run” by picking up again from multiple depots and doing the deliveries and so on. We need to make sure that at the end of the “pickup from depots” the load is <= minimumCapacity of the vehicle.

At the moment we are looking at a HardRouteConstraint that collects Pickups, adding the load and comparing it to the minimumLoad then continuing for the next lot after the deliveries.

Any guidance on any better ways to approach this would be appreciated.

kind regards