IBM ILOG Dispatcher User's Manual > Transportation Industry Solutions > Adding Early and Late Costs > Solve |
Solve |
INDEX
![]() |
The solution is computed, improved, and displayed by methods previously presented for the VRP problem, with one addition.
The solve portion of the problem needs to account for the fact that time needs to be instantiated. In our previous examples, the earliest possible delivery time was always the optimal delivery time. In this example, that is not necessarily true due to the possibility of early delivery charges; shifting the schedule to the earliest possible time may actually increase the cost of the schedule.
Step 5 - | Instantiate time |
Add the following code after the comment //Instantiate time
.
IloGoal subGoal = IloSetVisitCumuls(env, IloDimension2::Find(env, "Time"), 1e-6) && instantiateCost; |
Step 6 - | Compile and run the program |
The solution improvement phase finds a solution using 9 vehicles with a cost of 1128.95 units:
The complete program and output are listed in "Complete Program". You can also view it online in the YourDispatcherHome/examples/src/earlytardy.cpp
file.
© Copyright IBM Corp. 1987, 2009. Legal terms. | PREVIOUS NEXT |