Originally posted by: SystemAdmin
[agus said:]
Hi I have a problem in setting the filtering condition for a constraint.
Here is my problem:
{int} Nodes = {1,2};
tuple flight {
key string flightID;
{int} runwayEntrance;
};
{flight} Flights = {<",{1}>, <",{1}>, <",{2}>};
dvar int+ x[Flights][Nodes] in 0..1;
From the above situation, I am trying to produce the following constraints:
(i) X[f1][1] + x[f2][1] == 1
(ii) X[f3][2] == 1
I tried the following:
forall(u in Nodes)
sum(i in Flights) x[i][u] == 1;
But this is what I got:
(i) X[f1][1] + x[f2][1] + x[f3][1] == 1
(ii) X[f1][2] + x[f2][2] + X[f3][2] == 1
Could someone help me with this?
Thanks
Agus
#DecisionOptimization#OPLusingCPLEXOptimizer