Hi,
is there a way to merge two optimization models?
I have to ConcreteModel instances and I would like to merge all constraints etc. into one optimization model.
The objective will be set new. As there might be the same naming for some of the attributes for the two models,
I thought of somehow using the Block() functionalities of pyomo.
# Abstract example:
m1 = ConcreteModel()
m1.constr1 = Constraint(...)
...
m2 = ConcreteModel()
m2.constr1 = Constraint(..)
...
# delete objectives
m1.del_component('objective')
m2.del_component('objective')
# magically merge the two problems:
m =m1 + m2 ????
# set new objective
m.objective = (...)
I hope the example is concrete enough to understand...