[eclipse-clp-users] constraint on indexed elements

From: Benoit Hoessen <b.hoessen_at_...6...>
Date: Wed, 24 Feb 2010 11:33:32 +0100
Hello,

I am currently learning to use eclipse and I'm facing a problem. I
have a list of couples that needs to be ordered according some
constraints. I tried the following model:

ArrayCouples is the array of my couples [Couple0, Couple1, ... ]
NbCouples is the number of couples
OrderedList is a list of integers where each integer represent the
index of a Couple in ArrayCouples. Those integers are the variables of
my problem and their domain is [0..NbCouples - 1]

And the constraints should be (with a c-like syntax)
for (i = 0 ; i < NbCouples-2; i++){
    CoupleA = ArrayCouples[i];
    CoupleB = ArrayCouples[i+1];
    //constraint on the element of CoupleA & CoupleB
}

But it seems that I can't model this with eclipse with my current
knowledge or it's not the way I should model my problem.

Can somebody tell me what my error is?

Benoit Hoessen
Received on Wed Feb 24 2010 - 10:33:40 CET

This archive was generated by hypermail 2.2.0 : Mon Jul 09 2018 - 02:05:29 CEST