[gecode-users] Redirect the output of a MinimizeScript

Guido Tack tack at gecode.org
Fri Sep 30 18:55:43 CEST 2011


On 30 Sep 2011, at 18:12, Nacho Castiñeiras wrote:

> Hi, 
> is it possible to redirect the output of the MinimizeScript "print" function to
> an external file? 
> 
> I have looked to the examples of the Gecode distribution and the print function
> is always implicitly called by the MinimizeScript::run method. 

It's possible, but you will have to run the search yourself instead of through the MinimizeScript::run method.

See the "send most money" example from Sect. 3.2 of MPG:
http://www.gecode.org/doc-latest/MPG/send-most-money-with-cost.cpp

Then you can call the print function yourself for each solution (or only for the last one if that's what you need), and pass a std::ostream that writes to a file.

Cheers,
Guido

-- 
Guido Tack, http://people.cs.kuleuven.be/~guido.tack/




More information about the users mailing list