ptolemy.actor.util
Interface CausalityInterface

All Known Implementing Classes:
BreakCausalityInterface, CausalityInterfaceForComposites, ContinuousIntegrator.IntegratorCausalityInterface, DefaultCausalityInterface, EnabledComposite.CausalityInterfaceForEnabledComposite, FSMCausalityInterface, FSMCausalityInterface, MirrorCausalityInterface, MirrorCausalityInterface, TDLCausalityInterface

public interface CausalityInterface

This interface defines a causality interfaces for actor networks as described in the paper "Causality Interfaces for Actor Networks" by Ye Zhou and Edward A. Lee, ACM Transactions on Embedded Computing Systems (TECS), April 2008, as available as Technical Report No. UCB/EECS-2006-148, November 16, 2006. Causality interfaces represent dependencies between input and output ports of an actor and can be used to perform scheduling or static analysis on actor models. Implementers of this interface must ensure consistency between the methods dependentPorts(IOPort), equivalentPorts(IOPort), and getDependency(IOPort, IOPort).

Since:
Ptolemy II 8.0
Version:
$Id: CausalityInterface.java 57044 2010-01-27 22:41:05Z cxh $
Author:
Edward A. Lee
See Also:
Dependency
Accepted Rating:
Red (eal)
Proposed Rating:
Yellow (eal)

Method Summary
 void declareDelayDependency(IOPort input, IOPort output, double timeDelay, int index)
          Set the dependency that the specified output port has on the specified input port to represent a time delay with the specified value and superdense time index.
 java.util.Collection<IOPort> dependentPorts(IOPort port)
          Return a collection of the ports in this actor that depend on or are depended on by the specified port.
 java.util.Collection<IOPort> equivalentPorts(IOPort input)
          Return a collection of input ports in the associated actor that are in the same equivalence class as the specified input port.
 Actor getActor()
          Return the associated actor.
 Dependency getDefaultDependency()
          Return the default dependency.
 Dependency getDependency(IOPort input, IOPort output)
          Return the dependency between the specified input port and the specified output port.
 void removeDependency(IOPort inputPort, IOPort outputPort)
          Remove the dependency that the specified output port has on the specified input port, meaning that the dependency is set to oPlusIdentity.
 

Method Detail

declareDelayDependency

void declareDelayDependency(IOPort input,
                            IOPort output,
                            double timeDelay,
                            int index)
Set the dependency that the specified output port has on the specified input port to represent a time delay with the specified value and superdense time index. Implementations of this method should be adaptive to the type of Dependency provided by the director. For example, if the director provides a BooleanDependency, then an implementation of this method should define the dependency to be oTimesIdentity if the timeDelay is 0.0 and the index is 0, and otherwise it should be oPlusIdentity.

Parameters:
input - The input port.
output - The output port with a time delay dependency on the input port.
timeDelay - The time delay.
index - The superdense time index.

dependentPorts

java.util.Collection<IOPort> dependentPorts(IOPort port)
                                            throws IllegalActionException
Return a collection of the ports in this actor that depend on or are depended on by the specified port. A port Y depends on a port X if Y is an output and X is an input and getDependency(X,Y) return the oTimesIdentity. The argument port should be contained by the same actor returned by getActor().

Parameters:
port - The port to find the dependents of.
Returns:
a collection of ports that this actor depends on or are depended on by the specified port.
Throws:
IllegalActionException - If the dependency cannot be determined.

equivalentPorts

java.util.Collection<IOPort> equivalentPorts(IOPort input)
                                             throws IllegalActionException
Return a collection of input ports in the associated actor that are in the same equivalence class as the specified input port. An equivalence class is defined as follows. If input ports X and Y each have a dependency equal to the default dependency's oTimesIdentity to any common output port or to the state of the associated actor, then they are in an equivalence class. That is, there is a causal dependency. They are also in the same equivalence class if there is a port Z in an equivalence class with X and in an equivalence class with Y. Otherwise, they are not in the same equivalence class.

Parameters:
input - The port to find the equivalence class of.
Returns:
a collection of input ports that are in the same equivalence class as the specified input port.
Throws:
IllegalActionException - If the equivalent ports cannot be determined.

getActor

Actor getActor()
Return the associated actor.

Returns:
The actor for which this is a dependency.

getDefaultDependency

Dependency getDefaultDependency()
Return the default dependency.

Returns:
The default dependency.

getDependency

Dependency getDependency(IOPort input,
                         IOPort output)
                         throws IllegalActionException
Return the dependency between the specified input port and the specified output port.

Parameters:
input - The specified input port.
output - The specified output port.
Returns:
The dependency between the specified input port and the specified output port.
Throws:
IllegalActionException - If the dependency cannot be determined.

removeDependency

void removeDependency(IOPort inputPort,
                      IOPort outputPort)
Remove the dependency that the specified output port has on the specified input port, meaning that the dependency is set to oPlusIdentity. If there is no defined dependency between the two ports, then this method will have no effect.

Parameters:
inputPort - The input port.
outputPort - The output port that does not depend on the input port.