IBM ILOG Dispatcher User's Manual > Transportation Industry Solutions > Modeling Complex Costs > Model cost2 |
Model cost2 |
INDEX
![]() |
Once you have written a description of your problem, you can use Dispatcher classes to model it.
Step 2 - | Open the example file |
Open the example file YourDispatcherHome/examples/src/tutorial/cost2_partial.cpp
in your development environment.
In this example, the cost function is added as an IloNumToNumSegmentFunction
in the createVehicles
function.
Step 3 - | Add the vehicle cost function |
Add the following code after the comment //Add the vehicle cost function
.
First, a standard proportional cost is applied on the distance traveled (cost per unit distance is 1). Then, costFunction
is created with a default value of 0. The member function setSlope
is then used to change the value of the function, depending on the range given.
© Copyright IBM Corp. 1987, 2009. Legal terms. | PREVIOUS NEXT |