Dear Jonathan,
The simplest solution is to "drive" the search engine by using an object of
the class Search.object. Here is an implementation of SearchBest, with an
extra argument (MaxTime). It is guaranteed to return the best solution
found after MaxTime milliseconds.
%% return the best solution found within MaxTime milliseconds
proc {SearchBest ScriptP OrderP MaxTime ?Xs}
%% the search engine
Engine={New Search.object script(ScriptP OrderP rcd:5)}
%% iterate through solutions, and return the best solution found
fun {Iterate CurrentSol}
case {Engine next($)} of [X] then
{Iterate [X]}
else
CurrentSol
end
end
in
%% stop the engine after MaxTime
thread
{Time.delay MaxTime} {Engine stop}
end
Xs={Iterate nil}
end
Cheers,
Raphael
On Mon, Jan 4, 2010 at 8:07 PM, Jonathan Vivanco Navarro <
[email protected]> wrote:
> Dear Raphael ColletI would appreciate if you help me with this information
>
>
>
> _________________________________________________________________________________
> mozart-users mailing list
> [email protected]
> http://www.mozart-oz.org/mailman/listinfo/mozart-users
>
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users