IBM ILOG Dispatcher User's Manual > The Basics > Minimizing the Number of Vehicles > Solve > Define the findFirstSolution function |
Define the findFirstSolution function |
INDEX
![]() |
Now, you create the function that searches for the first solution. This function is the same as the one you created in Chapter 3, Solving a Vehicle Routing Problem. You search for a solution using _generateGoal
and store the solution and its cost using the member function IloRoutingSolution::store
. This code is provided for you:
IloBool RoutingSolver::findFirstSolution() { if (!_solver.solve(_generateGoal)) { _solver.error() << "Infeasible Routing Plan" << endl; return IloFalse; } _solution.store(_solver); return IloTrue; } |
© Copyright IBM Corp. 1987, 2009. Legal terms. | PREVIOUS NEXT |