Ticket #4347 (new defect)

Opened 6 years ago

Last modified 6 years ago

Conceptual issue / flaw with Params and mutability

Reported by: jwatson Owned by: unassigned
Priority: normal Milestone: Pyomo 4.x
Component: pyomo.core Version:
Keywords: Cc:


One of our users reported an issue with Params, which really needs to be fixed. The situation is as follows. There is a model with a Param, declared something like:

model.foo = Param(model.a, model.b, model.c, default=0.0)

When executing the model, all works well. However, based on the previous solution, this user wanted to modify the value of some Param[a,b,c] values to non-defaults. This works fine, but unfortunately, the results will never propagate through to constraints or objectives that use this param - because all instances point to the ParamVal? associated with the default!

This is a major conceptual problem, which needs to be fixed - we obviously need to support such behaviors. One fix is to only allow defaults is a Param is immutable.

Change History

comment:1 Changed 6 years ago by jdsiiro

The Param rework ([5803:5805]) should have resolved this issue. I do not, however have a test to verify it, so I will leave this ticket open for the time being.

comment:2 Changed 6 years ago by gabeh

The mutability testes for indexed params test against this issue. I believe it is safe to close this ticket.

comment:3 Changed 6 years ago by jwatson

  • Milestone changed from Coopr 3.2 to Coopr 3.x
Note: See TracTickets for help on using tickets.