[FlopCpp] Iteration Limit or time limit

Tim Hultberg Tim.Hultberg at eumetsat.int
Fri Oct 12 10:45:58 EDT 2007


The operator-> is used to access the underlying solver (OsiSolverInterface*). In order to access methods from a particular solver, this pointer must by casted...

So here is how to set a maximum of 100 iterations when using CBC: 

dynamic_cast<OsiCbcSolverInterface *>(MP_model::getDefaultModel().operator->())->getModelPtr()->setMaximumNodes(100);
 
using the default model, or

MP_model M;
dynamic_cast<OsiCbcSolverInterface *>(M.operator->())->getModelPtr()->setMaximumNodes(100);

otherwise

(see
http://www.coin-or.org/Cbc/cbcuserguide.html
for your options of what can be set in CBC)

Tim

>>> "marcos.roberto.silva" <marcos.roberto.silva at uol.com.br> 11/10/2007 17:44 >>>
Hi all,
I am trying to solve a very dificult milp problem using
FlopCpp with Cbc and/or Symphony.

I would like to stop the search after X iterations (or T
seconds) and obtain the best solution so far and the values
of the variables for this solution.

How can I do this?
I'm a newbie of OSI...

Thank you very much.

Marcos Roberto Silva



_______________________________________________
FlopCpp mailing list
FlopCpp at list.coin-or.org 
http://list.coin-or.org/mailman/listinfo/flopcpp




More information about the FlopCpp mailing list