IBM ILOG Dispatcher User's Manual > The Basics > Adding Visit Disjunctions > 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;
  IloDimension1       _weight;
  IloDimension2       _time;
  IloDimension2       _distance;
  IloNHoodArray       _swapArray;

  void addDimensions();
  void loadGraphInformation (const char * arcFileName,
                                 const char* turnFileName);
  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; }
  IloNHoodArray getSwapArray() const {return _swapArray;}
  IloVisit  createAdditionalVisits (int argc, char* argv[]);
  void      removeVisit (IloVisit);
};

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 time, weight, and distance.

An instance of the class IloDispatcherGraph allows you create a graph representing a road network topology on which instances of IloNode can be positioned. IloDispatcherGraph computes the shortest paths between nodes for each vehicle. It is this shortest path that is used to create the dimensions _time and _distance in this problem. See "Define the addDimensions function". Dispatcher's graph functionality is introduced in Minimizing the Number of Vehicles.

The function getSwapArray is used to access a neighborhood created to swap alternative visits and implement visit disjunctions. See "Define the createVisits function". The member functions createAdditionalVisits and removeVisit are used to add and remove visits from the model. See "Define the createAdditionalVisits function" and "Define the function removeVisit".