[Symphony] A couple of questions ..

Ted Ralphs ted at lehigh.edu
Wed Oct 22 01:09:44 EDT 2014


On Mon, Oct 20, 2014 at 4:06 AM, Mikko Alinikula - SUBNIC OY <
subnic at kolumbus.fi> wrote:

> Hello Ted,
>
> A couple of questions :
>
> 1) I would like to poll windows-messages after calling "Solve"-method for
> the symphony.  Which user-callback would be most suitable for this?
>

I'm not sure exactly what you mean by this, but I guess you want to do
"something" just once after the solve call? Are you calling "solve"
multiple times within a single application or just once? Are you using any
other callbacks or are you just using it out-of-the-box aside from this
modification? I guess the user_initialize callback would be the most
natural if you just need to do something once, but you could also just
write your own driver, which would be better in some ways than linking to
the application library.

If you want to check for messages periodically (which seems more likely
given your second question), there are a few different callbacks you would
use, but I would want to know more to make a recommendation.


> 2) If the user wants to stop the optimization and the system sends a
> message which is then read in the user-callback, how do I return the best
> solution so far to the user?  Can that be done?
>

There is a signal handler that will return the results found so far in the
case of an interrupt on *nix platform. I guess this is exactly what you
want. You can probably just manually set the termcode TM_SIGNAL_CAUGHT in
whatever callback you use to check for messages, assuming I understand what
you're going for. This is not really a mechanism I've contemplated, so it
might be better to add another callback in the tree manager somewhere to
check for user termination---sort of like a signal handler but for
terminating according to some external condition.

Let me know some more details and I can see what should be done.

Ted
-- 
Dr. Ted Ralphs
Professor, Lehigh University
(610) 628-1280
ted 'at' lehigh 'dot' edu
coral.ie.lehigh.edu/~ted
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/symphony/attachments/20141022/9d8ae17c/attachment.html>


More information about the Symphony mailing list