Changeset 3014


Ignore:
Timestamp:
Sep 15, 2010 1:21:07 PM (9 years ago)
Author:
jwatson
Message:

Fixing bug introduced in the computeconf script, introduced in my zealous attempt to eliminate redundant preprocess() calls - but you still need one!

Also simplified the names of a few of the command-line arguments, and made the extensive-form solve the default.

Location:
coopr.pysp/trunk
Files:
2 edited

Legend:

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

    r2987 r3014  
    180180#
    181181# construct a scenario instance!
     182# IMPT: the returned instance is guaranteed to be preprocessed().
    182183#
    183184def construct_scenario_instance(scenario_tree_instance,
     
    217218         scenario_data.read(model=scenario_instance)
    218219         scenario_instance.load(scenario_data)
     220         scenario_instance.preprocess()         
    219221   except:
    220222      print "Encountered exception in model instance creation - traceback:"
  • coopr.pysp/trunk/scripts/computeconf

    r2989 r3014  
    2424   try:
    2525      conf_options_parser = construct_ph_options_parser("computeconf [options]")
    26       conf_options_parser.add_option("--Fraction-of-Scenarios-for-Solve",
     26      conf_options_parser.add_option("--fraction-scenarios-for-solve",
    2727                                     help="The fraction of scenarios that are allocated to finding a solution. Default is 0.5",
    2828                                     action="store",
     
    3030                                     type="float",
    3131                                     default=0.5)
    32       conf_options_parser.add_option("--Number-of-Samples-for-Confidence-Interval",
     32      conf_options_parser.add_option("--number-samples-for-confidence-interval",
    3333                                     help="The number of samples of scenarios that are allocated to the confidence inteval (n_g). Default is 10",
    3434                                     action="store",
     
    3636                                     type="int",
    3737                                     default=10)
    38       conf_options_parser.add_option("--Confidence-Interval-Alpha",
     38      conf_options_parser.add_option("--confidence-interval-alpha",
    3939                                     help="The alpha level for the confidence interval. Default is 0.10",
    4040                                     action="store",
     
    4242                                     type="float",
    4343                                     default=0.10)
    44       conf_options_parser.add_option("--solve-xhat-with-ef-only",
    45                                      help="Perform xhat solve via EF rather than PH. Default is False",
     44      conf_options_parser.add_option("--solve-xhat-with-ph",
     45                                     help="Perform xhat solve via PH rather than an EF solve. Default is False",
    4646                                     action="store_true",
    47                                      dest="solve_xhat_with_ef_only",
     47                                     dest="solve_xhat_with_ph",
    4848                                     default=False)
    4949      conf_options_parser.add_option("--random-seed",
     
    139139   xhat_obj = None
    140140
    141    if options.solve_xhat_with_ef_only is True:
     141   if options.solve_xhat_with_ph is False:
    142142      print "Creating the xhat extensive form."
    143143      if options.verbose is True:
Note: See TracChangeset for help on using the changeset viewer.