Class CSP

  • All Implemented Interfaces:
    Executable, Initializable, DDI

    public class CSP
    extends AbstractDDI
    Since:
    Ptolemy II 4.0
    Version:
    $Id$
    Author:
    Christopher Chang
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Red (cxh)
    • Constructor Summary

      Constructors 
      Constructor Description
      CSP​(TypedAtomicActor ptActor, caltrop.interpreter.ast.Actor actor, caltrop.interpreter.Context context, caltrop.interpreter.environment.Environment env)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void fire()
      Fire the actor.
      java.lang.String getName()
      Get the name of the domain that this DDI implements.
      void initialize()
      Begin execution of the actor.
      boolean isLegalActor()
      Perform static checking on the actor, ensuring its validity in a given domain.
      boolean postfire()
      This method should be invoked once per iteration, after the last invocation of fire() in that iteration.
      boolean prefire()
      This method should be invoked prior to each invocation of fire().
      void preinitialize()
      This method should be invoked exactly once per execution of a model, before any of these other methods are invoked.
      void setupActor()
      Perform any domain dependent setup.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CSP

        public CSP​(TypedAtomicActor ptActor,
                   caltrop.interpreter.ast.Actor actor,
                   caltrop.interpreter.Context context,
                   caltrop.interpreter.environment.Environment env)
    • Method Detail

      • isLegalActor

        public boolean isLegalActor()
        Description copied from interface: DDI
        Perform static checking on the actor, ensuring its validity in a given domain.
        Returns:
        True, if the actor is legal.
      • setupActor

        public void setupActor()
        Description copied from interface: DDI
        Perform any domain dependent setup. This can include hanging various attributes off of the actor, for example, the rate of the input and output ports.
      • getName

        public java.lang.String getName()
        Description copied from interface: DDI
        Get the name of the domain that this DDI implements.
        Returns:
        The name of the domain that this DDI implements.
      • fire

        public void fire()
                  throws IllegalActionException
        Description copied from interface: Executable
        Fire the actor. This may be invoked several times between invocations of prefire() and postfire(). Output data may (and normally will) be produced. Typically, the fire() method performs the computation associated with an actor. This method is not required to have bounded execution. However, after endFire() is called, this method should return in bounded time.
        Throws:
        IllegalActionException - If firing is not permitted.
      • initialize

        public void initialize()
                        throws IllegalActionException
        Description copied from interface: Initializable
        Begin execution of the actor. This is invoked exactly once after the preinitialization phase. Since type resolution is done in the preinitialization phase, along with topology changes that may be requested by higher-order function actors, an actor can produce output data and schedule events in the initialize() method.
        Throws:
        IllegalActionException - If execution is not permitted.
      • postfire

        public boolean postfire()
                         throws IllegalActionException
        Description copied from interface: Executable
        This method should be invoked once per iteration, after the last invocation of fire() in that iteration. The postfire() method should not produce output data on output ports of the actor. It returns true if the execution can proceed into the next iteration, false if the actor does not wish to be fired again. This method typically wraps up an iteration, which may involve updating local state or updating displays.
        Returns:
        True if the execution can continue.
        Throws:
        IllegalActionException - If postfiring is not permitted.
      • prefire

        public boolean prefire()
                        throws IllegalActionException
        Description copied from interface: Executable
        This method should be invoked prior to each invocation of fire(). It returns true if the fire() method can be invoked, given the current status of the inputs and parameters of the actor. Thus this method will typically check preconditions for a firing, if there are any. In an opaque, non-atomic entity, it may move data into an inner subsystem.
        Returns:
        True if the iteration can proceed.
        Throws:
        IllegalActionException - If prefiring is not permitted.
      • preinitialize

        public void preinitialize()
                           throws IllegalActionException
        Description copied from interface: Initializable
        This method should be invoked exactly once per execution of a model, before any of these other methods are invoked. For actors, this is invoked prior to type resolution and may trigger changes in the topology, changes in the type constraints.
        Throws:
        IllegalActionException - If initializing is not permitted.