Thanks a lot. That was very helpful. But now I have another doubt. I'm running a series of tests and saving the results into a file. However, I've been unable to save the cpu time it took the program to find the best solution. How can I do that? On Wed, 6 Aug 2003, Joachim Schimpf wrote: > Pedro Leite Rocha wrote: > > > > Hello. I'm new at usinge eclipse, and I have this problem I wanna solve. I > > want my computer to try finding the best solution for 5 hours max, but I'm > > having some trouble with the timeout library. The program I wrote gives me > > the solution in two arrays of two dimensions. I want the program to give > > me the last solution it found. How do I do that? > > > It depends a bit on what solvers you are using. If you use fd or ic, > the easiest is to use lib(branch_and_bound), which has a timeout option: > > :- lib(ic). > :- lib(branch_and_bound). > > ?- X::0..10000000, > Cost #= -X, > bb_min(labeling([X]), Cost, bb_options with [timeout:1]). > > Found a solution with cost 0 > Found a solution with cost -1 > ... > Found a solution with cost -247 > Branch-and-bound timeout! > X = 247 > Cost = -247 > Yes (0.58s cpu) > > The branch-and-bound procedure bb_min keeps finding better solutions > until the timeout occurs. It then returns the best result so far. > > > -- > Joachim Schimpf / phone: +44 20 7594 8187 > IC-Parc / mailto:J.Schimpf@imperial.ac.uk > Imperial College London / http://www.icparc.ic.ac.uk/eclipse > Temais. / |=====================================| / | | / \ | Pedro Leite Rocha | \___/ | djavan@dcc.ufmg.br | / \ | pedro@ufmg.br | / \ \ / | | \___/ | "Se isto esta vazio, | / \ | isto nao importa." | \ / | (Dickie Fox) | / | | / |=====================================|Received on Mon Aug 11 14:58:28 2003
This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:25 PM GMT GMT