Changeset 3055


Ignore:
Timestamp:
Sep 30, 2010 3:11:13 PM (11 years ago)
Author:
khunter
Message:

Reorganization of the runph command line options into logical
groups. I might've messed up any intentional ordering within the
groups as I also alphabetized the options, so please to correct as
necessary.

Added -m and -i because Joe commented more than once on the
verbosity of the run(ef|ph) command lines.

File:
1 edited

Legend:

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

    r2990 r3055  
    1010
    1111
     12import os
    1213import sys
    13 import os
    14 from optparse import OptionParser
     14
     15from optparse import OptionParser, OptionGroup
    1516
    1617import pyutilib.services
    1718import pyutilib.misc
    18 import textwrap
    19 import traceback
    2019
    2120# garbage collection control.
     
    4342
    4443#
    45 # utility method to construct an option parser for ph arguments, 
     44# utility method to construct an option parser for ph arguments,
    4645# to be supplied as an argument to the runph method.
    4746#
     
    5049
    5150   parser = OptionParser()
    52    parser.add_option("--verbose",
    53                      help="Generate verbose output for both initialization and execution. Default is False.",
    54                      action="store_true",
    55                      dest="verbose",
    56                      default=False)
    57    parser.add_option("--report-solutions",
    58                      help="Always report PH solutions after each iteration. Enabled if --verbose is enabled. Default is False.",
    59                      action="store_true",
    60                      dest="report_solutions",
    61                      default=False)
    62    parser.add_option("--report-weights",
    63                      help="Always report PH weights prior to each iteration. Enabled if --verbose is enabled. Default is False.",
    64                      action="store_true",
    65                      dest="report_weights",
    66                      default=False)
    67    parser.add_option("--report-only-statistics",
    68                      help="When reporting solutions (if enabled), only output per-variable statistics - not the individual scenario values. Default is False.",
    69                      action="store_true",
    70                      dest="report_only_statistics",
    71                      default=False)
    72    parser.add_option("--output-scenario-tree-solution",
    73                      help="Report the full solution (even leaves) in scenario tree format upon termination. Values represent averages, so convergence is not an issue. Default is False.",
    74                      action="store_true",
    75                      dest="output_scenario_tree_solution",
    76                      default=False)
    77    parser.add_option("--model-directory",
    78                      help="The directory in which all model (reference and scenario) definitions are stored. Default is \".\".",
    79                      action="store",
    80                      dest="model_directory",
    81                      type="string",
    82                      default=".")
    83    parser.add_option("--instance-directory",
    84                      help="The directory in which all instance (reference and scenario) definitions are stored. Default is \".\".",
    85                      action="store",
    86                      dest="instance_directory",
    87                      type="string",
    88                      default=".")
    89    parser.add_option("--solver",
    90                      help="The type of solver used to solve scenario sub-problems. Default is cplex.",
    91                      action="store",
    92                      dest="solver_type",
    93                      type="string",
    94                      default="cplex")
    95    parser.add_option("--solver-manager",
    96                      help="The type of solver manager used to coordinate scenario sub-problem solves. Default is serial.",
    97                      action="store",
    98                      dest="solver_manager_type",
    99                      type="string",
    100                      default="serial")
    101    parser.add_option("--scenario-solver-options",
    102                      help="Solver options for all PH scenario sub-problems",
    103                      action="append",
    104                      dest="scenario_solver_options",
    105                      type="string",
    106                      default=[])
    107    parser.add_option("--scenario-mipgap",
    108                      help="Specifies the mipgap for all PH scenario sub-problems",
    109                      action="store",
    110                      dest="scenario_mipgap",
    111                      type="float",
    112                      default=None)
    113    parser.add_option("--ef-solver-options",
    114                      help="Solver options for the extension form problem",
    115                      action="append",
    116                      dest="ef_solver_options",
    117                      type="string",
    118                      default=[])
    119    parser.add_option("--ef-mipgap",
    120                      help="Specifies the mipgap for the EF solve",
    121                      action="store",
    122                      dest="ef_mipgap",
    123                      type="float",
    124                      default=None)
    125    parser.add_option("--solution-writer",
    126                      help="The plugin invoked to write the scenario tree solution. Defaults to the empty list.",
    127                      action="append",
    128                      dest="solution_writer",
    129                      type="string",
    130                      default = [])
    131    parser.add_option("--max-iterations",
    132                      help="The maximal number of PH iterations. Default is 100.",
    133                      action="store",
    134                      dest="max_iterations",
    135                      type="int",
    136                      default=100)
    137    parser.add_option("--default-rho",
    138                      help="The default (global) rho for all blended variables. Default is 1.",
    139                      action="store",
    140                      dest="default_rho",
    141                      type="float",
    142                      default=1.0)
    143    parser.add_option("--rho-cfgfile",
    144                      help="The name of a configuration script to compute PH rho values. Default is None.",
    145                      action="store",
    146                      dest="rho_cfgfile",
    147                      type="string",
    148                      default=None)
    149    parser.add_option("--bounds-cfgfile",
    150                      help="The name of a configuration script to set variable bound values. Default is None.",
    151                      action="store",
    152                      dest="bounds_cfgfile",
    153                      default=None)
    154    parser.add_option("--enable-termdiff-convergence",
    155                      help="Terminate PH based on the termdiff convergence metric. Default is True.",
    156                      action="store_true",
    157                      dest="enable_termdiff_convergence",
    158                      default=True)
    159    parser.add_option("--enable-normalized-termdiff-convergence",
    160                      help="Terminate PH based on the normalized termdiff convergence metric. Default is True.",
    161                      action="store_true",
    162                      dest="enable_normalized_termdiff_convergence",
    163                      default=False)
    164    parser.add_option("--termdiff-threshold",
    165                      help="The convergence threshold used in the term-diff and normalized term-diff convergence criteria. Default is 0.01.",
    166                      action="store",
    167                      dest="termdiff_threshold",
    168                      type="float",
    169                      default=0.01)
    170    parser.add_option("--enable-free-discrete-count-convergence",
    171                      help="Terminate PH based on the free discrete variable count convergence metric. Default is False.",
    172                      action="store_true",
    173                      dest="enable_free_discrete_count_convergence",
    174                      default=False)
    175    parser.add_option("--free-discrete-count-threshold",
    176                      help="The convergence threshold used in the criterion based on when the free discrete variable count convergence criterion. Default is 20.",
    177                      action="store",
    178                      dest="free_discrete_count_threshold",
    179                      type="float",
    180                      default=20)
    181    parser.add_option("--enable-ww-extensions",
    182                      help="Enable the Watson-Woodruff PH extensions plugin. Default is False.",
    183                      action="store_true",
    184                      dest="enable_ww_extensions",
    185                      default=False)
    186    parser.add_option("--ww-extension-cfgfile",
    187                      help="The name of a configuration file for the Watson-Woodruff PH extensions plugin. Default is wwph.cfg.",
    188                      action="store",
    189                      dest="ww_extension_cfgfile",
    190                      type="string",
    191                      default="")
    192    parser.add_option("--ww-extension-suffixfile",
    193                      help="The name of a variable suffix file for the Watson-Woodruff PH extensions plugin. Default is wwph.suffixes.",
    194                      action="store",
    195                      dest="ww_extension_suffixfile",
    196                      type="string",
    197                      default="")
    198    parser.add_option("--user-defined-extension",
    199                      help="The name of a python module specifying a user-defined PH extension plugin.",
    200                      action="store",
    201                      dest="user_defined_extension",
    202                      type="string",
    203                      default=None)
    204    parser.add_option("--write-ef",
    205                      help="Upon termination, write the extensive form of the model - accounting for all fixed variables.",
    206                      action="store_true",
    207                      dest="write_ef",
    208                      default=False)
    209    parser.add_option("--solve-ef",
    210                      help="Following write of the extensive form model, solve it.",
    211                      action="store_true",
    212                      dest="solve_ef",
    213                      default=False)
    214    parser.add_option("--ef-output-file",
    215                      help="The name of the extensive form output file (currently only LP format is supported), if writing of the extensive form is enabled. Default is efout.lp.",
    216                      action="store",
    217                      dest="ef_output_file",
    218                      type="string",
    219                      default="efout.lp")
    220    parser.add_option("--suppress-continuous-variable-output",
    221                      help="Eliminate PH-related output involving continuous variables.",
    222                      action="store_true",
    223                      dest="suppress_continuous_variable_output",
    224                      default=False)
    225    parser.add_option("--keep-solver-files",
    226                      help="Retain temporary input and output files for scenario sub-problem solves",
    227                      action="store_true",
    228                      dest="keep_solver_files",
    229                      default=False)
    230    parser.add_option("--output-solver-logs",
    231                      help="Output solver logs during scenario sub-problem solves",
    232                      action="store_true",
    233                      dest="output_solver_logs",
    234                      default=False)
    235    parser.add_option("--output-ef-solver-log",
    236                      help="Output solver log during the extensive form solve",
    237                      action="store_true",
    238                      dest="output_ef_solver_log",
    239                      default=False)
    240    parser.add_option("--output-solver-results",
    241                      help="Output solutions obtained after each scenario sub-problem solve",
    242                      action="store_true",
    243                      dest="output_solver_results",
    244                      default=False)
    245    parser.add_option("--output-times",
    246                      help="Output timing statistics for various PH components",
    247                      action="store_true",
    248                      dest="output_times",
    249                      default=False)
    250    parser.add_option("--disable-warmstarts",
    251                      help="Disable warm-start of scenario sub-problem solves in PH iterations >= 1. Default is False.",
    252                      action="store_true",
    253                      dest="disable_warmstarts",
    254                      default=False)
    255    parser.add_option("--drop-proximal-terms",
    256                      help="Eliminate proximal terms (i.e., the quadratic penalty terms) from the weighted PH objective. Default is False.",
    257                      action="store_true",
    258                      dest="drop_proximal_terms",
    259                      default=False)
    260    parser.add_option("--retain-quadratic-binary-terms",
    261                      help="Do not linearize PH objective terms involving binary decision variables",
    262                      action="store_true",
    263                      dest="retain_quadratic_binary_terms",
    264                      default=False)
    265    parser.add_option("--linearize-nonbinary-penalty-terms",
    266                      help="Approximate the PH quadratic term for non-binary variables with a piece-wise linear function, using the supplied number of equal-length pieces from each bound to the average",
    267                      action="store",
    268                      dest="linearize_nonbinary_penalty_terms",
    269                      type="int",
    270                      default=0)
    271    parser.add_option("--breakpoint-strategy",
    272                      help="Specify the strategy to distribute breakpoints on the [lb, ub] interval of each variable when linearizing. 0 indicates uniform distribution. 1 indicates breakpoints at the node min and max, uniformly in-between. 2 indicates more aggressive concentration of breakpoints near the observed node min/max.",
    273                      action="store",
    274                      dest="breakpoint_strategy",
    275                      type="int",
    276                      default=0)
    277    parser.add_option("--checkpoint-interval",
    278                      help="The number of iterations between writing of a checkpoint file. Default is 0, indicating never.",
    279                      action="store",
    280                      dest="checkpoint_interval",
    281                      type="int",
    282                      default=0)
    283    parser.add_option("--restore-from-checkpoint",
    284                      help="The name of the checkpoint file from which PH should be initialized. Default is \"\", indicating no checkpoint restoration",
    285                      action="store",
    286                      dest="restore_from_checkpoint",
    287                      type="string",
    288                      default="")
    289    parser.add_option("--profile",
    290                      help="Enable profiling of Python code.  The value of this option is the number of functions that are summarized.",
    291                      action="store",
    292                      dest="profile",
    293                      type="int",
    294                      default=0)
    295    parser.add_option("--disable-gc",
    296                      help="Disable the python garbage collecter. Default is False.",
    297                      action="store_true",
    298                      dest="disable_gc",
    299                      default=False)
    300 
    301    parser.usage=usage_string
     51   parser.usage = usage_string
     52
     53   inputOpts  = OptionGroup( parser, 'Input Options' )
     54   solverOpts = OptionGroup( parser, 'Solver Options' )
     55   outputOpts = OptionGroup( parser, 'Output Options' )
     56   otherOpts  = OptionGroup( parser, 'Other Opts' )
     57   parser.add_option_group( inputOpts )
     58   parser.add_option_group( solverOpts )
     59   parser.add_option_group( outputOpts )
     60   parser.add_option_group( otherOpts )
     61
     62   inputOpts.add_option('--bounds-cfgfile',
     63     help="The name of a configuration script to set variable bound values. Default is None.",
     64     action="store",
     65     dest="bounds_cfgfile",
     66     default=None)
     67   inputOpts.add_option('-m','--model-directory',
     68     help="The directory in which all model (reference and scenario) definitions are stored. Default is \".\".",
     69     action="store",
     70     dest="model_directory",
     71     type="string",
     72     default=".")
     73   inputOpts.add_option('--rho-cfgfile',
     74     help="The name of a configuration script to compute PH rho values. Default is None.",
     75     action="store",
     76     dest="rho_cfgfile",
     77     type="string",
     78     default=None)
     79   inputOpts.add_option('--ww-extension-cfgfile',
     80     help="The name of a configuration file for the Watson-Woodruff PH extensions plugin. Default is wwph.cfg.",
     81     action="store",
     82     dest="ww_extension_cfgfile",
     83     type="string",
     84     default="")
     85   inputOpts.add_option('--ww-extension-suffixfile',
     86     help="The name of a variable suffix file for the Watson-Woodruff PH extensions plugin. Default is wwph.suffixes.",
     87     action="store",
     88     dest="ww_extension_suffixfile",
     89     type="string",
     90     default="")
     91   inputOpts.add_option('-i','--instance-directory',
     92     help="The directory in which all instance (reference and scenario) definitions are stored. Default is '.'.",
     93     action="store",
     94     dest="instance_directory",
     95     type="string",
     96     default=".")
     97   otherOpts.add_option('--disable-gc',
     98     help="Disable the python garbage collecter. Default is False.",
     99     action="store_true",
     100     dest="disable_gc",
     101     default=False)
     102   otherOpts.add_option('--keep-solver-files',
     103     help="Retain temporary input and output files for scenario sub-problem solves",
     104     action="store_true",
     105     dest="keep_solver_files",
     106     default=False)
     107   otherOpts.add_option('--profile',
     108     help="Enable profiling of Python code.  The value of this option is the number of functions that are summarized.",
     109     action="store",
     110     dest="profile",
     111     type="int",
     112     default=0)
     113   outputOpts.add_option('--ef-output-file',
     114     help="The name of the extensive form output file (currently only LP format is supported), if writing of the extensive form is enabled. Default is efout.lp.",
     115     action="store",
     116     dest="ef_output_file",
     117     type="string",
     118     default="efout.lp")
     119   outputOpts.add_option('--output-ef-solver-log',
     120     help="Output solver log during the extensive form solve",
     121     action="store_true",
     122     dest="output_ef_solver_log",
     123     default=False)
     124   outputOpts.add_option('--output-scenario-tree-solution',
     125     help="Report the full solution (even leaves) in scenario tree format upon termination. Values represent averages, so convergence is not an issue. Default is False.",
     126     action="store_true",
     127     dest="output_scenario_tree_solution",
     128     default=False)
     129   outputOpts.add_option('--output-solver-logs',
     130     help="Output solver logs during scenario sub-problem solves",
     131     action="store_true",
     132     dest="output_solver_logs",
     133     default=False)
     134   outputOpts.add_option('--output-solver-results',
     135     help="Output solutions obtained after each scenario sub-problem solve",
     136     action="store_true",
     137     dest="output_solver_results",
     138     default=False)
     139   outputOpts.add_option('--output-times',
     140     help="Output timing statistics for various PH components",
     141     action="store_true",
     142     dest="output_times",
     143     default=False)
     144   outputOpts.add_option('--report-only-statistics',
     145     help="When reporting solutions (if enabled), only output per-variable statistics - not the individual scenario values. Default is False.",
     146     action="store_true",
     147     dest="report_only_statistics",
     148     default=False)
     149   outputOpts.add_option('--report-solutions',
     150     help="Always report PH solutions after each iteration. Enabled if --verbose is enabled. Default is False.",
     151     action="store_true",
     152     dest="report_solutions",
     153     default=False)
     154   outputOpts.add_option('--report-weights',
     155     help="Always report PH weights prior to each iteration. Enabled if --verbose is enabled. Default is False.",
     156     action="store_true",
     157     dest="report_weights",
     158     default=False)
     159   outputOpts.add_option('--restore-from-checkpoint',
     160     help="The name of the checkpoint file from which PH should be initialized. Default is \"\", indicating no checkpoint restoration",
     161     action="store",
     162     dest="restore_from_checkpoint",
     163     type="string",
     164     default="")
     165   outputOpts.add_option('--solution-writer',
     166     help="The plugin invoked to write the scenario tree solution. Defaults to the empty list.",
     167     action="append",
     168     dest="solution_writer",
     169     type="string",
     170     default = [])
     171   outputOpts.add_option('--suppress-continuous-variable-output',
     172     help="Eliminate PH-related output involving continuous variables.",
     173     action="store_true",
     174     dest="suppress_continuous_variable_output",
     175     default=False)
     176   outputOpts.add_option('--verbose',
     177     help="Generate verbose output for both initialization and execution. Default is False.",
     178     action="store_true",
     179     dest="verbose",
     180     default=False)
     181   outputOpts.add_option('--write-ef',
     182     help="Upon termination, write the extensive form of the model - accounting for all fixed variables.",
     183     action="store_true",
     184     dest="write_ef",
     185     default=False)
     186   solverOpts.add_option('--breakpoint-strategy',
     187     help="Specify the strategy to distribute breakpoints on the [lb, ub] interval of each variable when linearizing. 0 indicates uniform distribution. 1 indicates breakpoints at the node min and max, uniformly in-between. 2 indicates more aggressive concentration of breakpoints near the observed node min/max.",
     188     action="store",
     189     dest="breakpoint_strategy",
     190     type="int",
     191     default=0)
     192   solverOpts.add_option('--checkpoint-interval',
     193     help="The number of iterations between writing of a checkpoint file. Default is 0, indicating never.",
     194     action="store",
     195     dest="checkpoint_interval",
     196     type="int",
     197     default=0)
     198   solverOpts.add_option('--default-rho',
     199     help="The default (global) rho for all blended variables. Default is 1.",
     200     action="store",
     201     dest="default_rho",
     202     type="float",
     203     default=1.0)
     204   solverOpts.add_option('--disable-warmstarts',
     205     help="Disable warm-start of scenario sub-problem solves in PH iterations >= 1. Default is False.",
     206     action="store_true",
     207     dest="disable_warmstarts",
     208     default=False)
     209   solverOpts.add_option('--drop-proximal-terms',
     210     help="Eliminate proximal terms (i.e., the quadratic penalty terms) from the weighted PH objective. Default is False.",
     211     action="store_true",
     212     dest="drop_proximal_terms",
     213     default=False)
     214   solverOpts.add_option('--ef-mipgap',
     215     help="Specifies the mipgap for the EF solve",
     216     action="store",
     217     dest="ef_mipgap",
     218     type="float",
     219     default=None)
     220   solverOpts.add_option('--ef-solver-options',
     221     help="Solver options for the extension form problem",
     222     action="append",
     223     dest="ef_solver_options",
     224     type="string",
     225     default=[])
     226   solverOpts.add_option('--enable-free-discrete-count-convergence',
     227     help="Terminate PH based on the free discrete variable count convergence metric. Default is False.",
     228     action="store_true",
     229     dest="enable_free_discrete_count_convergence",
     230     default=False)
     231   solverOpts.add_option('--enable-normalized-termdiff-convergence',
     232     help="Terminate PH based on the normalized termdiff convergence metric. Default is True.",
     233     action="store_true",
     234     dest="enable_normalized_termdiff_convergence",
     235     default=False)
     236   solverOpts.add_option('--enable-termdiff-convergence',
     237     help="Terminate PH based on the termdiff convergence metric. Default is True.",
     238     action="store_true",
     239     dest="enable_termdiff_convergence",
     240     default=True)
     241   solverOpts.add_option('--enable-ww-extensions',
     242     help="Enable the Watson-Woodruff PH extensions plugin. Default is False.",
     243     action="store_true",
     244     dest="enable_ww_extensions",
     245     default=False)
     246   solverOpts.add_option('--free-discrete-count-threshold',
     247     help="The convergence threshold used in the criterion based on when the free discrete variable count convergence criterion. Default is 20.",
     248     action="store",
     249     dest="free_discrete_count_threshold",
     250     type="float",
     251     default=20)
     252   solverOpts.add_option('--linearize-nonbinary-penalty-terms',
     253     help="Approximate the PH quadratic term for non-binary variables with a piece-wise linear function, using the supplied number of equal-length pieces from each bound to the average",
     254     action="store",
     255     dest="linearize_nonbinary_penalty_terms",
     256     type="int",
     257     default=0)
     258   solverOpts.add_option('--max-iterations',
     259     help="The maximal number of PH iterations. Default is 100.",
     260     action="store",
     261     dest="max_iterations",
     262     type="int",
     263     default=100)
     264   solverOpts.add_option('--retain-quadratic-binary-terms',
     265     help="Do not linearize PH objective terms involving binary decision variables",
     266     action="store_true",
     267     dest="retain_quadratic_binary_terms",
     268     default=False)
     269   solverOpts.add_option('--scenario-mipgap',
     270     help="Specifies the mipgap for all PH scenario sub-problems",
     271     action="store",
     272     dest="scenario_mipgap",
     273     type="float",
     274     default=None)
     275   solverOpts.add_option('--scenario-solver-options',
     276     help="Solver options for all PH scenario sub-problems",
     277     action="append",
     278     dest="scenario_solver_options",
     279     type="string",
     280     default=[])
     281   solverOpts.add_option('--solve-ef',
     282     help="Following write of the extensive form model, solve it.",
     283     action="store_true",
     284     dest="solve_ef",
     285     default=False)
     286   solverOpts.add_option('--solver',
     287     help="The type of solver used to solve scenario sub-problems. Default is cplex.",
     288     action="store",
     289     dest="solver_type",
     290     type="string",
     291     default="cplex")
     292   solverOpts.add_option('--solver-manager',
     293     help="The type of solver manager used to coordinate scenario sub-problem solves. Default is serial.",
     294     action="store",
     295     dest="solver_manager_type",
     296     type="string",
     297     default="serial")
     298   solverOpts.add_option('--termdiff-threshold',
     299     help="The convergence threshold used in the term-diff and normalized term-diff convergence criteria. Default is 0.01.",
     300     action="store",
     301     dest="termdiff_threshold",
     302     type="float",
     303     default=0.01)
     304   solverOpts.add_option('--user-defined-extension',
     305     help="The name of a python module specifying a user-defined PH extension plugin.",
     306     action="store",
     307     dest="user_defined_extension",
     308     type="string",
     309     default=None)
    302310
    303311   return parser
     
    333341         print "***ERROR: Exiting test driver: 'model' object equals 'None' in module "+reference_model_filename
    334342         return None, None, None, None
    335  
     343
    336344      reference_model = model_import.model
    337345   except IOError:
     
    363371      print "***ERROR: Failed to load scenario tree reference instance data from file="+scenario_tree_instance_filename
    364372      return None, None, None, None
    365    
     373
    366374   #
    367375   # construct the scenario tree
     
    390398         print "***ERROR: Exiting test driver: 'model' object equals 'None' in module "+reference_model_filename
    391399         return None
    392  
     400
    393401      reference_model = model_import.model
    394402   except IOError:
     
    397405
    398406   # import the saved state
    399      
     407
    400408   try:
    401409      checkpoint_file = open(options.restore_from_checkpoint,"r")
    402410      ph = pickle.load(checkpoint_file)
    403411      checkpoint_file.close()
    404      
     412
    405413   except IOError, msg:
    406414      raise RuntimeError, msg
     
    435443
    436444   #
    437    # if any of the ww extension configuration options are specified without the 
     445   # if any of the ww extension configuration options are specified without the
    438446   # ww extension itself being enabled, halt and warn the user - this has led
    439447   # to confusion in the past, and will save user support time.
     
    444452
    445453   if len(options.ww_extension_suffixfile) > 0 and options.enable_ww_extensions is False:
    446       print "***ERROR: A suffix file was specified for the WW extension module, but the WW extensions are not enabled!"         
     454      print "***ERROR: A suffix file was specified for the WW extension module, but the WW extensions are not enabled!"
    447455      return None
    448456
     
    471479      print "Trying to import user-defined PH extension module="+options.user_defined_extension
    472480      # JPW removed the exception handling logic, as the module importer
    473       # can raise a broad array of exceptions. 
     481      # can raise a broad array of exceptions.
    474482      __import__(options.user_defined_extension)
    475483      print "Module successfully loaded"
     
    483491      converger = NumFixedDiscreteVarConvergence(convergence_threshold=options.free_discrete_count_threshold)
    484492   elif options.enable_normalized_termdiff_convergence is True:
    485       converger = NormalizedTermDiffConvergence(convergence_threshold=options.termdiff_threshold)     
     493      converger = NormalizedTermDiffConvergence(convergence_threshold=options.termdiff_threshold)
    486494   else:
    487       converger = TermDiffConvergence(convergence_threshold=options.termdiff_threshold)     
    488 
    489    
     495      converger = TermDiffConvergence(convergence_threshold=options.termdiff_threshold)
     496
     497
    490498   #
    491499   # construct and initialize PH
     
    526534   return ph
    527535
     536
     537
     538
    528539#
    529540# Given a PH object, execute it and optionally solve the EF at the end.
     
    580591         raise ValueError, "Failed to create solver of type="+options.solver_type+" for use in extensive form solve"
    581592      if len(options.ef_solver_options) > 0:
    582          print "Initializing ef solver with options="+str(options.ef_solver_options)         
     593         print "Initializing ef solver with options="+str(options.ef_solver_options)
    583594         ef_solver.set_options("".join(options.ef_solver_options))
    584595      if options.ef_mipgap is not None:
     
    610621      for plugin in solution_writer_plugins:
    611622         plugin.write(ph._scenario_tree, "postphef")
    612    
    613 #
    614 # The main PH initialization / runner routine. Really only branches based on 
     623
     624#
     625# The main PH initialization / runner routine. Really only branches based on
    615626# the construction source - a checkpoint or from scratch.
    616627#
     
    704715
    705716    gc.enable()
    706    
     717
    707718    return ans
Note: See TracChangeset for help on using the changeset viewer.