Class BreakCausalityInterface
- java.lang.Object
-
- ptolemy.actor.util.DefaultCausalityInterface
-
- ptolemy.actor.util.BreakCausalityInterface
-
- All Implemented Interfaces:
CausalityInterface
public class BreakCausalityInterface extends DefaultCausalityInterface
This class provides a causality interface where no output port depends on any input port. That is, the dependency of any output port on any input port is the oPlusIdentity() of the specified default dependency.The
DefaultCausalityInterface.equivalentPorts(IOPort)
normally returns list containing only the specified port. If, however, the actor has any instance of PortParameter in its input port list, then it returns a list of all input ports. The reason for this is that any output, present or future, may depend on the values at such port parameters. In particular, it is necessary for inputs on these port parameters to be present when any other input is processed because it affects the parameters of the actor. It is more efficient to use this class than to use the base class and call removeDependency() to remove all the dependencies.- Since:
- Ptolemy II 8.0
- Version:
- $Id$
- Author:
- Edward A. Lee
- See Also:
Dependency
- Pt.AcceptedRating:
- Red (eal)
- Pt.ProposedRating:
- Yellow (eal)
-
-
Field Summary
-
Fields inherited from class ptolemy.actor.util.DefaultCausalityInterface
_actor, _backwardPrunedDependencies, _defaultDependency, _delayDependencies, _EMPTY_COLLECTION, _forwardPrunedDependencies
-
-
Constructor Summary
Constructors Constructor Description BreakCausalityInterface(Actor actor, Dependency defaultDependency)
Construct a causality interface for the specified actor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.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.-
Methods inherited from class ptolemy.actor.util.DefaultCausalityInterface
_growDependencies, declareDelayDependency, equivalentPorts, getActor, getDefaultDependency, toString
-
-
-
-
Constructor Detail
-
BreakCausalityInterface
public BreakCausalityInterface(Actor actor, Dependency defaultDependency)
Construct a causality interface for the specified actor.- Parameters:
actor
- The actor for which this is a causality interface.defaultDependency
- The default dependency of an output port on an input port.
-
-
Method Detail
-
dependentPorts
public 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. This method returns an empty collection.Derived classes may override this, but they may need to also override
getDependency(IOPort, IOPort)
andDefaultCausalityInterface.equivalentPorts(IOPort)
to be consistent.- Specified by:
dependentPorts
in interfaceCausalityInterface
- Overrides:
dependentPorts
in classDefaultCausalityInterface
- Parameters:
port
- The port to find the dependents of.- Returns:
- a collection of ports, this method returns an empty collection of ports
-
getDependency
public Dependency getDependency(IOPort input, IOPort output)
Return the dependency between the specified input port and the specified output port. This method returns the oPlusIdentity() of the default dependency given in the constructor.Derived classes should override this method to provide actor-specific dependency information. If they do so, then they may also need to override
DefaultCausalityInterface.equivalentPorts(IOPort)
anddependentPorts(IOPort)
to be consistent.- Specified by:
getDependency
in interfaceCausalityInterface
- Overrides:
getDependency
in classDefaultCausalityInterface
- Parameters:
input
- The specified input port.output
- The specified output port.- Returns:
- The dependency between the specified input port and the specified output port.
-
removeDependency
public void removeDependency(IOPort inputPort, IOPort outputPort)
Remove the dependency that the specified output port has on the specified input port. This method does nothing since in this class, all dependencies have already been removed.- Specified by:
removeDependency
in interfaceCausalityInterface
- Overrides:
removeDependency
in classDefaultCausalityInterface
- Parameters:
inputPort
- The input port.outputPort
- The output port that does not depend on the input port.- See Also:
getDependency(IOPort, IOPort)
-
-