Changeset 3989


Ignore:
Timestamp:
04/10/11 16:07:13 (3 years ago)
Author:
wehart
Message:

This will suppress output for the final solution if the --quiet flag
is specified.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.pyomo/trunk/coopr/pyomo/scripting/util.py

    r3903 r3989  
    554554            results_file = 'results.yml' 
    555555        results.write(filename=results_file) 
    556         print "    Number of solutions:", len(results.solution) 
    557         if len(results.solution) > 0: 
    558             print "    Solution Information" 
    559             print "      Gap:",results.solution[0].gap 
    560             print "      Status:",results.solution[0].status 
    561             if len(results.solution[0].objective) == 1: 
    562                 key = results.solution[0].objective.keys()[0] 
    563                 print "      Function Value:",results.solution[0].objective[key].value 
    564         print "    Solver results file:",results_file 
     556        if not options.quiet: 
     557            print "    Number of solutions:", len(results.solution) 
     558            if len(results.solution) > 0: 
     559                print "    Solution Information" 
     560                print "      Gap:",results.solution[0].gap 
     561                print "      Status:",results.solution[0].status 
     562                if len(results.solution[0].objective) == 1: 
     563                    key = results.solution[0].objective.keys()[0] 
     564                    print "      Function Value:",results.solution[0].objective[key].value 
     565            print "    Solver results file:",results_file 
    565566    # 
    566567    ep = ExtensionPoint(IPyomoScriptPrintResults) 
Note: See TracChangeset for help on using the changeset viewer.