[gecode-users] Problem to formulate a constraint
Uwe Nowak
uwe.nowak at itwm.fraunhofer.de
Thu May 23 15:40:20 CEST 2013
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...
More information about the users
mailing list