public class SingleSourceLongestPathAnalysis extends Analysis
Red (ssb) |
Red (shahrooz) |
Constructor and Description |
---|
SingleSourceLongestPathAnalysis(Graph graph,
Node startNode,
ToDoubleMapping edgeLengths)
Construct an instance of this class with a default analyzer.
|
SingleSourceLongestPathAnalysis(SingleSourceLongestPathAnalyzer analyzer)
Construct an instance of this class with a given analyzer.
|
Modifier and Type | Method and Description |
---|---|
double[] |
distance()
Return the distance from the node "startNode" to all the other nodes in
the graph.
|
Node |
getStartNode()
Return the single source-node (start node) of this analyzer.
|
java.util.List |
path(Node endNode)
Return the longest path from node "startNode" to node "endNode" in the
form of an ordered list.
|
double |
pathLength(Node endNode)
Return the length of the longest path from node "startNode"
to node "endNode".
|
void |
setStartNode(Node startNode)
Set the start-node of this analysis to the given node.
|
java.lang.String |
toString()
Return a description of the analysis and the associated analyzer.
|
boolean |
validAnalyzerInterface(Analyzer analyzer)
Check if a given analyzer is compatible with this analysis.
|
analyzer, changeAnalyzer, graph, valid
public SingleSourceLongestPathAnalysis(Graph graph, Node startNode, ToDoubleMapping edgeLengths)
graph
- The given graph.startNode
- The node from which the longest path is going to be
calculated.edgeLengths
- The lengths of the edges of the given graph, which
are going to be used to calculated the longest path.public SingleSourceLongestPathAnalysis(SingleSourceLongestPathAnalyzer analyzer)
analyzer
- The given analyzer.public double[] distance()
Graph.nodeLabel(ptolemy.graph.Node)
public Node getStartNode()
setStartNode(Node)
public java.util.List path(Node endNode)
endNode
- The ending node of the path.public double pathLength(Node endNode)
setStartNode(ptolemy.graph.Node)
.endNode
- The ending node of the path.public void setStartNode(Node startNode)
startNode
- The given node.getStartNode()
public java.lang.String toString()
public boolean validAnalyzerInterface(Analyzer analyzer)
validAnalyzerInterface
in class Analysis
analyzer
- The given analyzer.