Changeset 3481


Ignore:
Timestamp:
Jan 15, 2011 8:14:09 PM (9 years ago)
Author:
khunter
Message:

NFC: EOL whitespace removal

File:
1 edited

Legend:

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

    r3073 r3481  
    6363      # the objective functions are modified throughout the course of PH iterations.
    6464      # save the original, as a baseline to modify in subsequent iterations. reserve
    65       # the original objectives, for subsequent modification. 
     65      # the original objectives, for subsequent modification.
    6666      self._original_objective_expression = {}
    6767      for instance_name, instance in self._instances.items():
     
    9797#      else:
    9898#         print "OBJECTIVE=PH"
    99          
     99
    100100      if scenario_name not in self._instances:
    101101         print "***ERROR: Requested instance to solve not in PH solver server instance collection!"
     
    105105      # form the desired objective, depending on the solve mode.
    106106      if self._solving_standard_objective is True:
    107          form_standard_objective(scenario_name, scenario_instance, self._original_objective_expression[scenario_name], self._scenario_tree)         
     107         form_standard_objective(scenario_name, scenario_instance, self._original_objective_expression[scenario_name], self._scenario_tree)
    108108      else:
    109109         # TBD - command-line drive the various options (integer tolerance, breakpoint strategies, etc.)
     
    123123#      results.write(num=1)
    124124      encoded_results = pickle.dumps(results)
    125      
     125
    126126      return encoded_results
    127127
     
    134134         return None
    135135      scenario_instance = self._instances[scenario_name]
    136      
     136
    137137      for weight_update in new_weights:
    138          
     138
    139139         weight_index = weight_update._index
    140140
     
    145145
    146146      for average_update in new_averages:
    147          
     147
    148148         average_index = average_update._index
    149149
     
    160160         print "***ERROR: Received request to update weights for instance not in PH solver server instance collection!"
    161161         return None
    162       scenario_instance = self._instances[scenario_name]     
     162      scenario_instance = self._instances[scenario_name]
    163163
    164164      for rho_update in new_rhos:
     
    168168         target_rho_parameter = getattr(scenario_instance, rho_update.name)
    169169
    170          for index in rho_index: 
     170         for index in rho_index:
    171171            target_rho_parameter[index] = value(rho_update[index])
    172172
     
    183183
    184184         tree_node = self._scenario_tree._tree_node_map[tree_node_name]
    185          tree_node._maximums = tree_node_maximums         
    186      
    187            
     185         tree_node._maximums = tree_node_maximums
     186
     187
    188188#
    189189# utility method to construct an option parser for ph arguments, to be
     
    317317         print "***ERROR: Exiting test driver: 'model' object equals 'None' in module "+reference_model_filename
    318318         return None, None, None, None
    319  
     319
    320320      reference_model = model_import.model
    321321   except IOError:
     
    347347      print "***ERROR: Failed to load scenario tree reference instance data from file="+scenario_tree_instance_filename
    348348      return None, None, None
    349    
     349
    350350   #
    351351   # construct the scenario tree
     
    357357
    358358#
    359 # Execute the PH solver server daemon. 
     359# Execute the PH solver server daemon.
    360360#
    361361
     
    364364   start_time = time.time()
    365365
    366    Pyro.core.initServer(banner=0)   
     366   Pyro.core.initServer(banner=0)
    367367
    368368   locator = Pyro.naming.NameServerLocator()
     
    371371      ns = locator.getNS()
    372372   except Pyro.errors.NamingError:
    373       raise RuntimeError, "PH solver server failed to locate Pyro name server"     
     373      raise RuntimeError, "PH solver server failed to locate Pyro name server"
    374374
    375375   solver_daemon = Pyro.core.Daemon()
     
    412412def exec_server(options):
    413413
    414    # we need the base model (not so much the reference instance, but that 
     414   # we need the base model (not so much the reference instance, but that
    415415   # can't hurt too much - until proven otherwise, that is) to construct
    416416   # the scenarios that this server is responsible for.
     
    460460   # the solver instance is persistent, applicable to all instances here.
    461461   if options.verbose is True:
    462       print "Constructing solver type="+options.solver_type         
     462      print "Constructing solver type="+options.solver_type
    463463   solver = SolverFactory(options.solver_type)
    464464   if solver == None:
     
    530530
    531531    gc.enable()
    532    
     532
    533533    return ans
    534534
Note: See TracChangeset for help on using the changeset viewer.