public abstract class MetroIIDEDirectorForPtides extends DEDirector implements GetFirable
MetroIIDEDirectorForPtides is a much simpler version of MetroIIDEDirector with the assumption that all the actors are MetroII actors.
Modifier and Type | Class and Description |
---|---|
static class |
MetroIIDEDirectorForPtides.Pair<F,S>
Pair is a data structure used to store two elements.
|
NamedObj.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
protected java.util.Hashtable<java.lang.String,FireMachine> |
_actorDictionary
The list of actors governed by MetroIIDEDirector.
|
protected java.util.ArrayList<PtidesEvent> |
_eventList
The list of Ptides events that are currently being processed.
|
Parameter |
printTrace
Option parameter whether trace info is printed out.
|
_actorsFinished, _actorsInExecution, _disabledActors, _eventQueue, _eventQueueLock, _isInitializing, _microstep, _noMoreActorsToFire, _stopFireRequested, binCountFactor, enforceMicrostepSemantics, isCQAdaptive, minBinCount, stopWhenQueueIsEmpty, synchronizeToRealTime
_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 |
---|
MetroIIDEDirectorForPtides(CompositeEntity container,
java.lang.String name)
Constructs a director in the given container with the given name.
|
Modifier and Type | Method and Description |
---|---|
protected MetroIIDEDirectorForPtides.Pair<PtidesEvent,java.lang.Integer> |
_checkNextEventToFire()
_checkNextEventToFire finds the next Ptides event to fire and returns it
with an integer indicating: 0 if firing can be executed, and the next
event in event queue should be checked for processing; -1 if there's no
actor to fire, and we should not keep firing; 1 if there's no actor to
fire, but the next event should be checked for processing.
|
protected abstract PtidesEvent |
_getNextEventToFire()
Ptides director need to provide the implementation.
|
protected abstract void |
_resetLogicalTime()
Reset the logical time.
|
protected abstract void |
_setLogicalTime(PtidesEvent ptidesEvent)
Ptides director need to provide the implementation.
|
YieldAdapterIterable<java.lang.Iterable<metroIIcomm.Event.Builder>> |
adapter()
Since the MetroIIDEDirectorForPtides is always used inside a
MetroIICompositeActor, the adapter() in MetroIICompositeActor is
responsible for creating the iterator of getfire(), this adapter() should
never be called.
|
java.lang.Object |
clone(Workspace workspace)
Clones the object into the specified workspace.
|
void |
getfire(ResultHandler<java.lang.Iterable<metroIIcomm.Event.Builder>> resultHandler)
Fires actors according to Ptides events in the event queue.
|
void |
initialize()
Initializes the model controlled by this director.
|
void |
stop()
Requests the execution of the current iteration to stop.
|
_actorFired, _checkForNextEvent, _disableActor, _enqueueEvent, _enqueueTriggerEvent, _fire, _getDepthOfActor, _getDepthOfIOPort, _getNextActorToFire, _issueExecutionAspectWarning, _noActorToFire, _requestFiring, _schedule, addDebugListener, attributeChanged, cancelFireAt, cancelFireAt, describePriorities, fire, fireAt, fireAt, fireAtCurrentTime, fireAtRelativeTime, getCausalityInterface, getIndex, getMicrostep, getModelNextIterationTime, getNextEventTime, getStartTime, getStopTime, invalidateSchedule, mutexLockObject, newReceiver, postfire, prefire, preinitialize, removeDebugListener, resumeActor, setIndex, stopFire, suggestedModalModelDirectors, transferInputs, wrapup
_actorFinished, _consultTimeRegulators, _description, _isEmbedded, _isTopLevel, _transferInputs, _transferOutputs, addInitializable, createSchedule, defaultDependency, delayDependency, elapsedTimeSinceStart, finish, fireAt, fireContainerAt, fireContainerAt, getCurrentTime, getDeadline, getEnvironmentTime, getExecutionAspect, getGlobalTime, getModelStartTime, getModelStopTime, getModelTime, getNextIterationTime, getTimeResolution, implementsStrictActorSemantics, initialize, invalidateResolvedTypes, isEmbedded, isFireFunctional, isStopRequested, isStrict, iterate, notifyTokenSentToCommunicationAspect, preinitialize, removeInitializable, requestInitialization, resume, scheduleContainedActors, setContainer, setCurrentTime, setEmbedded, setModelTime, setTimeResolution, supportMultirateFiring, suspend, terminate, transferOutputs, transferOutputs
_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, 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, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
public Parameter printTrace
protected java.util.Hashtable<java.lang.String,FireMachine> _actorDictionary
protected java.util.ArrayList<PtidesEvent> _eventList
public MetroIIDEDirectorForPtides(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- Container of the director.name
- Name of this director.IllegalActionException
- If the director is not compatible with the specified
container. May be thrown in a derived class.NameDuplicationException
- If the container is not a CompositeActor and the name
collides with an entity in the container.public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
clone
in class DEDirector
workspace
- The workspace for the cloned object.java.lang.CloneNotSupportedException
- Not thrown in this base classNamedObj.exportMoML(Writer, int, String)
,
NamedObj.setDeferringChangeRequests(boolean)
public void initialize() throws IllegalActionException
This method should typically be invoked once per execution, after the preinitialization phase, but before any iteration. It may be invoked in the middle of an execution, if reinitialization is desired.
This method is not synchronized on the workspace, so the caller should be.
initialize
in interface Initializable
initialize
in class DEDirector
IllegalActionException
- If the initialize() method of one of the associated actors
throws it.public void stop()
stop
in interface Executable
stop
in class DEDirector
protected MetroIIDEDirectorForPtides.Pair<PtidesEvent,java.lang.Integer> _checkNextEventToFire() throws IllegalActionException
IllegalActionException
- If the firing actor throws it, or event queue is not ready,
or an event is missed, or time is set backwards.public void getfire(ResultHandler<java.lang.Iterable<metroIIcomm.Event.Builder>> resultHandler) throws CollectionAbortedException, IllegalActionException
getfire
in interface GetFirable
resultHandler
- iterable of events 'yield returned'.IllegalActionException
- If we couldn't process an event or if an event of smaller
timestamp is found within the event queue.CollectionAbortedException
public YieldAdapterIterable<java.lang.Iterable<metroIIcomm.Event.Builder>> adapter()
adapter
in interface GetFirable
protected abstract PtidesEvent _getNextEventToFire() throws IllegalActionException
IllegalActionException
protected abstract void _setLogicalTime(PtidesEvent ptidesEvent)
ptidesEvent
- Ptides event the logical time is set to.protected abstract void _resetLogicalTime()