mapss.dif.psdf
Class PSDFGraphs

java.lang.Object
  extended by mapss.dif.psdf.PSDFGraphs

public class PSDFGraphs
extends java.lang.Object

Utilities for working with parametereized synchronous dataflow graphs.

Version:
$Id: PSDFGraphs.java 409 2007-05-13 19:47:16Z plishker $
Author:
Ming-Yung Ko, Shuvra S. Bhattacharyya
See Also:
Graph, PSDFGraph

Method Summary
 PSDFGraph clusterNodes(PSDFGraph graph, java.util.Collection nodeCollection, mocgraph.Node superNode, mocgraph.Edge crossingEdge)
          Given a collection of nodes in a PSDF graph, replace the subgraph induced by the nodes with a single node N.
static java.util.List clusterNodesComplete(PSDFGraph graph, java.util.Collection nodeCollection, mocgraph.Node superNode, mocgraph.Edge crossingEdge)
          Given a collection of nodes in a PSDF graph, replace the subgraph induced by the nodes with a single node N.
static java.lang.String gcdExpression(java.lang.String expression1, java.lang.String expression2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

clusterNodes

public PSDFGraph clusterNodes(PSDFGraph graph,
                              java.util.Collection nodeCollection,
                              mocgraph.Node superNode,
                              mocgraph.Edge crossingEdge)
Given a collection of nodes in a PSDF graph, replace the subgraph induced by the nodes with a single node N. Besides topological clustering, this method also adjusts the token exchanging rates on affected edges and computes repetitions of the newly created super node. NOTE: presently it is assumed that the node collection contains exactly two nodes. The crossingEdge argument is an edge that is directed between these two nodes. It is used to determine repetition counts.

Parameters:
graph - The PSDF graph.
nodeCollection - The collection of nodes.
superNode - The PSDF node that replaces the subgraph.
crossingEdge - An edge directed between the nodes to be clustered.
Returns:
The subgraph that is replaced.

clusterNodesComplete

public static java.util.List clusterNodesComplete(PSDFGraph graph,
                                                  java.util.Collection nodeCollection,
                                                  mocgraph.Node superNode,
                                                  mocgraph.Edge crossingEdge)
Given a collection of nodes in a PSDF graph, replace the subgraph induced by the nodes with a single node N. This method returns both the subgraph and a map from newly created edges to old edges replaced. The map is important for cluster status tracking.

Parameters:
graph - The PSDF graph.
nodeCollection - The collection of nodes.
superNode - The PSDF node that replaces the subgraph.
Returns:
A list with the first element the subgraph and the second element a map of edges.

gcdExpression

public static java.lang.String gcdExpression(java.lang.String expression1,
                                             java.lang.String expression2)