Changeset 3022


Ignore:
Timestamp:
Sep 19, 2010 9:48:04 PM (11 years ago)
Author:
jwatson
Message:

Various performance improvements to generic_varlabels.py

File:
1 edited

Legend:

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

    r2359 r3022  
    7070        return tmp
    7171
    72     def preprocess(self,model):
     72    def preprocess(self, model):
    7373        """
    7474        The main routine to perform the preprocess
     
    7979        # variables.
    8080        #
    81         Vars = model.active_components(Var)
    82         for var in Vars.values():
     81        active_variables = model.active_components(Var)
     82        for var in active_variables.values():
    8383            for V in var._varval.keys():
    8484                var._varval[V].label = self._name_fix( var._varval[V].name )
    8585                model._name_varmap[ var._varval[V].label ] = var._varval[V]
    86         Cons = model.active_components(Constraint)
    87         for con in Cons.values():
     86        active_constraints = model.active_components(Constraint)
     87        for con in active_constraints.values():
    8888            for C in con._data:
    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():
     91        active_objectives = model.active_components(Objective)
     92        for obj in active_objectives.values():
    9393            for O in obj._data:
    9494                obj._data[O].label = self._name_fix( obj._data[O].name )
Note: See TracChangeset for help on using the changeset viewer.