I’m trying to use a tuple of strings for indexing a variable (in JuMP). I’m able to loop, etc. but can’t figure out how index a single element. Example, Products is my index tuple, x is my variable.
julia> x
1-dimensional DenseAxisArray{VariableRef,1,…} with index sets:
Dimension 1, (“Product1”, “Product2”, “Product3”, “Product4”)
And data, a 4-element Vector{VariableRef}:
x[Product1]
x[Product2]
x[Product3]
x[Product4]
julia>
I want to write x[“Product2”], but this does not work. x[Products[2]] works, but I want to use the actual name, “Product2”.