Hi Christian, The problem in a nut shell is:
I have two arrays of integer variables, Array1[x] and Array2[x]. I want to use the value assigned to the variables in Array1[] as an index of Array2[], something like this: rel(*this, Array2[Array1[x].val()] + (something) <= Array2[x+1]); Is there anything wrong with the above constraint or should this work? Best regards, Wajid On Mon, Feb 20, 2012 at 4:55 PM, Christian Schulte <[email protected]> wrote: > Sorry but I have to admit that I do not understand your problem. What is > it what you are trying to do, really?**** > > ** ** > > Christian**** > > ** ** > > --**** > > Christian Schulte, www.ict.kth.se/~cschulte/**** > > ** ** > > *From:* [email protected] [mailto:[email protected]] *On > Behalf Of *Wajid Hassan > *Sent:* Friday, February 17, 2012 9:40 AM > *To:* [email protected] > *Subject:* [gecode-users] Conditional constraints ?**** > > ** ** > > Hi,**** > > ** ** > > I am a beginner user working on finding an optimal solution for a binding, > scheduling and routing problem. I have done the binding and scheduling > part, and now have some questions regarding the routing dependencies, i.e., > if they can be expressed in gecode or not. This might be something trivial, > but I haven't figured it out yet.**** > > ** ** > > I run the Gecode model and find the appropriate binding (decision of which > task should be assigned to which resource), this is stored in an > IntVarArray _binding. **** > > ** ** > > The routing part depends on the binding, i.e., it considers two tasks T1 > and T2, and as per the application, lets say that the output of T1 needs to > go to the input of T2. To assign the data coming out of T1 to an > appropriate link on the network so that it reaches T2, we need to know the > resources to which T1 and T2 were bound. As I stated above, this > information is itself found out by the Gecode model and stored in an > IntVarArray _binding. **** > > ** ** > > Now, I cannot figure out a way to check the value of an IntVarArray > _binding and use it to constrain another IntVarArray. A naive approach is > the if else, which cannot be applied on a constraint variable since it has > not been assigned a value yet. Any suggestions would be highly appreciated. > **** > > ** ** > > BR/ Wajid**** >
_______________________________________________ Gecode users mailing list [email protected] https://www.gecode.org/mailman/listinfo/gecode-users
