Fix constraint to allow empty cells
This commit is contained in:
parent
c5c1391679
commit
fc1d2eb792
1 changed files with 1 additions and 1 deletions
|
@ -51,7 +51,7 @@ function definemodel(plantcounts::Vector, mask::Matrix, costs::Matrix)
|
||||||
)
|
)
|
||||||
|
|
||||||
for i = 1:N
|
for i = 1:N
|
||||||
@constraint(model, sum(x[i, q] for q = 1:Q) == 1)
|
@constraint(model, sum(x[i, q] for q = 1:Q) <= 1)
|
||||||
if mask[i] == 0
|
if mask[i] == 0
|
||||||
for q = 1:Q
|
for q = 1:Q
|
||||||
@constraint(model, x[i, q] == 0)
|
@constraint(model, x[i, q] == 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue