Re: [Help-glpk] interrupt glpk using JNI

2006-04-19 Thread Andrew Makhorin
 I am using GLPK JNI for my problem. For the small instances it's ok
  since the solver doesn't take much time to solve. But sometimes
  when the instances are large GLPK takes few minutes to solve the
  instance. Now what if the user wants to interrupt the solver and
  not continue the solution process. I have tried to find out how to
  stop the solver while it is still running but no luck. I have tried
  to stop the java thread that starts GLPK solver native thread but it
  didn't help. Is there any API call or any specific method to interrupt
  the solver? I would highly appreciate any help.

You can limit the solution time. I'm not sure about jni (since never
used it); however, in c this can be attained by the following call:

   lpx_set_real_parm(prob, LPX_K_TMLIM, tmlim);

where tmlim is the time limit, in secs, of double type.



___
Help-glpk mailing list
Help-glpk@gnu.org
http://lists.gnu.org/mailman/listinfo/help-glpk


Re: [Help-glpk] interrupt glpk using JNI

2006-04-19 Thread faheem hussain
Thanks for your quick response but unfortunately this solution doesn't apply in this case. I want to let the user decide whether he wants to interrupt/cancel the solution process or not, and when. To be precise in the GUI I want to provide the cancel button once the solution is in progress.The time limit can be set only before the solution process begins. Once the solver starts solving the process, settting this parameter doesn't help(I actually tried it). Any other suggestions?Andrew Makhorin [EMAIL PROTECTED] wrote:   I am using GLPK JNI for my problem. For the small instances it's ok since the solver doesn't take much time to solve. But sometimes when the instances are large GLPK takes few minutes to solve the instance. Now what if the user wants to interrupt the solver and not continue the solution
 process. I have tried to find out how to stop the solver while it is still running but no luck. I have tried to stop the java thread that starts GLPK solver native thread but it didn't help. Is there any API call or any specific method to interrupt the solver? I would highly appreciate any help.You can limit the solution time. I'm not sure about jni (since neverused it); however, in c this can be attained by the following call:lpx_set_real_parm(prob, LPX_K_TMLIM, tmlim);where tmlim is the time limit, in secs, of double type.
	
		Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously low rates.___
Help-glpk mailing list
Help-glpk@gnu.org
http://lists.gnu.org/mailman/listinfo/help-glpk


Re: [Help-glpk] interrupt glpk using JNI

2006-04-19 Thread Andrew Makhorin
 Thanks for your quick response but unfortunately this solution
  doesn't apply in this case. I want to let the user decide whether
  he wants to interrupt/cancel the solution process or not, and when.
  To be precise in the GUI I want to provide the cancel button once
  the solution is in progress. The time limit can be set only before
  the solution process begins. Once the solver starts solving the
  process, settting this parameter doesn't help(I actually tried it).
  Any other suggestions?

Do you want just to terminate the solver obtaining no results or
you want the solver to correctly finish its job?




___
Help-glpk mailing list
Help-glpk@gnu.org
http://lists.gnu.org/mailman/listinfo/help-glpk


Re: [Help-glpk] interrupt glpk using JNI

2006-04-19 Thread faheem hussain
I just want to terminate without getting any results.Andrew Makhorin [EMAIL PROTECTED] wrote:  Do you want just to terminate the solver obtaining no results oryou want the solver to correctly finish its job?
		Blab-away for as little as 1ยข/min. Make  PC-to-Phone Calls using Yahoo! Messenger with Voice.___
Help-glpk mailing list
Help-glpk@gnu.org
http://lists.gnu.org/mailman/listinfo/help-glpk


Re: [Help-glpk] interrupt glpk using JNI

2006-04-19 Thread Andrew Makhorin
 I just want to terminate without getting any results.

The best way is to run the solver as a separate process; then you
can terminate it at any time using an appropriate system function
like kill() (in Linux) or TerminateProcess() (in Windows).
However, I am not familiar with details of how jni is implemented.

Andrew Makhorin



___
Help-glpk mailing list
Help-glpk@gnu.org
http://lists.gnu.org/mailman/listinfo/help-glpk