IBM ILOG Dispatcher User's Manual > The Basics > Modeling a Vehicle Routing Problem > Model > Declare the RoutingModel class

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

class RoutingModel {
  IloEnv              _env;
  IloModel            _mdl;
  IloDimension2       _time;
  IloDimension2       _distance;
  IloDimension1       _weight;

  void addDimensions();
  void createIloNodes(const char* nodeFileName);
  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; }
};

The class RoutingModel has five data members. The environment, an instance of the class IloEnv, manages internal modeling issues. It handles output, memory management for modeling objects, and termination of search algorithms. The model, an instance of the class IloModel, is a container for modeling objects such as variables and constraints. For more information on environments and models, see the IBM ILOG Solver Reference Manual. The dimensions in this problem are time, distance, and weight. For more information on dimensions, see Chapter 1, IBM ILOG Dispatcher Concepts.

The class RoutingModel has four member functions, addDimensions, CreateIloNodes, CreateVehicles, and CreateVisits, as well as a constructor. These member functions and constructor are explained in the following sections. You can use the public member functions getEnv and getModel to return the environment and model.