IBM ILOG Dispatcher User's Manual > Transportation Industry Solutions > Pickup and Delivery by Multiple Vehicles from Multiple Depots > Solve > Define the main function |
Define the main function |
INDEX
![]() |
After you finish creating the Depot
, RoutingModel
, and RoutingSolver
classes, you use them in the main
function. You can use command line syntax to pass the names of input files to the model. If you do not specify input files, the defaults will be used. In the main
function, you first create an environment. Then you create an instance of the RoutingModel
class and parse the input files. You create the model for the whole problem with the member function RoutingModel::createModel
. You create an instance of the RoutingSolver
class. You find a first solution and then use iterative improvement to improve the depots and the routing plan. You synchronize the final solution and print this solution. The following code is provided for you:
Step 18 - | Compile and run the program |
Compile and run the program. The first solution has a cost of 1397.52 units. After three improvement loops, the solution has a cost of 983.385 units. The solution uses 15 vehicles:
The complete program and output are listed in "Complete Program". You can also view it online in the YourDispatcherHome/examples/src/mdpdp.cpp
file.
© Copyright IBM Corp. 1987, 2009. Legal terms. | PREVIOUS NEXT |