Changeset 3105


Ignore:
Timestamp:
Oct 15, 2010 2:41:47 AM (11 years ago)
Author:
khunter
Message:

NFC: EOL whitespace removal

File:
1 edited

Legend:

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

    r3096 r3105  
    2424   #
    2525   # update the _solutions attribute of a tree node, given a specific
    26    # variable/match-template/variable-index triple. 
     26   # variable/match-template/variable-index triple.
    2727   #
    2828   def _update_solution_map(self, variable, match_template, variable_indices):
     
    5151         new_variable[index].activate()
    5252
    53       self._solutions[new_variable_name] = new_variable     
     53      self._solutions[new_variable_name] = new_variable
    5454
    5555   #
     
    176176         my_cost = stage_cost_variable.value
    177177      else:
    178          # depending on the situation (and the model), the stage cost variables might not have values.                       
     178         # depending on the situation (and the model), the stage cost variables might not have values.
    179179         my_cost = 0.0
    180180      child_cost = 0.0
     
    191191
    192192      self._name = ""
    193      
     193
    194194      # a collection of ScenarioTreeNode objects.
    195       self._tree_nodes = []     
    196      
     195      self._tree_nodes = []
     196
    197197      # a collection of triples consisting of (1) a reference to a Pyomo model Var object, (2) the original match
    198198      # template string (for output purposes), and (3) a *list* of the corresponding indices. the variables are
     
    201201      # NOTE: if the variable index is none, it is assumed that the entire variable is blended.
    202202      self._variables = []
    203      
     203
    204204      # a tuple consisting of (1) a reference to a pyomo model Var that computes the stage-specific cost and (2) the corresponding
    205205      # index. the index *is* the sole index in the cost variable, as the cost variable refers to a single variable index.
     
    221221   """
    222222   def __init__(self, *args, **kwds):
    223      
     223
    224224      self._name = None
    225225      self._leaf_node = None  # allows for construction of node list
     
    360360   """
    361361   def __init__(self, *args, **kwds):
    362      
     362
    363363      self._name = None # some arbitrary identifier
    364364      self._reference_instance = None # the reference (deterministic) base model
     
    473473         if string.find(scenario_name, "_") != -1:
    474474            raise ValueError, "By convention, scenario names in PySP cannot contain underscore (_) characters; the scenario in violation="+scenario_name
    475          
     475
    476476         new_scenario = Scenario()
    477477         new_scenario._name=scenario_name
     
    536536            instance_cost_variable = instance.active_components(Var)[stage._cost_variable[0].name][stage._cost_variable[1]]
    537537            if instance_cost_variable.value is not None:
    538                 # depending on the situation (and the model), the stage cost variables might not have values.               
     538                # depending on the situation (and the model), the stage cost variables might not have values.
    539539               aggregate_cost += instance_cost_variable
    540540      return aggregate_cost
     
    722722
    723723   def variableStage(self, variable, index):
    724      
     724
    725725      for stage in self._stages:
    726          # stage_var is a VarValue - the rest are strings and list of indices, respectively.         
     726         # stage_var is a VarValue - the rest are strings and list of indices, respectively.
    727727         for (stage_var, match_template, match_indices) in stage._variables:
    728728            if (variable.name == stage_var.name) and (index in match_indices):
     
    733733         # automatically or explicitly.
    734734         if (variable.name == stage._cost_variable[0].name):
    735             return stage 
     735            return stage
    736736
    737737      raise RuntimeError, "The variable="+str(variable.name)+", index="+str(index)+" does not belong to any stage in the scenario tree"
     
    740740   # a utility to determine the stage to which the input constraint "belongs".
    741741   # a constraint belongs to the latest stage in which referenced variables
    742    # in the constraint appears in that stage. 
     742   # in the constraint appears in that stage.
    743743   # input is a constraint is of type "Constraint", and an index of that
    744744   # constraint - which might be None in the case of singleton constraints.
Note: See TracChangeset for help on using the changeset viewer.