Package hec.rss.model

Class IterationBlock

java.lang.Object
hec.rss.model.IterationBlock

public class IterationBlock extends Object
Used in RSS compute to manage a group of elements that are related due to downstream operating rules.
  • Constructor Details

    • IterationBlock

      public IterationBlock()
  • Method Details

    • contains

      public boolean contains(Element e)
    • contains

      public boolean contains(int elemId)
    • setFirstIndex

      public void setFirstIndex(int id)
      sets the first index in element order array
    • getFirstIndex

      public int getFirstIndex()
      returns the first index in element order array
    • setLastIndex

      public void setLastIndex(int id)
      sets the last index in element order array
    • getLastIndex

      public int getLastIndex()
      returns the last index in element order array
    • addElement

      public void addElement(Element elem)
      adds an Element to the element vector
    • getElementCount

      public int getElementCount()
      returns the number of elements in this iteration block
    • elementAt

      public Element elementAt(int i)
      returns the element at the given index
    • hasDownstreamRules

      public boolean hasDownstreamRules()
      returns true if any elements in the block utilize downstream operating rules
    • hasTandemRules

      public boolean hasTandemRules()
      searches all rules from elements in this block and returns true if there is at least one TandemOpRule
      Returns:
      true if there is at least one TandemOpRule
    • getNumRoutingSteps

      public int getNumRoutingSteps()
      Returns the maximum number of time steps required to completely route flows from a controlled release to the farthest downstream control location
      Returns:
      number of time steps (at least 1)
    • getRuleList

      public List<Object> getRuleList()
      Returns a new ArrayList with all Rules referenced by reservoirs or diversions in this iteration block
      Returns:
      new ArrayList of Rule objects (may be empty but will not be null)
    • getDownstreamOpRuleList

      public List<DownstreamOpRule> getDownstreamOpRuleList()
      Returns a new ArrayList with DownstreamOpRule objects referenced within this iteration block
      Returns:
      new ArrayList of DownstreamOpRule objects (may be empty but will not be null)
    • getDownstreamOpVec

      public List getDownstreamOpVec(List decisionElemVec)
      Returns a new vector with DownstreamOp objects referenced within this iteration block
      Parameters:
      decisionElemVec - (not used at this time???)
      Returns:
      new Vector of DownstreamOp objects (may be empty but will not be null)
    • getPumpbackList

      public List<ReservoirElement> getPumpbackList()
      Returns a new List with reservoirs that do pumpback operation that are in this iteration block
      Returns:
      new Vector of DownstreamOp objects (may be empty but will not be null)
    • getPumpbackRuleList

      public List<PumpOpRule> getPumpbackRuleList()
    • getSystemPowerOpList

      public List<SystemHydropowerRule> getSystemPowerOpList()
      Returns a new ArrayList with SystemHydropowerRule objects referenced within this iteration block
      Returns:
      new ArrayList of SystemHydropowerRule objects (may be empty but will not be null)
    • getStateVariableList

      public List<StateVariable> getStateVariableList()
      returns a List of all StateVariables used by elements in this block
      Returns:
      unique List of state variables
    • getSortedDecisionElements

      public List<Element> getSortedDecisionElements()
      returns a vector of operable elements at the given time step in order of shortest to longest lag to downstream rule. this method must be called after rules are evaluated for lag.
    • getLastResOrReleaseElemId

      public int getLastResOrReleaseElemId()
    • setElementsDirty

      public void setElementsDirty(boolean dirty)
      sets "dirty" value of all elements in the iteration block to the given state
      Parameters:
      dirty - indicates whether element needs to be recomputed
    • setDependentElementsDirty

      public void setDependentElementsDirty(Element startElem, boolean dirty)
      sets "dirty" value of the given element and all elements whose flow depends on the given element to the given state.
      Parameters:
      startElem - the starting element for the downstream traversal
      dirty - indicates whether element needs to be recomputed
    • saveElementState

      public void saveElementState(int stateid)
      Causes all elements in the iteration block to save their state so that it can be restored later with computation loops are restarted
      Parameters:
      stateid - an identifier to label a particular state
    • restoreElementState

      public void restoreElementState(int stateid)
      Causes all elements in the iteration block to retore their state for the given identifer that was previously saved
      Parameters:
      stateid - an identifier to label a particular state