Ignore:
Timestamp:
Nov 3, 2009 12:09:49 PM (11 years ago)
Author:
wehart
Message:

Misc bug fixes that were introduced by the introduction of variable_map
data, which is now called symbol_map.

Note: some tests still fail, due to the fact that pico_convert does not
generate symbol mapping information. This is being resolved.

File:
1 edited

Legend:

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

    r1772 r1794  
    7474    def num_used_variables(self):
    7575        return len(self._var)
    76 
    77 
    78     #def variable_map(self):
    79         #return self._varmap
    8076
    8177
     
    232228              raise ValueError, "Cannot load a SolverResults object with bad status: "+str(arg.solver.status)
    233229           if len(arg.solution) > 0:
    234               self._load_solution(arg.solution(0),variable_map=arg.variable_map)
     230              self._load_solution(arg.solution(0),symbol_map=arg.symbol_map)
    235231              return True
    236232           else:
     
    288284            raise err
    289285
    290     def _load_solution(self,soln, variable_map=None):
     286    def _load_solution(self,soln, symbol_map=None):
    291287        """
    292288        Load a solution.
     
    301297          if name != "ONE_VAR_CONSTANT":
    302298             # translate the name first if there is a variable map associated with the input solution.
    303              if variable_map is not None:
    304                  name = variable_map[name]
     299             if symbol_map is not None:
     300                 name = symbol_map[name]
    305301             if name not in self._name_varmap:
    306302                names=""
     
    328324        if problem_writer is None:
    329325           raise ValueError, "Cannot write model in format \"" + str(format) + "\": no model writer registered for that format"
    330         (fname, variable_map) = problem_writer(self, filename)
     326        (fname, symbol_map) = problem_writer(self, filename)
    331327        if pyomo.debug("verbose"):
    332328           print "Writing model "+self.name+" to file '"+str(fname)+"'  with format "+str(format)
    333         return fname, variable_map
     329        return fname, symbol_map
    334330
    335331
Note: See TracChangeset for help on using the changeset viewer.