Package hec.rss.model
Class IterationBlock
java.lang.Object
hec.rss.model.IterationBlock
Used in RSS compute to manage a group of elements that are related due to
downstream operating rules.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddElement(Element elem) adds an Element to the element vectorbooleancontains(int elemId) booleanelementAt(int i) returns the element at the given indexReturns a new ArrayList with DownstreamOpRule objects referenced within this iteration blockgetDownstreamOpVec(List decisionElemVec) Returns a new vector with DownstreamOp objects referenced within this iteration blockintreturns the number of elements in this iteration blockintreturns the first index in element order arrayintreturns the last index in element order arrayintintReturns the maximum number of time steps required to completely route flows from a controlled release to the farthest downstream control locationReturns a new List with reservoirs that do pumpback operation that are in this iteration blockReturns a new ArrayList with all Rules referenced by reservoirs or diversions in this iteration blockreturns a vector of operable elements at the given time step in order of shortest to longest lag to downstream rule.returns a List of all StateVariables used by elements in this blockReturns a new ArrayList with SystemHydropowerRule objects referenced within this iteration blockbooleanreturns true if any elements in the block utilize downstream operating rulesbooleansearches all rules from elements in this block and returns true if there is at least one TandemOpRulevoidrestoreElementState(int stateid) Causes all elements in the iteration block to retore their state for the given identifer that was previously savedvoidsaveElementState(int stateid) Causes all elements in the iteration block to save their state so that it can be restored later with computation loops are restartedvoidsetDependentElementsDirty(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.voidsetElementsDirty(boolean dirty) sets "dirty" value of all elements in the iteration block to the given statevoidsetFirstIndex(int id) sets the first index in element order arrayvoidsetLastIndex(int id) sets the last index in element order array
-
Constructor Details
-
IterationBlock
public IterationBlock()
-
-
Method Details
-
contains
-
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
adds an Element to the element vector -
getElementCount
public int getElementCount()returns the number of elements in this iteration block -
elementAt
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
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
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
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
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
-
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
returns a List of all StateVariables used by elements in this block- Returns:
- unique List of state variables
-
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
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 traversaldirty- 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
-