IBM ILOG Dispatcher User's Manual > The Basics > IBM ILOG Dispatcher Concepts > Model > Dimensions

Dimensions are objects closely associated with visits and vehicles. The most common dimensions are weight, time, and distance. Dimensions are used to model side constraints such as capacity, time windows, deadlines, service delays, and so on. Dimensions are also used to model costs and the objective. An understanding of dimensions and the constrained variables derived from them is essential to understanding Dispatcher.

Vehicles may have different capacities in terms of weight (for solid goods, for example) or volume (for liquids, for instance); routes may entail different costs or distances traveled; visits may require different amounts of time (perhaps for waiting, unloading, reloading, and so on). In short, there may be many different dimensions (such as weights, volumes, distances, times) in a given routing problem. These dimensions are most closely associated with vehicles (to model capacity and costs) and visits (to model quantities, delays, time windows, and deadlines).

The class IloDimension makes it possible to handle easily the various dimensions that occur in a problem. When you create an instance of IloDimension, a constrained variable is associated with this dimension for each object (if needed). Constraints can subsequently be posted on those variables.

The class IloDimension has two subclasses to represent the intrinsic and extrinsic dimensions of an object. An intrinsic dimension depends only on the single object with which it is associated. An extrinsic dimension depends on two objects.

The subclass IloDimension1 represents the dimensions that are intrinsic to an object. For example, weight is represented by IloDimension1 because the weight of an object depends only on that object.

IloDimension2 represents the dimensions that are extrinsic to an object; that is, those dimensions that depend on something outside the object itself. For example, time is usually represented as an instance of IloDimension2 because the time to travel from one visit to another depends on both those visits.

By definition, IloDimension2 is closely linked to the concept of distance. For that reason, one of the data members of IloDimension2 is in fact an instance of IloDistance.

Objects of IloDistance define how distances are computed between nodes with respect to a dimension and a vehicle. IloEuclidean computes the Euclidean distance between nodes according to their coordinates. IloManhattan computes the grid pattern distance between nodes. IloDispatcherGraph computes distance from a road network graph. A simple C++ representation of IloDistance could be a pointer to a function. The following code shows how to create three dimensions: weight, time, and distance:

IloEnv env;
IloModel mdl(env);
IloDimension1 weight(env);
mdl.add(weight);
IloDimension2 time(env, IloEuclidean);
mdl.add(time);
IloDimension2 distance(env, IloEuclidean);
mdl.add(distance);