public class CoroutineDirector extends Director implements Continuation
Modifier and Type | Class and Description |
---|---|
class |
CoroutineDirector.InternalEntryLocation |
class |
CoroutineDirector.InternalExitLocation |
NamedObj.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
Parameter |
entryMapping |
Parameter |
exitMapping |
Parameter |
initContinuationName |
Parameter |
nextMapping |
_actorsFinishedExecution, _aspectForActor, _aspectsPresent, _defaultMicrostep, _executionAspects, _finishRequested, _initializables, _nextScheduleTime, _stopRequested, _tokenSentToCommunicationAspect, _zeroTime, localClock, startTime, stopTime
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
COMPLETED, NOT_READY, STOP_ITERATING
Constructor and Description |
---|
CoroutineDirector() |
CoroutineDirector(CompositeEntity container,
java.lang.String name) |
CoroutineDirector(Workspace workspace) |
Modifier and Type | Method and Description |
---|---|
java.lang.String[] |
_extractMapSpec(Token t,
int n) |
Continuation |
_getContinuation(java.lang.String name) |
protected void |
_resetAllReceivers()
Reset all receivers to unknown status and clear out variables used
to track which actors fired in the last iteration.
|
void |
buildEntryMapFromParameter() |
void |
buildExitMapFromParameter() |
void |
buildMapFromConnections() |
void |
buildMapFromParameter() |
ControlExitToken |
controlEnter(ControlEntryToken entry) |
ControlExitToken |
controlEnterAt(ControlEntryToken.EntryLocation location) |
ControlExitToken |
controlInit() |
ControlExitToken |
controlResume() |
void |
debugShowMap() |
java.util.List<ControlEntryToken.EntryLocation> |
entryLocations()
Returns the set of exposed Entry Locations.
|
java.util.List<ControlExitToken.ExitLocation> |
exitLocations()
Returns the set of exposed Exit Locations.
|
void |
fire()
Iterate all the deeply contained actors of the
container of this director exactly once.
|
void |
initialize()
Initialize the model controlled by this director.
|
Receiver |
newReceiver()
Return a new receiver of a type compatible with this director.
|
boolean |
postfire()
Return true if the director wishes to be scheduled for another
iteration.
|
void |
preinitialize()
Validate the attributes and then invoke the preinitialize()
methods of all its deeply contained actors.
|
boolean |
transferInputs(IOPort port)
Transfer data from an input port of the container to the ports
it is connected to on the inside.
|
boolean |
transferOutputs(IOPort port)
Transfer data from an output port of the container to the
ports it is connected to on the outside.
|
_actorFinished, _consultTimeRegulators, _description, _isEmbedded, _isTopLevel, _schedule, _transferInputs, _transferOutputs, addInitializable, attributeChanged, clone, createSchedule, defaultDependency, delayDependency, elapsedTimeSinceStart, finish, fireAt, fireAt, fireAt, fireAtCurrentTime, fireContainerAt, fireContainerAt, getCausalityInterface, getCurrentTime, getDeadline, getEnvironmentTime, getExecutionAspect, getGlobalTime, getModelNextIterationTime, getModelStartTime, getModelStopTime, getModelTime, getNextIterationTime, getStartTime, getStopTime, getTimeResolution, implementsStrictActorSemantics, initialize, invalidateResolvedTypes, invalidateSchedule, isEmbedded, isFireFunctional, isStopRequested, isStrict, iterate, mutexLockObject, notifyTokenSentToCommunicationAspect, prefire, preinitialize, removeInitializable, requestInitialization, resume, resumeActor, scheduleContainedActors, setContainer, setCurrentTime, setEmbedded, setModelTime, setTimeResolution, stop, stopFire, suggestedModalModelDirectors, supportMultirateFiring, suspend, terminate, transferOutputs, wrapup
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
public Parameter initContinuationName
public Parameter entryMapping
public Parameter nextMapping
public Parameter exitMapping
public CoroutineDirector() throws IllegalActionException, NameDuplicationException
public CoroutineDirector(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
public CoroutineDirector(Workspace workspace) throws IllegalActionException, NameDuplicationException
public void fire() throws IllegalActionException
Director
This method is not synchronized on the workspace, so the caller should be.
In this base class, an attempt is made to fire each actor exactly once, in the order they were created. Prefire is called once, and if prefire returns true, then fire is called once, followed by postfire. The return value from postfire is ignored. If the container is not an instance of CompositeActor, however, then this method does nothing.
fire
in interface Executable
fire
in class Director
IllegalActionException
- If any called method of one
of the associated actors throws it.public void initialize() throws IllegalActionException
Director
initialize
in interface Initializable
initialize
in class Director
IllegalActionException
- If the initialize() method of
one of the associated actors throws it.public void buildMapFromParameter() throws IllegalActionException
IllegalActionException
public void buildEntryMapFromParameter() throws IllegalActionException
IllegalActionException
public void buildExitMapFromParameter() throws IllegalActionException
IllegalActionException
public void buildMapFromConnections()
public void debugShowMap()
public java.lang.String[] _extractMapSpec(Token t, int n)
public Continuation _getContinuation(java.lang.String name)
public boolean postfire() throws IllegalActionException
Director
In this base class, return the false if stop() has been called since preinitialize(), and true otherwise. Derived classes that override this method need to respect this semantics. The protected variable _stopRequested indicates whether stop() has been called.
postfire
in interface Executable
postfire
in class Director
IllegalActionException
- Not thrown in this base class.public void preinitialize() throws IllegalActionException
Director
This method also resets the protected variable _stopRequested to false, so if a derived class overrides this method, then it should also do that.
This method is not synchronized on the workspace, so the caller should be.
preinitialize
in interface Initializable
preinitialize
in class Director
IllegalActionException
- If the preinitialize() method of
one of the associated actors throws it.public ControlExitToken controlEnter(ControlEntryToken entry) throws IllegalActionException
controlEnter
in interface Continuation
IllegalActionException
public ControlExitToken controlInit() throws IllegalActionException
controlInit
in interface Continuation
IllegalActionException
public ControlExitToken controlResume() throws IllegalActionException
controlResume
in interface Continuation
IllegalActionException
public ControlExitToken controlEnterAt(ControlEntryToken.EntryLocation location) throws IllegalActionException
controlEnterAt
in interface Continuation
IllegalActionException
public java.util.List<ControlEntryToken.EntryLocation> entryLocations()
Continuation
entryLocations
in interface Continuation
public java.util.List<ControlExitToken.ExitLocation> exitLocations()
Continuation
exitLocations
in interface Continuation
public boolean transferInputs(IOPort port) throws IllegalActionException
Director
transferInputs
in class Director
port
- The port to transfer tokens from.IllegalActionException
- If the port is not an opaque
input port.public boolean transferOutputs(IOPort port) throws IllegalActionException
Director
transferOutputs
in class Director
port
- The port to transfer tokens from.IllegalActionException
- If the port is not an opaque
output port.public Receiver newReceiver()
Director
newReceiver
in class Director
protected void _resetAllReceivers()