ptolemy.domains.modal.modal
Class MirrorCausalityInterface
java.lang.Object
ptolemy.actor.util.DefaultCausalityInterface
ptolemy.actor.util.CausalityInterfaceForComposites
ptolemy.domains.modal.modal.MirrorCausalityInterface
- All Implemented Interfaces:
- CausalityInterface
public class MirrorCausalityInterface
- extends CausalityInterfaceForComposites
This class infers a causality interface from causality interfaces provided
in the constructor and in the composeWith(ptolemy.actor.util.CausalityInterface)
method. For each of these
interfaces, this interface finds ports in its own actor that match the names
of those for the specified interfaces, and constructs dependencies that
are oPlus compositions of the dependencies in the specified interfaces for
ports with the same names. For equivalence classes, it merges the equivalence
classes so that if two ports are equivalent in any of the provided causality
interfaces, then the corresponding (same named) ports in the actor are also
equivalent.
- Since:
- Ptolemy II 8.0
- Version:
- $Id: MirrorCausalityInterface.java 57044 2010-01-27 22:41:05Z cxh $
- Author:
- Edward A. Lee
- Accepted Rating:
- Proposed Rating:
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
_composedInterfaces
private java.util.Set<CausalityInterface> _composedInterfaces
- The set of causality interfaces that this one composes.
MirrorCausalityInterface
public MirrorCausalityInterface(Actor actor,
CausalityInterface causality)
throws java.lang.IllegalArgumentException
- Construct a causality interface that mirrors the specified causality
interface.
- Parameters:
actor
- The actor for which this is an interface.causality
- The interface to mirror.
- Throws:
java.lang.IllegalArgumentException
- If the actor parameter is not
an instance of CompositeEntity.
composeWith
public void composeWith(CausalityInterface causality)
- Add the specified causality interface for the specified actor.
- Parameters:
causality
- The interface to compose with the one specified
in the constructor.
getDependency
public Dependency getDependency(IOPort input,
IOPort output)
throws IllegalActionException
- Return the dependency between the specified input port
and the specified output port. This is done by checking
the guards and actions of all the transitions.
When called for the first time since a change in the model
structure, this method performs the complete analysis of
the FSM and caches the result. Subsequent calls just
look up the result.
- Specified by:
getDependency
in interface CausalityInterface
- Overrides:
getDependency
in class CausalityInterfaceForComposites
- Parameters:
input
- The input port.output
- The output port, or null to update the
dependencies (and record equivalence classes) without
requiring there to be an output port.
- Returns:
- The dependency between the specified input port
and the specified output port, or null if a null output
is port specified.
- Throws:
IllegalActionException
- If a guard expression cannot be parsed.
_localMirrors
private java.util.Collection<IOPort> _localMirrors(java.util.Collection<IOPort> ports)
throws IllegalActionException
- Return the local ports whose names match the ports in the
specified collection.
- Parameters:
ports
- A collection of ports.
- Throws:
IllegalActionException
- If no matching port is found.