public class BreakCausalityInterface extends DefaultCausalityInterface
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.
Dependency
_actor, _backwardPrunedDependencies, _defaultDependency, _delayDependencies, _EMPTY_COLLECTION, _forwardPrunedDependencies
Constructor and Description |
---|
BreakCausalityInterface(Actor actor,
Dependency defaultDependency)
Construct a causality interface for the specified actor.
|
Modifier and Type | Method and 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.
|
_growDependencies, declareDelayDependency, equivalentPorts, getActor, getDefaultDependency, toString
public BreakCausalityInterface(Actor actor, Dependency defaultDependency)
actor
- The actor for which this is a causality interface.defaultDependency
- The default dependency of an output
port on an input port.public java.util.Collection<IOPort> dependentPorts(IOPort port)
Derived classes may override this, but they may need to
also override getDependency(IOPort, IOPort)
and DefaultCausalityInterface.equivalentPorts(IOPort)
to be consistent.
dependentPorts
in interface CausalityInterface
dependentPorts
in class DefaultCausalityInterface
port
- The port to find the dependents of.public Dependency getDependency(IOPort input, IOPort output)
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)
and dependentPorts(IOPort)
to be consistent.
getDependency
in interface CausalityInterface
getDependency
in class DefaultCausalityInterface
input
- The specified input port.output
- The specified output port.public void removeDependency(IOPort inputPort, IOPort outputPort)
removeDependency
in interface CausalityInterface
removeDependency
in class DefaultCausalityInterface
inputPort
- The input port.outputPort
- The output port that does not depend on the
input port.getDependency(IOPort, IOPort)