You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These are mainly observations looking at the examples.
The new version of JuMP will make this whole package much easier
You will be able to have something like the following (just making syntax up, not an actual model)
I'm not sure that there is need to support Convex going forward. The new JuMP/MOI is converging towards DCP. This removes a whole heap of the conditional code loading.
The is the approach I would favour is almost identical to Plasmo. There are scoping issues that need to overcome, but these are just Julia problems:
agent_models = [JuMP.Model() for i in1:2]
for agent in1:2# x belongs to agent_model[i]@variable(agent_model[i], x >=0)
@objective(agent_model[i], Min, x)
end# x is now x[2]
emp =EMPModel(agent_models)
# but we can get x[1] via agent_models[1][:x]@empconstraint(emp, sum(m[:x] for m in agent_models) >=1)
solve(emp)
or
agent_models = [JuMP.Model() for i in1:2]
x =Dict{Int, JuMP.Variable}()
for i in1:2
x[i] =@variable(agent_model[i], lower_bound =0)
@objective(agent_model[i], Min, x[i])
end# now we have x[1] and x[2]
emp =EMPModel(agent_models, solver=JAMSDSolver())
@empconstraint(emp, sum(x[i] for i in1:2) >=1)
solve(emp)
It's then up to EMPModel to combine the models on the back end.
Pedantic comments:
A lot of the code design stems from the limitations of the current form of JuMP and MPB. Hence the need for the MOI redesign. The new JuMP NL implementation splits out the linear constraints from the non-linear constraints which should help resolve
General comments:
These are mainly observations looking at the examples.
You will be able to have something like the following (just making syntax up, not an actual model)
or
It's then up to
EMPModel
to combine the models on the back end.Pedantic comments:
A lot of the code design stems from the limitations of the current form of JuMP and MPB. Hence the need for the MOI redesign. The new JuMP NL implementation splits out the linear constraints from the non-linear constraints which should help resolve
EMP.jl/src/EMP.jl
Line 374 in 36d877d
getsolution
etc.EMP.jl/src/EMP.jl
Line 16 in 36d877d
Instead of making new methods, you should import them from MPB and extend them.
using SDDP, JuMP
. You could also look into the https://github.com/simonster/Reexport.jl@constraintMP
et at. macros to@empconstraint
,@empnlconstraint
.EMP.jl/src/EMP.jl
Line 171 in 36d877d
you probably want something like
https://github.com/odow/SDDP.jl/blob/be885b296741b3f3ec89659aea796492290445fc/src/states.jl#L116
The text was updated successfully, but these errors were encountered: