A bit new to julia, and JuMP. I wanted to define variables in a loop i.e x_i for some loop index i. For example.
for i=1:10
@variable(m, x_i[1:100], bin)
end
and then reference x_i as needed, just as I would normally (without a loop) use x_1 if I hard coded it in constraints, objective etc. Effectively here, I would like to not have to hardcode.
From the documentation:
@variable(model, expr, args..., kw_args...)
Looks like you pass an expression, but its not clear how I would do this/if it is possible. Also it would be useful to know if I can do this, what the syntax is to reference the x_i created in the loop appropiatley in constraints, objectives, etc.
Any feedback would be greatly appreciated.
Thank you.