Closed Brad73 closed 3 years ago
This is a pure python issue. In your generator expression, if i,j in A
is malformed.
A
is a list of tuples, so you want i,j
to be a tuple. The right expression is: if (i,j) in A
Note: if all you do on 'm' and 'n' is iterating over the list, your code will be more efficient if you just write:
m = range(1,8)
n = range(1,11)
Likewise, unless you need A
as a list, if all you do is check that tuples are in A
, use a set.
Thanks for the help.
Hi,
I require a help. I am getting an error when trying to place an
if
condition inside this constraint:Error:
Tried several times but couldn't resolve this.
For this model, the variables were defined as:
and the decision variables are:
It would be of great help if you could provide a solution to appropriately construct this constraint. Many THANKS.