Interface StartOrResumable

  • All Known Implementing Classes:
    BlockingFire, FireMachine, NonBlockingFire, ResumableFire

    public interface StartOrResumable
    StartOrResumable defines the interface of an actor to MetroIIDirector. This interface defines the common functionality in atomic actor and composite actor.
    Since:
    Ptolemy II 11.0
    Version:
    $Id$
    Author:
    Liangpeng Guo
    Pt.AcceptedRating:
    Red (glp)
    Pt.ProposedRating:
    Red (glp)
    • Method Detail

      • startOrResume

        void startOrResume​(java.util.LinkedList<metroIIcomm.Event.Builder> metroIIEventList)
                    throws IllegalActionException

        If startOrResume() resumes from the state it saves last time. The state means local variables, stacks or anything it needs to resume the execution of last time. Continue iteratively executing the actor until any MetroII Event is proposed. When MetroII Events are proposed, the function returns with the state saved and the proposed events added into metroIIEventList.

        IMPORTANT: the references of MetroII Events could be part of the state of the function. The events are returned in metroIIEventList and may be updated externally (the event status may change from PROPOSED to WAITING or NOTIFIED). Therefore, when the function resumes the state, it should continue the execution based on updated MetroII Events.

        Parameters:
        metroIIEventList - List of MetroII Events
        Throws:
        IllegalActionException - if the associated action (e.g. firing) is not permitted.
      • reset

        void reset()
        Reset the state of startOrResumable.