optaplanner - Hard score calculation in vehicle routing -


currently using optaplanner calculating score in cvrp problem.

if (demand > capacity)      hardscore -= (demand - capacity); 

if there heterogeneous fleet, how can calculate hard score?

i want use vehicle small capacity if number of demand less vehicle assigned optaplanner.

don't mix 2 constraints. these 2 different constraints:

  • each vehicle must have enough capacity (usually hard constraint) - implemented in optaplanner example.
  • prefer using smaller vehicles on bigger ones (usually soft constraint). there's price per km per vehicle type, factors in distance driven in soft score penalty.

just implement second constraint, starting optaplanner vrp example.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -