ptolemy.actor.util
Class FunctionDependencyOfCompositeActor

java.lang.Object
  extended byptolemy.actor.util.FunctionDependency
      extended byptolemy.actor.util.FunctionDependencyOfCompositeActor
Direct Known Subclasses:
FunctionDependencyOfModalModel

public class FunctionDependencyOfCompositeActor
extends FunctionDependency

An instance of FunctionDependencyOfCompositeActor describes the function dependency information a composite actor. It provides both the abstracted view, which gives the function dependency that output ports of the actor have on input ports, and a detailed view from which it constructs this information. The detailed view is a graph where the nodes correspond to the ports of this composite actor and to the ports of all deeply contained opaque actors, and the edges represent either the communication dependencies implied by the connections within this composite actor or the function dependencies of the contained opaque actors. The detailed view can be used by a director to construct a schedule.

The detailed view may reveal dependency loops, which in many domains means that the model cannot be executed. To check whether there are such loops, use the getCycleNodes() method. The method returns an array of IOPorts in such loops, of an empty array if there are no such loops.

Since:
Ptolemy II 4.0
Version:
$Id: FunctionDependencyOfCompositeActor.java,v 1.1.2.4 2004/06/22 03:49:05 cxh Exp $
Author:
Haiyang Zheng
See Also:
FunctionDependency
Accepted Rating:
Yellow (eal)
Proposed Rating:
Green (hyzheng)

Field Summary
 
Fields inherited from class ptolemy.actor.util.FunctionDependency
_dependencyGraph
 
Constructor Summary
FunctionDependencyOfCompositeActor(Actor actor)
          Construct a FunctionDependency for the given actor.
 
Method Summary
protected  void _constructDependencyGraph()
          Construct a dependency graph from a detailed dependency graph by excluding the internal ports.
protected  java.util.List _getEntities()
          Get a list of embedded entities for function dependency calculation.
 java.lang.Object[] getCycleNodes()
          If there is a dependency loop in the dependency graph of this FunctionDependency object, return the nodes in the dependency loop.
 DirectedGraph getDetailedDependencyGraph()
          Return a detailed dependency graph representing the function dependency information.
 
Methods inherited from class ptolemy.actor.util.FunctionDependency
_constructConnectedDependencyGraph, _constructDisconnectedDependencyGraph, _validate, getActor, getDependencyGraph, getDependentOutputPorts, getInputPortsDependentOn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FunctionDependencyOfCompositeActor

public FunctionDependencyOfCompositeActor(Actor actor)
Construct a FunctionDependency for the given actor.

Parameters:
actor - The associated actor.
Method Detail

getCycleNodes

public java.lang.Object[] getCycleNodes()
If there is a dependency loop in the dependency graph of this FunctionDependency object, return the nodes in the dependency loop. If there are multiple loops, all the nodes will be returned. If there is no loops, return an empty array. The elements of the returned array are instances of IOPort.

Returns:
An array that contains the IOPorts in dependency loops, or an empty array if there are no such loops.

getDetailedDependencyGraph

public DirectedGraph getDetailedDependencyGraph()
Return a detailed dependency graph representing the function dependency information. The graph includes both the ports of this composite actor and the ports of ports of its deeply contained opaque actors (composite or atomic).

Returns:
A detailed dependency graph reflecting the dependency information between the input and output ports.

_constructDependencyGraph

protected void _constructDependencyGraph()
Construct a dependency graph from a detailed dependency graph by excluding the internal ports.

Overrides:
_constructDependencyGraph in class FunctionDependency

_getEntities

protected java.util.List _getEntities()
Get a list of embedded entities for function dependency calculation.

Returns:
A list of embedded entities.