IBM ILOG Dispatcher User's Manual > The Basics > Adding Visit Disjunctions > 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 Solving a Vehicle Routing Problem. You search for a solution using _generalGoal
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(_generalGoal)) { _solver.error() << "Infeasible Routing Plan" << endl; return IloFalse; } _solution.store(_solver); return IloTrue; } |
© Copyright IBM Corp. 1987, 2009. Legal terms. | PREVIOUS NEXT |