Ignore:
Timestamp:
Nov 29, 2010 5:26:46 PM (10 years ago)
Author:
jwatson
Message:

Adding two options to the runef and runph pysp scripts, to facilitate scenario downsampling - the case where you have a big tree, but you don't want to use it all.

The options are:
--scenario-tree-downsample-fraction=X
--scenario-tree-random-seed

The options are fairly self-explanatory - the only possible nuance is that the downsample fraction is the fraction of scenarios retained.

File:
1 edited

Legend:

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

    r3217 r3261  
    508508
    509509def write_ef_from_scratch(model_directory, instance_directory, output_filename,
    510                           verbose_output, linearize,
     510                          verbose_output, linearize_expressions, tree_downsample_fraction, tree_random_seed,
    511511                          generate_weighted_cvar, cvar_weight, risk_alpha):
    512512
     
    577577
    578578   #
     579   # compress/down-sample the scenario tree, if operation is required.
     580   #
     581   if tree_downsample_fraction < 1.0:
     582       
     583      scenario_tree.downsample(tree_downsample_fraction, tree_random_seed, verbose_output)   
     584
     585   #
    579586   # print the input tree for validation/information purposes.
    580587   #
     
    626633                                                      verbose=verbose_output,
    627634                                                      preprocess=True,
    628                                                       linearize=linearize)
     635                                                      linearize=linearize_expressions)
    629636
    630637      scenario_instances[scenario._name] = scenario_instance
Note: See TracChangeset for help on using the changeset viewer.