IBM ILOG Dispatcher User's Manual > The Basics > Multiple Tours per Vehicle > Solve > Define the RoutingSolver constructor

The RoutingSolver constructor is defined as in Chapter 3, Solving a Vehicle Routing Problem, except that you do not create a goal for finding the first solution. The RoutingSolver constructor takes an instance of RoutingModel as a parameter. The environment, model, solver, dispatcher, and solution are initialized. The goal to instantiate cost is created using the function IloDichotomize. The goal to restore the solution is created using IloRestoreSolution. This constructor will be called from the main function. This code is provided for you:

RoutingSolver::RoutingSolver(RoutingModel mdl):
  _env(mdl.getEnv()),
  _mdl(mdl.getModel()),
  _solver(mdl.getModel()),
  _dispatcher(_solver),
  _solution(mdl.getModel()){
    _instantiateCost =
        IloDichotomize(_env, _dispatcher.getCostVar(), IloFalse);
    _restoreSolution = IloRestoreSolution (_env, _solution);
  }