ptolemy.domains.modal.kernel
Interface Suspendable

All Superinterfaces:
Executable, Initializable
All Known Implementing Classes:
ContinuousDirector, Refinement, TransitionRefinement

public interface Suspendable
extends Executable

An interface for actors that can be suspended and resumed.

Since:
Ptolemy II 8.0
Version:
$Id: Suspendable.java 57046 2010-01-27 23:35:53Z cxh $
Author:
Edward A. Lee
Accepted Rating:
red (eal)
Proposed Rating:
red (eal)

Field Summary
 
Fields inherited from interface ptolemy.actor.Executable
COMPLETED, NOT_READY, STOP_ITERATING
 
Method Summary
 Time accumulatedSuspendTime()
          Return the accumulated time that the actor has been suspended since the last call to initialize(), or null if it has never been suspended.
 void resume(Time time)
          Resume the actor at the specified time.
 void suspend(Time time)
          Suspend the actor at the specified time.
 
Methods inherited from interface ptolemy.actor.Executable
fire, isFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminate
 
Methods inherited from interface ptolemy.actor.Initializable
addInitializable, initialize, preinitialize, removeInitializable, wrapup
 

Method Detail

accumulatedSuspendTime

Time accumulatedSuspendTime()
Return the accumulated time that the actor has been suspended since the last call to initialize(), or null if it has never been suspended.

Returns:
The total time between calls to suspend and subsequent calls to resume, or null if the actor has not been suspended.

resume

void resume(Time time)
            throws IllegalActionException
Resume the actor at the specified time. If the actor has not been suspended since the last call to initialize(), then this has no effect.

Parameters:
time - The time at which the actor is resumed.
Throws:
IllegalActionException - If the resume cannot be completed.

suspend

void suspend(Time time)
             throws IllegalActionException
Suspend the actor at the specified time. If the actor is already suspended, then it remains suspended but the accumulated suspend time is incremented by the time since it was last suspended.

Parameters:
time - The time at which the actor is suspended.
Throws:
IllegalActionException - If the suspend cannot be completed.