[gecode-users] Problem to formulate a constraint

Christian Schulte cschulte at kth.se
Thu May 23 17:49:07 CEST 2013


Hi,

Did you try reification? While not great, it should not be too hard to pull
this off. Or am I missing something here?

Best
Christian

--
Christian Schulte, Professor of Computer Science, KTH,
www.ict.kth.se/~cschulte/


-----Original Message-----
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Uwe Nowak
Sent: Thursday, May 23, 2013 3:40 PM
To: users at gecode.org
Subject: [gecode-users] Problem to formulate a constraint

I am a beginner with gecode and have a problem to formulate a constraint.
I was looking through all channel constraints, however they do not seem to
fit my needs, or I am unable to formulate my needs in the language of the
channel constraints.

I have the following variables
*an IntVar c with a finite set of values {A_1,...,A_n} *an IntVarArray p

I have the following fixed parameters
For each value A_t I have a finite set of fixed indexed values I_t (e.g, an
std::set<int>)
A constant B

Now I want to formulate the following constraints for(t = 1...n){
	c=A_t  ==> for all I in I_t: p[i]=B
}


I thought to create an IntVarArgs of the subset of p with the indices I_t
However, than I have tor formulated for an IntVarArgs q_t:
for(t = 1...n){
	c=A_t  ==> For all elements q_t[i]=B
}

However, I do not find the right expressions to formulate this in gecode...



_______________________________________________
Gecode users mailing list
users at gecode.org
https://www.gecode.org/mailman/listinfo/gecode-users




More information about the users mailing list