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/io/ampl.py

    r1772 r1794  
    2929           filename = model.name + ".nl"
    3030        OUTPUT=open(filename,"w")
    31         variable_map = self._print_model_NL(model,OUTPUT)
     31        symbol_map = self._print_model_NL(model,OUTPUT)
    3232        OUTPUT.close()
    33         return filename, variable_map
     33        return filename, symbol_map
    3434
    3535    def _get_bound(self, exp):
     
    5050        # in the NL format. however, we by convention make them go from
    5151        # x0 upward.
    52         variable_map = {}
     52        symbol_map = {}
    5353
    5454        #
     
    283283                  print >>OUTPUT, "3",
    284284                if ndx is not None:
    285                    print >>OUTPUT, " # V"+str(nv)+"  "+str(var)+"["+str(ndx)+"]"
    286                    variable_map["V"+str(nv)] = (str(var)+"["+str(ndx)+"]")                   
     285                   print >>OUTPUT, " # v"+str(nv)+"  "+str(var)+"["+str(ndx)+"]"
     286                   symbol_map["v"+str(nv)] = (str(var)+"["+str(ndx)+"]")                   
    287287                else:
    288                    print >>OUTPUT, " # V"+str(nv)+"  "+str(var)
    289                    variable_map["V"+str(nv)] = str(var)
     288                   print >>OUTPUT, " # v"+str(nv)+"  "+str(var)
     289                   symbol_map["v"+str(nv)] = str(var)
    290290
    291291                nv += 1
     
    332332                                   print >>OUTPUT, p[1].id, p[0]
    333333
    334         return variable_map
     334        return symbol_map
    335335
    336336problem.WriterRegistration(str(ProblemFormat.nl), ProblemWriter_nl)
Note: See TracChangeset for help on using the changeset viewer.