Changeset 3168


Ignore:
Timestamp:
Oct 26, 2010 10:12:23 PM (10 years ago)
Author:
jwatson
Message:

Completing implementation of optional processing of expression simplification in PySP.

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

Legend:

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

    r3152 r3168  
    653653                                                         self._verbose,
    654654                                                         preprocess=False,
    655                                                          linearize=linearize)
     655                                                         linearize=linearize,
     656                                                         simplify=self._simplify_expressions)
    656657
    657658         # IMPT: disable canonical representation construction for ASL solvers.
  • coopr.pysp/trunk/coopr/pysp/phinit.py

    r3138 r3168  
    378378      if options.verbose is True:
    379379         print "Scenario reference instance filename="+reference_instance_filename
    380       reference_instance = reference_model.create(reference_instance_filename, preprocess=False)
     380      reference_instance = reference_model.create(reference_instance_filename, preprocess=False, simplify=options.simplify_expressions)
    381381      # IMPT: disable canonical representation construction for ASL solvers.
    382382      #       this is a hack, in that we need to address encodings and
     
    402402      if options.verbose is True:
    403403         print "Scenario tree instance filename="+scenario_tree_instance_filename
    404       scenario_tree_instance = scenario_tree_model.create(scenario_tree_instance_filename)
     404      scenario_tree_instance = scenario_tree_model.create(scenario_tree_instance_filename, simplify=options.simplify_expressions)
    405405   except IOError:
    406406      print "***ERROR: Failed to load scenario tree reference instance data from file="+scenario_tree_instance_filename
  • coopr.pysp/trunk/coopr/pysp/phutils.py

    r3143 r3168  
    189189                                verbose,
    190190                                preprocess = True,
    191                                 linearize = True):
     191                                linearize = True,
     192                                simplify = True):
    192193
    193194   if verbose is True:
     
    208209         if verbose is True:
    209210            print "Data for scenario=" + scenario._name + " loads from file=" + scenario_data_filename
    210          scenario_instance = reference_model.create(scenario_data_filename)
     211         scenario_instance = reference_model.create(scenario_data_filename, simplify=simplify)
    211212      else:
    212213         scenario_instance = reference_model.clone()
     
    220221            current_node = current_node._parent
    221222         scenario_data.read(model=scenario_instance)
    222          scenario_instance.load(scenario_data)
     223         scenario_instance.load(scenario_data, simplify=simplify)
    223224         if preprocess is True:
    224225            scenario_instance.preprocess()         
Note: See TracChangeset for help on using the changeset viewer.