Changeset 4145


Ignore:
Timestamp:
05/31/11 08:35:55 (3 years ago)
Author:
dword
Message:

nl writer changed to initialize from .value not .initial

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.pyomo/trunk/coopr/pyomo/io/ampl.py

    r4138 r4145  
    423423        n_var_inits = 0 
    424424        for (var_name, var) in Vars.iteritems(): 
    425             if var.initial != None: 
     425            if var.value is not None: 
    426426                n_var_inits += 1 
     427            else: 
     428                assert(var.initial is None) 
    427429 
    428430        print >>OUTPUT, "x" + str(n_var_inits) 
    429431        for var_name in Vlist: 
    430432            var = Vars[var_name] 
    431             if var.initial != None: 
    432                 print >>OUTPUT, str(var.ampl_var_id) + " " + str(var.initial) + " # " + var_name + " initial" 
     433            if var.value is not None: 
     434                print >>OUTPUT, str(var.ampl_var_id) + " " + str(var.value) + " # " + var_name + " initial" 
    433435 
    434436        # 
Note: See TracChangeset for help on using the changeset viewer.