public class GraphReader
extends java.lang.Object
References
[1] J. Davis et al., Heterogeneous
concurrent modeling and design in Java, Technical report,
Electronics Research Laboratory, University of California at Berkeley,
March 2001.
| Red (cxh) |
| Red (cxh) |
| Constructor and Description |
|---|
GraphReader()
Construct a new graph reader.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Object |
_computeEdgeWeight(IOPort sourcePort,
IOPort sinkPort)
Determine the weight to be assigned to the weighted graph edge that
represents a given connection in a Ptolemy II model.
|
protected java.lang.Object |
_computeNodeWeight(Actor actor)
Determine the weight to be assigned to the weighted graph node that
represents a given actor.
|
protected Graph |
_initializeGraph(CompositeActor compositeActor)
Instantiate and initialize a graph just prior to filling it
in from a given Ptolemy II model.
|
protected void |
_processNewEdge(Graph graph,
Edge edge,
IOPort sourcePort,
IOPort sinkPort)
Process a new edge corresponding to a given connection in a given graph.
|
protected void |
_processNewNode(Graph graph,
Node node,
Actor actor)
Process a new node corresponding to a given actor in a given graph.
|
protected void |
_transformTopology(Graph graph)
Perform post-processing on the entire graph to complete the
conversion.
|
Graph |
convert(CompositeActor compositeActor)
Convert the model represented by a CompositeActor into a directed,
weighted graph.
|
public Graph convert(CompositeActor compositeActor)
_computeNodeWeight(Actor) and
_computeEdgeWeight(IOPort sourcePort,
IOPort sinkPort)
methods.
This method will convert low level CompositeActor as a node.compositeActor - The composite actor to convert.java.lang.RuntimeException - If the deep entity list of the
composite actor contains an entry that is not an AtomicActor.protected java.lang.Object _computeEdgeWeight(IOPort sourcePort, IOPort sinkPort)
sourcePort - the output port of the connection associated with
the edge.sinkPort - the input port of the connection associated with the
edgeprotected java.lang.Object _computeNodeWeight(Actor actor)
actor - the actor whose node weight is to be determined.protected Graph _initializeGraph(CompositeActor compositeActor)
compositeActor - the Ptolemy II model that will be converted.protected void _processNewEdge(Graph graph, Edge edge, IOPort sourcePort, IOPort sinkPort)
graph - The graph that contains the new edge.edge - The new edge.sourcePort - The source port of the connection in the model.sinkPort - The sink port of the connection.protected void _processNewNode(Graph graph, Node node, Actor actor)
graph - The graph that contains the new node.node - The new node.actor - The actor that corresponds to the new node.protected void _transformTopology(Graph graph)
graph - the graph.