[gecode-users] Output control for the Script class

Andrea Pretto a.pretto at miriade.it
Mon May 21 16:31:05 CEST 2012


Hi,

I'am using Gecode for a project at work (I'am using Script class) and I
needed to separate Gecode message (timing, statistics etc..) from
solutions. That's because solutions "goes out" in a certain format that
another process have to decode, so I cannot mix solutions with Gecode
message.

The simplest solution I found was to change cout to clog everywhere in
ScriptBase::run, everywhere BUT when calling ex->print() which print the
solution. This is enough to have Gecode messages to standard log and
solutions to standard output, and now I can redirect them separately.

I would like to have this kind behavior on future releases of
Gecode. Flatzinc has already some options that do something like that (-s
and -o, I think), I want to implement something similar and send some
patches if you agree (it's pretty simple from what I see).
Tell me what you think about it.

Cheers.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20120521/55e4c0d0/attachment.html>


More information about the users mailing list