[Bonmin] can't redirect certain message via jounalist

Stefan Vigerske stefan at vigerske.de
Thu Apr 23 06:27:36 EDT 2009


Hi,

> My question is: how can I redirect the messages of the Bonmin embedded CBC
> class to the scilab console ?

You need to provide also a CoinMessageHandler. However, it is a bit
tricky to make Bonmin use it, since you need to fool the BonminSetup.

Instead of doing
BonminSetup bonmin_setup;
bonmin_setup.initializeBonmin(minlp);

you can do something like

OsiTMINLPInterface ositminlp;
ositminlp.initialize(roptions, options, journalist, minlp);
ositminlp.passInMessageHandler(&messagehandler);
bonmin_setup.initialize(ositminlp); // this clones first_osi_tminlp

But next to the minlp, you then also need to create the
RegisteredOptions, Options, and Journalist by yourself.
Or maybe I have not seen a simpler way. My code is here:
https://projects.coin-or.org/GAMSlinks/browser/stable/0.4/GAMSlinks/src/Bonmin/GamsBonmin.cpp#L133

The cleaner way is probably to create your own BonminSetup class. I
think that is what they have done for the ampl interface.

Stefan



More information about the Bonmin mailing list