<br>i have one constraint that i dont know how model, ie, inside of my constrainr i want to subtraction the elements of a set with one's data's, for example <br><br>MP_set V; // set of vertices<br>MP_set F; // set of frequencies<br>
<br>MP_subset<1> vert(V);<br>MP_subset<1> freq(F);<br><br>vert.insert(1); ... vert.insert(3);<br>freq.insert(16); freq.insert(30); ... freq.insert(916);<br><br>MP_subset<2> <br>Eeq(I,I), // Arc between the vertice vi and vj for Equation<br>
Ein(I,I); // Arc between the vertice vi and vj for Innequation<br><br>MP_data <br>deq(Eeq), // distance between the vertice vi and vj for Equation<br>din(Ein); // distance between the vertice vi and vj for Innequation<br>
<br>MP_subset<2> vertFreq(I,F);<br>forall(varD(v,do1)*dom_i(do1,f), vertFreq.insert(v,f)); // Assign the frequencies to each vertice <br><br>MP_binary_variable Xvf(vertFreq), y(freq);<br><br>MP_constraint <br>assignOneFreq(vert), // only one freq to every vertice<br>
freqToAllVert(freq), // freq could be to assign to all the vertices<br>cstToVertEeq(freq,Eeq), // assign two freq which |f +- g| = d(E(vi,vj))<br><br>// MY CONSTRAINTS<br><br>assignOneFreq(vert(v)) = sum(freq(f), Xvf(vertFreq(v,f))) == 1;<br>
<br>freqToAllVert(freq(f)) = sum(vert(v), Xvf(vertFreq(v,f))) <= I.size()*y(freq(f)); <br><br>// ************** THIS IS MY PROBLEM, I DONT KNOW HOW BUILD THIS ***********<br>// I WANT TO DO IS: <br>/* <br>assign to frequency "f" to a vertice "vi" or "vj" if for all "f" that belong to the set of Frequencies and for two vertices adjacents "vi" or "vj" that belong to the set of Vertices, exits one constraint that satisfed: to assign "f" to "vi" or "vj" only if the frequency had one distance to them of more o minus "dij" ( ie, f +- d(E(vi,vj) )<br>
*/<br><br>cstToVertEeq(freq(F), Eeq(vi,vj)) = Xvf(vertFreq(vj,F)) == Xvf(vertFreq(vi, F-deq(Eeq(vi,vj)) )) + Xvf(vertFreq(vi, F+deq(Eeq(vi,vj)) ));<br><br>// THIS CONSTRAINT "cstToVertEeq" IN THE VERSION 1.0.2 REPORT ME ONE ERROR, <br>
<br>please help me to correct this constraint, Its very important i dont have time <br><br>Thank<br><br>