How to add a constraints in OptaPlanner for vehicle routing -


i working on vehicle routing problem have implement constraint ensures specific location/s shouldn't 1st or last location traversed. idea how can addressed ?

there couple of ways can this:

the easy way:

if (customer.getpreviousstandstill instanceof vehicle) // first visit  if (customer.getnextcustomer == null) // last visit 

the hard way (in case need single out 37th visit etc):

in planning entity customer, add shadow variable visitnumber, in vehicle, add shadow variable visitnumbertotal. use variablelisteners keep in sync.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -