IBM ILOG Dispatcher User's Manual > Transportation Industry Solutions > Pickup and Delivery by Multiple Vehicles from Multiple Depots > Model > Define the Depot constructor

A depot is built from an instance of IloEnv and is given a name name. The following code is provided for you:

Depot
::Depot(IloEnv env, const char *name, IloNum x, IloNum y,
        IloInt nbOfTrucks, IloInt capacity,
        IloNum openTime, IloNum closeTime
        )
  : _env(env),
    _node(env, x, y, 0, name),
    _nbOfTrucks(nbOfTrucks),
    _capacity(capacity),
    _openTime(openTime),
    _closeTime(closeTime),
    _vehicles(env),
    _visits(env),
    _model(env)

{

In order to improve solutions for this depot, a neighborhood _nhood and greedy metaheuristic _mh are created. As the subproblem of improving the solution to a single depot is likely to be relatively small, five move operators are used in the neighborhood.

Step 3   -  

Create the depot neighborhood

Add the following code after the comment //Create the depot neighborhood

    _nhood = IloTwoOpt(env) + IloOrOpt(env) + IloRelocate(env) +
           IloCross(env) + IloExchange(env)
    //+ IloRelocateTours(env)
    ;

Step 4   -  

Create the depot search heuristic

Add the following code after the comment //Create the depot search heuristic

   _mh = IloImprove(env);
}