Hi!

> Thanks for the advice, it works smooth now.
> But one last question about the Var equalities.
>
> suppose Var A, B and an integer array I
> Let A to be the one possible values of index i where  B=I[i]

I'm not sure I understand completely what you mean by possible
values. If you just mean I[A]=B, then you can use element(this, I, A,   B).

> sth like;
> for all indexes i
> if " A equals I[i]" then "B can be assigned to i"
>
> but I couldnot find a way to imply the equality of VAR&Intger on  
another VAR's possible values.

You swapped A and B now, right? In you original statement it read "if   B
equals I[i] then A can be assigned to i". What you describe is just   half
of what element does. Is there anything wrong in your model   about the
inference "if A cannot be assigned to i, then B does not   equal I[i]"
(i.e., the contraposition)? This is something you can   implement using
reified constraints. However, if this does not hold   for your model,
something's fishy ;-)

Cheers,
        Guido

-- 
Guido Tack
Programming Systems Lab, Saarland University, Germany
http://www.ps.uni-sb.de/~tack
Hi!

Thanks for the advice, it works smooth now.
But one last question about the Var equalities.

suppose Var A, B and an integer array I
Let A to be the one possible values of index i where  B=I[i]

I'm not sure I ! understand completely what you mean by possible values. If you just mean I[A]=B, then you can use element(this, I, A, B).

sth like;
for all indexes i
if " A equals I[i]" then "B can be assigned to i"

but I couldnot find a way to imply the equality of VAR&Intger on another VAR's possible values.

You swapped A and B now, right? In you original statement it read "if B equals I[i] then A can be assi! gned to i". What you describe is just half of what element does. Is th ere anything wrong in your model about the inference "if A cannot be assigned to i, then B does not equal I[i]" (i.e., the contraposition)? This is something you can implement using reified constraints. However, if this does not hold for your model, something's fishy ;-)

Cheers,
Guido

-- 
Guido Tack
Programming Systems Lab, Saarland University, Germany



_______________________________________________
Gecode users mailing list
[EMAIL PROTECTED]
https://www.gecode.org/mailman/listinfo/gecode-users

Reply via email to