Re: [eclipse-users] Question about branch and bound

From: Joachim Schimpf (Independent Contractor) <jschimpf_at_cisco.com>
Date: Tue, 29 Jan 2008 11:07:47 +0000
Dimitris Bilidas wrote:
> Joachim thanks very much for your answer. I've tried what you wrote and it
> works, but when I'm trying to use a predicate to get the cost, I'm getting some
> strange behavior and I can't understand what's wrong.
> 
> What I am trying to do is something like that:
> 
> ...,
>     ( fromto(Board, [Qi|Qs], [Qs], []), foreach(D,Ds) do
>         D #= Qi
>     ),
>     getCost(Ds, Result),
>     Cost #= Result,

What you have written here is exactly equivalent to

      getCost(Board, Cost)

So we need to see your getCost. The key point is that you have
to write getCost using only primitives that do something sensible
(i.e. can propagate information) with uninstantiated variables.
Such primitives are constraints like #=/3, element/3 etc, or suitable
user-defined delayed goals.


>     branch_and_bound:minimize(labeling(Board), Cost).
> 
> Any ideas?
> Thanks in advance (again),
> Dimitris.
> 
> 
> _______________________________________________
> ECLiPSe-Users mailing list
> ECLiPSe-Users_at_crosscoreop.com
> http://www.crosscoreop.com/mailman/options/eclipse-users
Received on Tue Jan 29 2008 - 11:07:59 CET

This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:58 CET