Ignore:
Timestamp:
Apr 22, 2009 5:48:18 PM (12 years ago)
Author:
wehart
Message:

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.

Notes:

. 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).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/coopr/pyomo/base/plugin.py

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