Apr 22, 2009 5:48:18 PM (12 years ago)

Rework of Pyomo to enable preprocessor actions to
manage all post-instance-generation activities. This includes

. New preprocess action classes in the pyomo/preprocess directory

. A simple preprocessor plugin, which simply applies preprocessor

actions in an order specified by the action-specific ranks

. The AMPL and CPXLP writers are no longer subclasses of the

problem_utils class (which will be removed shortly). Thus, these
classes are no longer directly responsible for how preprocessor
actions take place.

. The Constraint and Objective classes were reworked to integrate

their data into a single _data dictionary. This simplified
the management of id and label information.


. The preprocessors insert some data into the model and model data.

for example, variable id's and label's are specified, which are
what is used when writing out data to NL and LP files. Right now,
this is somewhat ad-hoc; I'm looking for a more systematic way
to managed this information.

. The preprocessors are very much tailored to the needs of the NL

and LP writers. We need to figure out a mechanism to tailoring
preprocessors to specific target solvers (e.g. tailoring
preprocessing for the NL writer, or tailoring preprocessing for
MILP models).

1 edited


  • trunk/coopr/pyomo/base/plugin.py

    r1221 r1290  
    1212        'IPyomoSet', 'IModelComponent', 'ComponentRegistration',
    1313        'ComponentFactory',
    14         'IPyomoPresolver']
     14        'IPyomoPresolver', 'IPyomoPresolveAction']
    1616from pyutilib.plugin import *
    1919class IPyomoPresolver(Interface):
     21    def get_actions(self):
     22        """Return a list of presolve actions, in the order in which
     23        they will be applied."""
     25    def activate_action(self, action):
     26        """Activate an action, but leave its default rank"""
     28    def deactivate_action(self, action):
     29        """Deactivate an action"""
     31    def set_actions(self, actions):
     32        """Set presolve action list"""
    2134    def presolve(self, instance):
    22         """Apply the presolver to this instance, and return the
     35        """Apply the presolve actions to this instance, and return the
    2336        revised instance"""
     39class IPyomoPresolveAction(Interface):
     41    def presolve(self, instance):
     42        """Apply the presolve action to this instance, and return the
     43        revised instance"""
     45    def rank(self):
     46        """Return an integer that is used to automatically order presolve actions,
     47        from low to high rank."""
Note: See TracChangeset for help on using the changeset viewer.