Changeset 2096


Ignore:
Timestamp:
Jan 2, 2010 12:57:59 AM (10 years ago)
Author:
wehart
Message:

Setup labeling for objectives.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.pyomo/trunk/coopr/pyomo/presolve/generic_varlabels.py

    r2052 r2096  
    99#  _________________________________________________________________________
    1010
    11 from coopr.pyomo.base import IPyomoPresolver, IPyomoPresolveAction, Var, Constraint
     11from coopr.pyomo.base import IPyomoPresolver, IPyomoPresolveAction, Var, Constraint, Objective
    1212import pyutilib.plugin.core
    1313
     
    8989                con._data[C].label = self._name_fix( con._data[C].name )
    9090                model._name_conmap[ con._data[C].label ] = con._data[C]
     91        Objs = model.active_components(Objective)
     92        for obj in Objs.values():
     93            for O in obj._data:
     94                obj._data[O].label = self._name_fix( obj._data[O].name )
     95                model._name_objmap[ obj._data[O].label ] = obj._data[O]
    9196        return model
    9297           
Note: See TracChangeset for help on using the changeset viewer.