[Cbc] Question regarding Handler

Haroldo Santos haroldo.santos at gmail.com
Fri Nov 16 16:52:10 EST 2012


Hi Alexis,

Just to understand what is happening:

Why you are using CBC if your code apparently depends only of CLP ?




On Fri, Nov 16, 2012 at 7:35 PM, Alexis Guigue <aguigue at softree.com> wrote:

> Hi,
>
> I am playing around with handlers now and I have come across the
> following. In words (but
> I can provide more code if needed).
>
> - I have derived a class OptEventHandler from ClpEventHandler.
> - I am creating an instance m_osiClpSolver of OsiClpSolverInterface and
> populate it with some data
> - Then comes setting the handler
>         OptEventHandler handler;
> m_osiClpSolver.getModelPtr()->**passInEventHandler(&handler);
> - And finally, the call to optimization
>     m_osiClpSolver.initialSolve();
>
> My function int OptEventHandler::event(Event whichEvent) is quite trivial,
> i.e.,
>  if (whichEvent == endOfIteration) {
>         int numIter = model_->getIterationCount();
>         cout << numIter  << "\n";
> end
>
> For the first problem I try, everything goes well, the iteration number
> displays and
> the problem solves to optimality. I checked, the algorithm used is -1.
>
> For my second problem (almost the same), the iteration number keeps at 0.
> However, the problem solves to optimality, and I checked the algorithm in
> model_ is 0.
>
> I know it is somewhat a rough description, but any idea why I am not able
> to get the iteration number in the second case (note, I am still with CBC
> 2.7.1).
>
> Cheers
>
> Thanks
>
> Alexis
>
>
> --
> Software Engineer/Research Engineer
> Softree Technical Systems Inc.
> www.softree.com
> Engineering an Easier Way
>
> ______________________________**_________________
> Cbc mailing list
> Cbc at list.coin-or.org
> http://list.coin-or.org/**mailman/listinfo/cbc<http://list.coin-or.org/mailman/listinfo/cbc>
>



-- 
=============================================================
Haroldo Gambini Santos
Computing Department
Universidade Federal de Ouro Preto - UFOP
email: haroldo [at ] iceb.ufop.br
home/research page: www.decom.ufop.br/haroldo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20121116/682cdaf0/attachment.html>


More information about the Cbc mailing list