Changeset 3514


Ignore:
Timestamp:
01/20/11 17:47:03 (3 years ago)
Author:
jwatson
Message:

Chaning variable sync_label method to also update the containing model name_varmap, to fix the solution reader.

Location:
coopr.pyomo/trunk/coopr/pyomo/base
Files:
2 edited

Legend:

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

    r3509 r3514  
    6565 
    6666        # cached name-based object lookup data to facilitate fast solution loading. 
    67         # handled by the various objects during construction. 
     67        # handled by the various objects (the items in the map) during construction. 
    6868        self._name_varmap={} # maps labels to _VarValue objects 
    6969        self._name_conmap={} # maps labels to ConstraintData objects 
  • coopr.pyomo/trunk/coopr/pyomo/base/var.py

    r3510 r3514  
    102102        if self.name is not None: 
    103103           self.label = label_from_name(self.name) 
     104           if (self.var is not None) and (self.var.model is not None): 
     105              self.var.model._name_varmap[self.label] = self 
    104106        else: 
    105107           self.label = None 
Note: See TracChangeset for help on using the changeset viewer.