mapss.dif.psdf
Class PSDFGraphReader

java.lang.Object
  extended by mapss.dif.ptolemy.GraphReader
      extended by mapss.dif.ptolemy.DIFGraphReader
          extended by mapss.dif.psdf.PSDFGraphReader

public class PSDFGraphReader
extends DIFGraphReader

This class provides methods for converting Ptolemy II PSDF models into weighted graph representations. Node and edge weights in the converted graphs are, respectively, PSDFNodeWeight and PSDFEdgeWeight objects that are filled in with the appropriate PSDF/topological attributes.

Version:
$Id: PSDFGraphReader.java 409 2007-05-13 19:47:16Z plishker $
Author:
Shuvra S. Bhattacharyya
See Also:
PSDFGraph

Constructor Summary
PSDFGraphReader()
          Create a new PSDF graph reader.
 
Method Summary
protected  java.lang.Object _computeEdgeWeight(ptolemy.actor.IOPort sourcePort, ptolemy.actor.IOPort sinkPort)
          Construct a PSDFEdgeWeight object that represents the given PSDF connection from a Ptolemy II model.
protected  java.lang.Object _computeNodeWeight(ptolemy.actor.Actor actor)
          Construct an PSDFNodeWeight object that represents the given atomic actor from a Ptolemy II model.
protected  mocgraph.Graph _initializeGraph(ptolemy.actor.CompositeActor compositeActor)
          Return a newly-instantiated, empty PSDFGraph as initialization of the process of converting a Ptolemy II PSDF model to a PSDFGraph.
 
Methods inherited from class mapss.dif.ptolemy.DIFGraphReader
_processNewEdge, _processNewNode
 
Methods inherited from class mapss.dif.ptolemy.GraphReader
_transformTopology, convert
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PSDFGraphReader

public PSDFGraphReader()
Create a new PSDF graph reader.

Method Detail

_computeEdgeWeight

protected java.lang.Object _computeEdgeWeight(ptolemy.actor.IOPort sourcePort,
                                              ptolemy.actor.IOPort sinkPort)
Construct a PSDFEdgeWeight object that represents the given PSDF connection from a Ptolemy II model.

Overrides:
_computeEdgeWeight in class DIFGraphReader
Parameters:
sourcePort - the output port of the PSDF connection.
sinkPort - the input port of the PSDF connection.
Returns:
the object that represents the model's connection. The type of the object returned is PSDFEdgeWeight.
Throws:
java.lang.RuntimeException - if there is an error retrieving the PSDF attributes of the Ptolemy model's connection.

_computeNodeWeight

protected java.lang.Object _computeNodeWeight(ptolemy.actor.Actor actor)
Construct an PSDFNodeWeight object that represents the given atomic actor from a Ptolemy II model.

Overrides:
_computeNodeWeight in class DIFGraphReader
Parameters:
actor - the atomic actor
Returns:
the object that represents the atomic actor. The type of the object returned is PSDFNodeWeight.

_initializeGraph

protected mocgraph.Graph _initializeGraph(ptolemy.actor.CompositeActor compositeActor)
Return a newly-instantiated, empty PSDFGraph as initialization of the process of converting a Ptolemy II PSDF model to a PSDFGraph.

Overrides:
_initializeGraph in class DIFGraphReader
Parameters:
compositeActor - the Ptolemy II model that will be converted.
Returns:
an empty PSDFGraph.