mapss.dif.csdf.sdf
Class SDFGraphReader

java.lang.Object
  extended by mapss.dif.ptolemy.GraphReader
      extended by mapss.dif.ptolemy.DIFGraphReader
          extended by mapss.dif.csdf.sdf.SDFGraphReader

public class SDFGraphReader
extends DIFGraphReader

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

Version:
$Id: SDFGraphReader.java 406 2007-05-10 14:27:07Z plishker $
Author:
Shuvra S. Bhattacharyya
See Also:
SDFGraph

Constructor Summary
SDFGraphReader()
          Create a new SDF graph reader.
 
Method Summary
protected  java.lang.Object _computeEdgeWeight(ptolemy.actor.IOPort sourcePort, ptolemy.actor.IOPort sinkPort)
          Construct an SDFEdgeWeight object that represents the given SDF connection from a Ptolemy II model.
protected  java.lang.Object _computeNodeWeight(ptolemy.actor.Actor actor)
          Construct an SDFNodeWeight 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 SDFGraph as initialization of the process of converting a Ptolemy II SDF model to an SDFGraph.
protected  void _transformTopology(mocgraph.Graph graph)
          Convert instances of the SampleDelay actor in an SDF graph into edge delays.
 void setDelayTransformation()
          Configure the reader so that Ptolemy II delay actors (SampleDelay actors) will be converted (in subsequent reader invocations) to edge delays as a post-processing step of graph conversion.
 
Methods inherited from class mapss.dif.ptolemy.DIFGraphReader
_processNewEdge, _processNewNode
 
Methods inherited from class mapss.dif.ptolemy.GraphReader
convert
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SDFGraphReader

public SDFGraphReader()
Create a new SDF graph reader.

Method Detail

setDelayTransformation

public void setDelayTransformation()
Configure the reader so that Ptolemy II delay actors (SampleDelay actors) will be converted (in subsequent reader invocations) to edge delays as a post-processing step of graph conversion. In this post-processing step, each sample delay actor is removed from the graph, along with its input and output edge. These three entities are replaced by a single edge with the SDF attributes set accordingly. By default, this transformation option is turned off. This method enables the transformation.


_computeEdgeWeight

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

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

_computeNodeWeight

protected java.lang.Object _computeNodeWeight(ptolemy.actor.Actor actor)
Construct an SDFNodeWeight 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 SDFNodeWeight.

_initializeGraph

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

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

_transformTopology

protected void _transformTopology(mocgraph.Graph graph)
Convert instances of the SampleDelay actor in an SDF graph into edge delays. Each sample delay actor is removed from the graph, along with its input and output edge. These three entities are replaced by a single edge with the SDF attributes set accordingly.

Overrides:
_transformTopology in class mapss.dif.ptolemy.GraphReader
Parameters:
graph - the SDF graph.