Re: [eclipse-clp-users] Multiple Value Ordering

From: <hsimonis_at_...70...>
Date: Sat, 6 Feb 2010 20:18:28 -0000
Hi,
 in one call of the search predicate you can only call one built-in
strategy, but you can just call search twice, first for your Vars1 list,
and then for your Vars2 list, and use different stategies in there.
Alternative, you can define your own value assignment predicate which
switches depending on some additional information you keep with each
variable.

Helmut

>
> Hello CLP people,
>
> Is it possible to use more than one value-ordering heuristic in search/6?
>
> In (dummy) example [1], I have two lists of variables: Vars1 and Vars2.
> Currently, I search for Goal by labeling variables in both lists in
> indomain_min fashion. Let's say that I know a priori that the optimal
> solution is found faster if variables in Vars1 are labelled indomain_min
> and variables in Vars2 are labelled indomain_max. I want to search for
> Goal by using value choice "indomain_min over Vars1" and value choice
> "indomain_max over Vars2". Is there any way to achieve this behaviour in
> Eclipse?
>
> Amine.
>
> [1]
> :-lib(ic).
> :-lib(branch_and_bound).
> :-lib(lists).
>
> solve(Goal):-
>     Vars1 = [X1, X2, X3],
>     Vars2 = [Y1, Y2, Y3],
>     Vars1 #:: [1..10],
>     Vars2 #:: [1..10],
>     append(Vars1, Vars2, Vars),
>     Goal #= Y1 + Y2 + Y3 - X1 - X2 - X3,
>     bb_min(search(Vars,0,input_order,indomain_min,complete,[]),Goal,bb_options{timeout:1}).
>
>
>
>
>
>
>
>  		 	   		  ------------------------------------------------------------------------------
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the
> business
> Choose flexible plans and management services without long-term contracts
> Personal 24x7 support from experience hosting pros just a phone call away.
> http://p.sf.net/sfu/theplanet-com_______________________________________________
> ECLiPSe-CLP-Users mailing list
> ECLiPSe-CLP-Users_at_lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/eclipse-clp-users
>
Received on Sat Feb 06 2010 - 20:18:53 CET

This archive was generated by hypermail 2.3.0 : Tue Apr 16 2024 - 09:13:20 CEST