Changeset 2325


Ignore:
Timestamp:
Feb 12, 2010 10:34:40 AM (9 years ago)
Author:
jwatson
Message:

Miscelleanous PH updates related to restructuring and tweaking of the PH solver server.

Location:
coopr.pysp/trunk
Files:
3 edited

Legend:

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

    r2324 r2325  
    302302         print ""
    303303         print "***ERROR: Exiting test driver: No 'model' object created in module "+reference_model_filename
    304          return None, None, None
     304         return None, None, None, None
    305305
    306306      if model_import.model is None:
    307307         print ""
    308308         print "***ERROR: Exiting test driver: 'model' object equals 'None' in module "+reference_model_filename
    309          return None, None, None
     309         return None, None, None, None
    310310 
    311311      reference_model = model_import.model
    312312   except IOError:
    313313      print "***ERROR: Failed to load scenario reference model from file="+reference_model_filename
    314       return None, None, None
     314      return None, None, None, None
    315315
    316316   try:
     
    321321   except IOError:
    322322      print "***ERROR: Failed to load scenario reference instance data from file="+reference_instance_filename
    323       return None, None, None
     323      return None, None, None, None
    324324
    325325   #
     
    337337   except IOError:
    338338      print "***ERROR: Failed to load scenario tree reference instance data from file="+scenario_tree_instance_filename
    339       return None, None, None
     339      return None, None, None, None
    340340   
    341341   #
  • coopr.pysp/trunk/coopr/pysp/phserver.py

    r2324 r2325  
    5454         return None
    5555      scenario_instance = self._scenario_instances[scenario_name]
    56       return None
    5756      print "SCENARIO INSTANCE=",scenario_instance
     57      print "SUPPORTS MULTITHREADING=",Pyro.util.supports_multithreading()
    5858      print "SOLVING"
    5959      self._solver.solve(scenario_instance)
    6060      print "DONE WITH SOLVE"
    61       return None
    62       return result
     61      return scenario_instance
     62#      return result
    6363
    6464#
     
    222222   # construct the scenario tree
    223223   #
    224    scenario_tree = ScenarioTree(model=reference_instance,
    225                                 nodes=scenario_tree_instance.Nodes,
    226                                 nodechildren=scenario_tree_instance.Children,
    227                                 nodestages=scenario_tree_instance.NodeStage,
    228                                 nodeprobabilities=scenario_tree_instance.ConditionalProbability,
    229                                 stages=scenario_tree_instance.Stages,
    230                                 stagevariables=scenario_tree_instance.StageVariables,
    231                                 stagecostvariables=scenario_tree_instance.StageCostVariable,
    232                                 scenarios=scenario_tree_instance.Scenarios,
    233                                 scenarioleafs=scenario_tree_instance.ScenarioLeafNode,
    234                                 scenariobaseddata=scenario_tree_instance.ScenarioBasedData)
    235 
    236    return reference_model, reference_instance, scenario_tree
     224   scenario_tree = ScenarioTree(scenarioinstance=reference_instance,
     225                                scenariotreeinstance=scenario_tree_instance)
     226
     227   return reference_model, reference_instance, scenario_tree, scenario_tree_instance
    237228
    238229#
  • coopr.pysp/trunk/scripts/phsolverserver

    r2320 r2325  
    5050try:
    5151    coopr.pysp.phserver.run()
    52 except ValueError, str:
    53     print "VALUE ERROR:"
    54     print str
     52#except ValueError, str:
     53#    print "VALUE ERROR:"
     54#    print str
    5555except IOError, str:
    5656    print "IO ERROR:"
Note: See TracChangeset for help on using the changeset viewer.