Hi @odow,
Defining variables using for loop gives me the following error:
using JuMP
model = Model()
for k in 1:10
if demanding_computation(k) == 0
for i in 1:10, j in 1:10
@variable(model, x[i,j,k])
end
end
end
This gives me the following error:
ERROR: An object of name x is already attached to this model. If this
is intended, consider using the anonymous construction syntax, e.g.,
`x = @variable(model, [1:N], ...)` where the name of the object does
not appear inside the macro.
Alternatively, use `unregister(model, :x)` to first unregister
the existing name from the model. Note that this will not delete the
object; it will just remove the reference at `model[:x]`.
Any way around this (I still want to use for loop)? Thanks!