I calculated a machine scheduling problem using docplex in python. I obtained one of the decision variable as:
yib | solution |
---|---|
y_0_1 | 1 |
y_1_2 | 1 |
y_2_1 | 1 |
y_3_1 | 1 |
y_4_1 | 1 |
Since I wanted to use this values in another calculation I used this code:
ySol = [y[i,b].solution_value for i in range(0,J) for b in range(1,B)]
Then, I tried to use ySol in my constraints.
***my first question is, this code is true code to take the decision variable?
after I added ySol in the second calculation I took this error:
"TypeError: list indices must be integers or slices, not tuple"
I tried some alternative ways but I've not solved the tuple problem yet.
***my second question is, how can I solve this error?
thank you in advance!