Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConnectorExpander cannot be applied tier-wise in a model #96

Closed
qtothec opened this issue Jan 8, 2017 · 1 comment
Closed

ConnectorExpander cannot be applied tier-wise in a model #96

qtothec opened this issue Jan 8, 2017 · 1 comment

Comments

@qtothec
Copy link
Contributor

qtothec commented Jan 8, 2017

Expected behavior: m.b1.link is expanded by the first apply invocation and m.link is expanded by the second apply invocation.
Actual behavior: the second apply invocation tries to re-expand m.b1.link and raises a RuntimeError.

from pyomo.environ import *
from pyomo.core.base.connector import ConnectorExpander

m = ConcreteModel()
m.b1 = Block()
m.b1.x1 = Var()
m.b1.p1 = Connector()
m.b1.p1.add(m.b1.x1, 'X')
m.b1.x2 = Var()
m.b1.p2 = Connector()
m.b1.p2.add(m.b1.x2, 'X')
m.b1.link = Constraint(expr=m.b1.p1 == m.b1.p2)

xfrm = ConnectorExpander()
xfrm.apply(instance=m.b1)

m.x3 = Var()
m.p3 = Connector()
m.p3.add(m.x3, 'X')
m.link = Constraint(expr=m.b1.p1 == m.p3)
xfrm.apply(instance=m)
@qtothec qtothec added this to To Do [unsorted] in IDAES Priorities Jan 12, 2018
@qtothec qtothec moved this from To Do [default priority] to Medium priority in IDAES Priorities Mar 8, 2018
@dmvigi dmvigi added this to To do in pyomo.core Priorities Apr 10, 2018
@blnicho
Copy link
Member

blnicho commented Aug 3, 2018

Fixed in #583

@blnicho blnicho closed this as completed Aug 3, 2018
IDAES Priorities automation moved this from Medium priority to Done Aug 3, 2018
pyomo.core Priorities automation moved this from To do to Done Aug 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

3 participants