[Coin-discuss] Trouble Capturing Sbb output with Linux redirect

Lou Hafer lou at cs.sfu.ca
Fri Feb 20 12:28:18 EST 2004


Steve,

	The advice from John and Ted is good. John's suggestion of
replacing/modifying/augmenting the message handler is one approach.  The
default handler is very flexible (in the spirit of the iostream) but by
design the output format is structured.

	But I'm wondering --- one obvious way to approach this would be a
function call, say, dumpInfo, dropped into the main branch&cut loop in
SbbModel::branchAndBound.  This would allow you to print whatever you're
interested in seeing. There's a comment (starts with `Periodic activities')
in the main loop that marks a good spot.  Or you might want to move up about
25 lines and insert the call at the top of the loop. Do whatever you like in
dumpInfo, then explicitly flush the output.

	The appropriate generalization of this would be generic callback
routines, inserted at appropriate points in the code. That'd take a bit more
planning, but would have much wider utility.

	There's likely something I'm missing that makes this impractical,
probably in the nature of the linkage to php (another thing that's never made
it to the top of my 'to do' list). I'm also leaping to the assumption you're
willing to get in and hack at the code.

	As a general comment, it would not be hard to install a command line
parameter, or add some code to a custom driver, that would establish an
initial bound on the solution (setCutoff()). But the search tree is local to
branchAndBound(). Restarting branchAndBound() (or the sbb program) with a
bound from the incumbent would not be equivalent to pausing between nodes to
print progress information, because you'll have a different search tree after
each restart. I may have missed it, but I don't recall methods to save and 
restore the search tree.

							Lou




More information about the Coin-discuss mailing list