I want to convert GAMS code to Julia JuMP, and I have problems dealing with the sets in GAMS.
Here is the constraint in GAMS: eDemIR(d)… demIReal(d) + sum(l,line2dem(l,d)*lineIReal(l)) =e= 0;
l, d are sets in GAMS. l = [1,2,3] and d = [1,2,3,4,5]
What is the proper way of converting this to JuMP?
Thanks!
This is how I tried to define every set in the constraint: D = [1,2,3,4,5] L = [1,2,3] @constraint(model, eDemIR[d in D], demIReal[d in D] + sum(line2dem[l, d] * lineIReal[l] for l in L) == 0)
In Jump "sets" are just standard indexes that you use for your data and/or variables... can be positions if you use arrays, or keys if you use dictionaries.
Have a look at my tutorial where I translate to Jump the classical Gams
transporttutorial:https://lobianco.org/antonello/personal/blog/2017/0203_jump_for_gams_users