Changeset 2396


Ignore:
Timestamp:
Feb 23, 2010 5:18:15 PM (10 years ago)
Author:
jwatson
Message:

Added initial cut at a PH solver manager - only works for iteration 0 at the moment.

Location:
coopr.pysp/trunk/coopr/pysp
Files:
1 added
2 edited

Legend:

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

    r2261 r2396  
    2121from ef_writer_script import *
    2222from phinit import *
     23from phsolvermanager import *
    2324
    2425pyutilib.component.core.PluginGlobals.pop_env()
  • coopr.pysp/trunk/coopr/pysp/phserver.py

    r2393 r2396  
    5555   def solve(self, scenario_name):
    5656
    57       print "RECEIVED SOLVE REQUEST!"
    58       print "SCENARIO TO SOLVE=",scenario_name
    5957      if scenario_name not in self._scenario_instances:
    6058         print "***ERROR: Requested instance to solve not in PH solver server instance collection!"
    6159         return None
    6260      scenario_instance = self._scenario_instances[scenario_name]
    63       print "SCENARIO INSTANCE=",scenario_instance
    64       print "SOLVING"
    6561      results = self._solver.solve(scenario_instance)
    66       print "TYPE OF RESULTS=",type(results)
    67       print "RESULTS:"
    68       results.write(num=1)
    69       print "DONE WITH SOLVE"
     62      print "Successfully solved scenario instance="+scenario_name
    7063      encoded_results = pickle.dumps(results)
    7164     
     
    267260      solver_daemon.connect(delegator_object, scenario_name)
    268261
    269    print "WAITING FOR REQUESTS"
    270 
    271262   while True:
    272263      solver_daemon.handleRequests()
    273       print "HANDLED A REQUEST!"
    274264
    275265   solver_daemon.disconnect()
    276 
    277    print "DONE RUNNING SERVER!"
    278266
    279267   end_time = time.time()
Note: See TracChangeset for help on using the changeset viewer.