Package hec.rss.model
Class ElementGraph
java.lang.Object
hec.rss.model.ElementGraph
Utility class used in element ordering for RssSytem compute method
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDependentElem(Element elem, Element lastElem, String descr) sets dependency between elements.addElement(Element e, int actElemId) booleanvoidintintint[]booleanTests to determine if the graph is cyclic by walking down from each top node and looking for graph nodes that are visited more than once.voidsetMessagePrinter(MessagePrinter mp, int level) booleansort()Sort the ElementGraph elements and subgraphs in hydrologic order.voidtrimGraphToContaining(Element[] elemArray) Trims this element graph so that it only contains subgraphs that include the given elements by cloning this graph and removing unneeded partsvoidwriteGraph(String message) Print element graph details to previously defined MessagePrinter log
-
Field Details
-
SEARCH_UP
public static final int SEARCH_UP- See Also:
-
SEARCH_DOWN
public static final int SEARCH_DOWN- See Also:
-
-
Constructor Details
-
ElementGraph
public ElementGraph() -
ElementGraph
-
-
Method Details
-
setMessagePrinter
-
addElement
-
containsElement
-
addDependentElem
sets dependency between elements. This method should be called after all elements are added to the graph and before calling the sort method.- Parameters:
elem-lastElem-
-
getGraphNodesBelow
-
isCyclicGraph
public boolean isCyclicGraph()Tests to determine if the graph is cyclic by walking down from each top node and looking for graph nodes that are visited more than once.- Returns:
- true if the graph is cyclic
-
createDependentGroups
public void createDependentGroups() -
sort
public boolean sort()Sort the ElementGraph elements and subgraphs in hydrologic order.- Returns:
- true if successful
-
getUpNodeList
-
getRootNodes
-
getElementOrder
public int[] getElementOrder() -
getIterationBlocks
-
getBlockId
public int getBlockId()- Returns:
-
getDistId
public int getDistId() -
trimGraphToContaining
Trims this element graph so that it only contains subgraphs that include the given elements by cloning this graph and removing unneeded parts- Parameters:
_resArray-
-
writeGraph
Print element graph details to previously defined MessagePrinter log- Parameters:
message- string printed on first line
-