IBM ILOG Dispatcher User's Manual > The Basics > Minimizing the Number of Vehicles > Model > Declare the RoutingModel class |
Declare the RoutingModel class |
INDEX
![]() |
The code for the declaration of the class RoutingModel
is provided for you:
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 and weight. Unlike in Chapter 2, Modeling a Vehicle Routing Problem, distance is not a dimension. In this example, only the dimensions representing time and weight are required to set side constraints and to compute the cost. However, you could add a distance dimension if you wanted to include this dimension in the model.
The graph, an instance of the class IloDispatcherGraph
, allows you create a graph representing a road network topology on which instances of IloNode
can be positioned. This graph is composed of graph nodes--which are different from IloNodes
--and arcs connecting these graph nodes. The cost in time and distance for traversing an arc is loaded from a file, as well as any penalties associated with making turns. See "Define the RoutingModel constructor".
IloDispatcherGraph
computes the shortest paths between nodes for each vehicle. It is this shortest path that is used to create the dimension _time
in this problem. See "Define the addDimensions function".
You must associate the graph nodes with instances of IloNode
that represent depot and visit locations. See "Define the createIloNodes function".
The class RoutingModel
introduces two member functions related to IloDispatcherGraph
functionality: loadGraphInformation
and lastMinuteGraphChanges
. See "Define the loadGraphInformation function" and "Define the lastMinuteGraphChanges function".
© Copyright IBM Corp. 1987, 2009. Legal terms. | PREVIOUS NEXT |