Class 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$
    Author:
    Edward A. Lee
    Pt.AcceptedRating:
    Red (eal)
    Pt.ProposedRating:
    Yellow (eal)
    • Constructor Detail

      • 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.
    • Method Detail

      • 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.