IBM ILOG Dispatcher User's Manual > The Basics > Multiple Tours per Vehicle > Model > Declare the RoutingModel class

The code for the declaration of the class RoutingModel is provided for you:

class RoutingModel {
  IloEnv              _env;
  IloModel            _mdl;
  IloDispatcherGraph  _graph;
  IloDimension2       _distance;
  IloDimension1       _weight;
  IloVisitArray       _unorderedVisitArray;

  void addDimensions();
  void loadGraphInformation (const char* arcFileName);
  void lastMinuteGraphChanges ();
  void createIloNodes(const char* nodeFileName, const char* coordFileName);
  void createVehicles(const char* vehicleFileName);
  void createVisits(const char* visitsFileName);

public:
  RoutingModel(IloEnv env, int argc, char* argv[]);
  ~RoutingModel() {}
  IloEnv    getEnv() const { return _env; }
  IloModel  getModel() const { return _mdl; }
  IloDispatcherGraph getGraph() const {return _graph;}
  IloVisitArray getUnorderedVisitArray () const {return _unorderedVisitArray;}
};

There are only a few differences between the RoutingModel class used in a standard VRP and the RoutingModel class used in this problem.

The dimensions in this problem are weight and distance. As in Chapter 4, Minimizing the Number of Vehicles, you use an instance of the class IloDispatcherGraph to compute the shortest paths between nodes for each vehicle. It is this shortest path that is used to create the dimension _distance in this model. See "Define the addDimensions function".

You create _unorderedVisitArray, an instance of IloVisitArray that will be used in the submodel to generate a first solution.

The function getGraph is used to access the road network graph in the submodel. The member function getUnorderedVisitArray is used in the submodel to access the array of unordered visits.