Permettre d'annuler l'opération de recherche d'une planification
Original reporter: ikus060
Created At: 2012-09-11 13:10:10
Le système doit permettre à l'usager d'annuler la recherche d'une planification via l'affichage de la progression. Pour mettre en place ce mécanisme avec GLPK, voici quelque directives:
Hello Marc,
in the callback function you can use glp_ios_terminate(tree) to stop the branch and bound search.
In the terminal listener or in the callback function you can use function glp_error to abort GLPK.
You should use glp_error_hook to safely exit glp_intopt.
This is the coding I use in GLPK for Java for this purpose:
...
jmp_buf glp_java_env;
if (setjmp(glp_java_env)) {
printf "function glp_intopt failed");
} else {
glp_error_hook(glp_java_error_hook, &glp_java_env);
glp_intopt(...);
}
glp_error_hook(NULL, NULL);
...
void glp_java_error_hook(void *in) {
/* free GLPK memory */
glp_free_env();
/* safely return */
longjmp(*((jmp_buf*)in), 1);
}
Best regards
Xypron