Hi!
(Sorry for so much questions on var indexes..)

No problem.

I have an IntVar, say I, to specify an index of a VarArray and
I want to post some constraints (like element, linear) for indexes between 0(zero) and I.

is there a way to express;

if (current_index < I ) then element(....) + linear(....)

And generally speaking, I cant see the way to tell the
if___then___ structure.

You can model this using reified constraints and Boolean implication:

        BoolVar b0(this, 0, 1);
        BoolVar b1(this, 0, 1);
        rel(this, I, IRT_GR, current_index, b0);
        linear(...., b1);
        rel(this, b0, BOT_IMP, b1, 1);

However, there is no reified version of element, you'll have to express that in a different way.

Cheers,
        Guido


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

Reply via email to