ptolemy.graph.analysis.analyzer
Interface SingleSourceLongestPathAnalyzer

All Superinterfaces:
Analyzer, GraphAnalyzer
All Known Implementing Classes:
AllEdgeSingleSourceLongestPathStrategy

public interface SingleSourceLongestPathAnalyzer
extends GraphAnalyzer

A common interface for all the single source longest path analyzers.

Since:
Ptolemy II 4.0
Version:
$Id: SingleSourceLongestPathAnalyzer.java 53556 2009-05-08 22:28:44Z cxh $
Author:
Shahrooz Shahparnia
See Also:
SingleSourceLongestPathAnalysis
Accepted Rating:
Red (ssb)
Proposed Rating:
Red (shahrooz)

Method Summary
 double[] distance()
          Return the distance from the start node to all the other nodes in the graph.
 Node getStartNode()
          Return the 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 single source node of this analyzer to the given node.
 
Methods inherited from interface ptolemy.graph.analysis.analyzer.GraphAnalyzer
graph
 
Methods inherited from interface ptolemy.graph.analysis.analyzer.Analyzer
toString, valid
 

Method Detail

distance

double[] distance()
Return the distance from the start node to all the other nodes in the graph. The result is a double[] indexed by the destination node label.

Returns:
Return the distance from the start node to all the other nodes in the graph.
See Also:
Graph.nodeLabel(ptolemy.graph.Node)

getStartNode

Node getStartNode()
Return the start node of this analyzer.

Returns:
Return the start node of this analyzer.
See Also:
setStartNode(Node)

path

java.util.List path(Node endNode)
Return the longest path from node "startNode" to node "endNode" in the form of an ordered list.

Parameters:
endNode - The ending node of the path.
Returns:
The longest path from startNode to endNode.

pathLength

double pathLength(Node endNode)
Return the length of the longest path from node "startNode" to node "endNode". The source node can be set using setStartNode(ptolemy.graph.Node).

Parameters:
endNode - The ending node of the path.
Returns:
The length of the longest path.

setStartNode

void setStartNode(Node startNode)
Set the single source node of this analyzer to the given node.

Parameters:
startNode - The given node.
See Also:
getStartNode()