To force DC 1 and DC 2 to be open, you can declare a constraint:
con FixOpen {c in {'DC 1','DC 2'}}:
Y[c] = 1;
Or use the FIX statement:
for {c in {'DC 1','DC 2'}}
fix Y[c] = 1;
To force exactly one potential DC to be open:
con ExactlyOnePotentialOpen:
sum {c in {'Potential DC 3','Potential DC 4','Potential DC 5'}} Y[c] = 1;
Alternatively, you can scan for 'Potential' as the first word in the name:
con ExactlyOnePotentialOpen:
sum {c in CentralWH: scan(c,1) = 'Potential'} Y[c] = 1;
For the other constraints you want, can you please write out the mathematical expressions? The benefit of an optimization modeling language is that the corresponding constraint declarations will look very similar to the mathematics.
... View more