Thanks Matthew and Helmut, So far, 1) I can use Matthew's trick (from previous response to this thread) which will only work with indomain_min, indomain_max. 2) Use search/6 twice as suggested by Helmut e.g. bb_min( ( search(Vars1,0,input_order,indomain_min,complete,[]),Goal,bb_options{timeout:1}, search(Vars2,0,input_order,indomain_max,complete,[]),Goal,bb_options{timeout:1} ). I don't know what happens here at runtime though. Are all variables Vars1 assigned before all variables Vars2? If I have variables V1, V2, V3 that I want to assign in this order such that values of V1 are chosen indomain_min, values of V2 are chosen indomain_max, and values of V3 are chosen indomain_min, do I have to use 3 search/6 predicates? Or is the evaluation of the search/6 predicates parallel somehow, in which case, only two search/6 are needed? 3) Use a user-defined predicate e.g. search(Vars,0,input_order,my_value_ordering,complete,[]),Goal,bb_options{timeout:1} my_value_ordering(X):- X is in Vars1 and indomain(X, min). my_value_ordering(X):- X is in Vars2 and indomain(X, max). My question, will (2) and (3) have same search space? Also, will it be possible to show me a quick example on how the value assignment predicate "switches depending on some additional information you keep with each variable." Many thanks. > Date: Sat, 6 Feb 2010 20:18:28 +0000 > Subject: Re: [eclipse-clp-users] Multiple Value Ordering > From: hsimonis_at_...70... > To: cyborgamine_at_...32... > CC: eclipse-clp-users_at_lists.sourceforge.net > > 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:52:29 CET
This archive was generated by hypermail 2.3.0 : Wed Sep 25 2024 - 15:13:20 CEST