ptolemy.domains.tdl.kernel
Class TDLCausalityInterface

java.lang.Object
  extended by ptolemy.actor.util.DefaultCausalityInterface
      extended by ptolemy.actor.util.CausalityInterfaceForComposites
          extended by ptolemy.domains.tdl.kernel.TDLCausalityInterface
All Implemented Interfaces:
CausalityInterface

public class TDLCausalityInterface
extends CausalityInterfaceForComposites

This class gives a specialized causality interface for TDL.

Since:
Ptolemy II 8.0
Version:
$Id: TDLCausalityInterface.java 57044 2010-01-27 22:41:05Z cxh $
Author:
Patricia Derler, Contributor: Edward A. Lee
Accepted Rating:
Red (eal)
Proposed Rating:
Yellow (eal)

Field Summary
private  java.util.Map<IOPort,Dependency> _minimumDelays
          Cache of minimum delays that were already computed.
 
Fields inherited from class ptolemy.actor.util.CausalityInterfaceForComposites
_actorDepthVersion, _actorToDepth, _dependencyVersion, _equivalenceClasses, _forwardDependencies, _reverseDependencies
 
Fields inherited from class ptolemy.actor.util.DefaultCausalityInterface
_actor, _backwardPrunedDependencies, _defaultDependency, _delayDependencies, _EMPTY_COLLECTION, _forwardPrunedDependencies
 
Constructor Summary
TDLCausalityInterface(Actor actor, Dependency defaultDependency)
          Construct a causality interface for the specified actor.
 
Method Summary
private  Dependency _getMinimumDelay(IOPort port, java.util.Collection<IOPort> visitedPorts)
          Recursively compute the minimum delay.
 Dependency getMinimumDelay(IOPort port)
          Return the minimum delay for this port.
 void wrapup()
          Override the base class Clear local variables.
 
Methods inherited from class ptolemy.actor.util.CausalityInterfaceForComposites
_computeActorDepth, checkForCycles, dependentPorts, describeDepths, equivalentPorts, getDependency, getDepthOfActor, getDepthOfPort, invalidate, removeDependency, topologicalSort
 
Methods inherited from class ptolemy.actor.util.DefaultCausalityInterface
_growDependencies, declareDelayDependency, getActor, getDefaultDependency, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_minimumDelays

private java.util.Map<IOPort,Dependency> _minimumDelays
Cache of minimum delays that were already computed.

Constructor Detail

TDLCausalityInterface

public TDLCausalityInterface(Actor actor,
                             Dependency defaultDependency)
                      throws java.lang.IllegalArgumentException
Construct a causality interface for the specified actor.

Parameters:
actor - The actor for which this is a causality interface. This is required to be an instance of CompositeEntity.
defaultDependency - The default dependency of an output port on an input port.
Throws:
java.lang.IllegalArgumentException - If the actor parameter is not an instance of CompositeEntity.
Method Detail

getMinimumDelay

public Dependency getMinimumDelay(IOPort port)
                           throws IllegalActionException
Return the minimum delay for this port. The minimum delay is the minimum model time delay between this port or any equivalent port and a source actor.

Parameters:
port - Port for which the minimum delay should be computed.
Returns:
the minimum delay for the specified port.
Throws:
IllegalActionException - Thrown if minimum delay cannot be computed, because e.g. equivalent ports cannot be computed.

wrapup

public void wrapup()
Override the base class Clear local variables.


_getMinimumDelay

private Dependency _getMinimumDelay(IOPort port,
                                    java.util.Collection<IOPort> visitedPorts)
                             throws IllegalActionException
Recursively compute the minimum delay. To avoid loops, remember visited ports.

Parameters:
port - Port to compute minimum delay for.
visitedPorts - Ports that have already been considered in the recursive computation.
Returns:
Dependency describing the minimum Delay.
Throws:
IllegalActionException - Thrown if minimum delay cannot be computed.