Changeset 2154


Ignore:
Timestamp:
Jan 12, 2010 4:53:26 PM (11 years ago)
Author:
jwatson
Message:

Added --report-solutions and --report-weights to runph.

Location:
coopr.pysp/trunk/coopr/pysp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • coopr.pysp/trunk/coopr/pysp/ph.py

    r2153 r2154  
    566566      # PH reporting parameters
    567567      self._verbose = False # do I flood the screen with status output?
     568      self._report_solutions = False # do I report solutions after each PH iteration?
     569      self._report_weights = False # do I report PH weights prior to each PH iteration?
    568570      self._output_continuous_variable_stats = True # when in verbose mode, do I output weights/averages for continuous variables?
    569571      self._output_solver_results = False
     
    678680         elif key == "verbose":
    679681            self._verbose = kwds[key]
     682         elif key == "report_solutions":
     683            self._report_solutions = kwds[key]
     684         elif key == "report_weights":
     685            self._report_weights = kwds[key]                       
    680686         elif key == "output_times":
    681687            self._output_times = kwds[key]
     
    14401446      self.update_variable_statistics()     
    14411447
    1442       if self._verbose is True:
     1448      if (self._verbose is True) or (self._report_solutions is True):
    14431449         print "Variable values following scenario solves:"
    14441450         self.pprint(False,False,True,False)
     
    14791485         print "Initiating PH iteration=" + `self._current_iteration`         
    14801486
    1481          if self._verbose is True:
     1487         if (self._verbose is True) or (self._report_weights is True):
    14821488            print "Variable averages and weights prior to scenario solves:"
    14831489            self.pprint(True,True,False,False)
     
    14981504         self.update_variable_statistics()
    14991505         
    1500          if self._verbose is True:
     1506         if (self._verbose is True) or (self._report_solutions is True):
    15011507            print "Variable values following scenario solves:"
    15021508            self.pprint(False,False,True,False)
  • coopr.pysp/trunk/coopr/pysp/ph_script.py

    r2153 r2154  
    4545                  action="store_true",
    4646                  dest="verbose",
     47                  default=False)
     48parser.add_option("--report-solutions",
     49                  help="Always report PH solutions after each iteration. Enabled if --verbose is enabled. Default is False.",
     50                  action="store_true",
     51                  dest="report_solutions",
     52                  default=False)
     53parser.add_option("--report-weights",
     54                  help="Always report PH weights prior to each iteration. Enabled if --verbose is enabled. Default is False.",
     55                  action="store_true",
     56                  dest="report_weights",
    4757                  default=False)
    4858parser.add_option("--model-directory",
     
    472482                              output_solver_results=options.output_solver_results, \
    473483                              verbose=options.verbose, \
     484                              report_solutions=options.report_solutions, \
     485                              report_weights=options.report_weights, \
    474486                              output_times=options.output_times, \
    475487                              disable_warmstarts=options.disable_warmstarts,
Note: See TracChangeset for help on using the changeset viewer.