Changeset 2669
- Timestamp:
- Jun 16, 2010 5:10:50 PM (11 years ago)
- Location:
- coopr.pysp/trunk/coopr/pysp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
coopr.pysp/trunk/coopr/pysp/ef.py
r2465 r2669 633 633 raise RuntimeError, "Failed to create model instance for scenario=" + scenario._name 634 634 635 # IMPT: This is kind of a hack now, as there is currently no way to propagate 636 # solver capabilities through to the corresponding file writer - it 637 # has to go through the model. for now, assume the solver has all capabilities. 638 scenario_instance.has_capability = lambda x: True 639 635 640 # name each instance with the scenario name, so the prefixes in the EF make sense. 636 641 scenario_instance.name = scenario._name … … 648 653 generate_weighted_cvar = generate_weighted_cvar, 649 654 cvar_weight = cvar_weight, 650 risk_alpha = risk_alpha) 655 risk_alpha = risk_alpha) 656 binding_instance.has_capability = lambda x: True 651 657 652 658 print "Starting to write extensive form" … … 667 673 668 674 binding_instance = create_ef_instance(scenario_tree, scenario_instances) 675 binding_instance.has_capability = lambda x: True 669 676 670 677 print "Starting to write extensive form" -
coopr.pysp/trunk/coopr/pysp/ef_writer_script.py
r2466 r2669 161 161 if ef_solver is None: 162 162 raise ValueError, "Failed to create solver manager of type="+options.solver_type+" for use in extensive form solve" 163 164 # at this point you have a specific solver - communicate solver capabilities 165 # to the writer via the instance. 166 binding_instance.has_capability = ef_solver.has_capability 167 for scenario_name, scenario_instance in scenario_instances.items(): 168 scenario_instance.has_capability = ef_solver.has_capability 163 169 164 170 print "Queuing extensive form solve"
Note: See TracChangeset
for help on using the changeset viewer.