<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 20, 2014 at 4:06 AM, Mikko Alinikula - SUBNIC OY <span dir="ltr">&lt;<a href="mailto:subnic@kolumbus.fi" target="_blank">subnic@kolumbus.fi</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Ted,<br>
<br>
A couple of questions :<br>
<br>
1) I would like to poll windows-messages after calling &quot;Solve&quot;-method for the symphony.  Which user-callback would be most suitable for this?<br></blockquote><div><br></div><div>I&#39;m not sure exactly what you mean by this, but I guess you want to do &quot;something&quot; just once after the solve call? Are you calling &quot;solve&quot; 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.<br><br></div><div>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.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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?<br></blockquote><div><br></div><div>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&#39;re going for. This is not really a mechanism I&#39;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.<br><br></div><div>Let me know some more details and I can see what should be done.<br><br>Ted<br></div></div>-- <br><div dir="ltr">Dr. Ted Ralphs<br>Professor, Lehigh University<br>(610) 628-1280<br>ted &#39;at&#39; lehigh &#39;dot&#39; edu<br><a href="http://coral.ie.lehigh.edu/~ted" target="_blank">coral.ie.lehigh.edu/~ted</a><br></div>
</div></div>