0

EDIT: this question is for people that know or-tools and in particular the routing library:

I want to increase my understanding of the routing library. I have read the or-tools manual. I would like to pass a decision builder to the solver. The decision builder should decide how nextVar assignments are made.

Here is my attempt:

java:

indexDepot = 0;
numberStops = 100;
numberVehicles = 8;
indexManager = new RoutingIndexManager(numberStops, numberVehicles, indexDepot);
RoutingModelParameters modelParameters = parameters.getRoutingModelParameters();
model = new RoutingModel(indexManager, modelParameters);
Solver cpsolver = model.solver();

IntVar[] nextVars = new IntVar[numberStops];
for (int i=1; i<numberStops; i++) {
    nextVars[i] = model.nextVar(i);
}
DecisionBuilder db = cpsolver.makePhase(nextVars, cpsolver.CHOOSE_RANDOM, cpsolver.ASSIGN_RANDOM_VALUE);
cpsolver.newSearch(db);

It seems that the cpsolver.newSearch(db); does not have any effect. How do I correctly pass decision builders to the routing model?

Here is the part of the manual about search primitives:

https://acrogenesis.com/or-tools/documentation/user_manual/manual/search_primitives/out_of_the_box_search_primitives.html

Leevi L
  • 1,538
  • 2
  • 13
  • 28

0 Answers0