Changeset 1414 for trunk/test/plugins

Jul 14, 2009 10:25:27 PM (11 years ago)

A major rework of the Pyomo core. This change eliminates the use
of getattr and setattr methods. Removing these led to a 1/3 reduction
in runtime for some largish p-median test problems.

While revising the tests, I noted that this change has had the following

. No validation that values assigned to parameters or variables are valid

. Cannot set all suffixes simultaneously

. Cannot set lower/upper bounds simultaneously

. No validation that suffixes are valid when their value is set

I think that these are important usability issues. The use of the get/set
attribute methods was intended to protect users from simple mistakes. For
example, a user can now type:

model.x.fixed = 1

which may or may not work as intended. Logically, fixed should be
a boolean value.

John Siirola suggested that I enable a 'protected' mode, which
reintroduces these mechanisms when a global variable is set. I'll put
that on the TODO list...

Also, this effort led to a rework of the Param and Var classes. These
are now segregated between Element and Array classes (similar to the
Set class). This led to further optimizations of the logic in these
classes. Unfortunately, it also led to the use of the _VarBase and
_ParamBase in the PyomoModel? to index components. I'll try to revisit
that sometime soon...

8 edited

Note: See TracChangeset for help on using the changeset viewer.