public class DoNothingDirector extends Director
This director is added to models for code generation purposes when the model has no useful execution but the code generator runs CompositeActor.preinitialize().
If this director is used in a model, then adding a _hide
attribute to the director will make the director invisible to the user.
NamedObj.ContainedObjectsIterator
_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 |
---|
DoNothingDirector(CompositeEntity container,
java.lang.String name)
Construct a director with the given container and name.
|
Modifier and Type | Method and Description |
---|---|
void |
addInitializable(Initializable initializable)
Add the specified object to the set of objects whose
preinitialize(), initialize(), and wrapup()
methods should be invoked upon invocation of the corresponding
methods of this object.
|
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.
|
boolean |
postfire()
Return true if the director wishes to be scheduled for another
iteration.
|
boolean |
prefire()
Return true if the director is ready to fire.
|
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, 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, newReceiver, notifyTokenSentToCommunicationAspect, 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 DoNothingDirector(CompositeEntity container, java.lang.String name) throws NameDuplicationException, IllegalActionException
container
- The container.name
- The name of this actor.IllegalActionException
- If the entity cannot be contained
by the proposed container.NameDuplicationException
- If the container already has an
actor with this name.public void addInitializable(Initializable initializable)
Director
addInitializable
in interface Initializable
addInitializable
in class Director
initializable
- The object whose methods should be invoked.Director.removeInitializable(Initializable)
,
CompositeActor.addPiggyback(Executable)
public void fire()
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
public void initialize()
Director
initialize
in interface Initializable
initialize
in class Director
public boolean postfire()
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
public boolean prefire()
Director
In this base class, assume that the director is always ready to be fired, and so return true. Domain directors should probably override this method to provide domain-specific behavior. However, they should call super.prefire() if they wish to propagate time as done here.
prefire
in interface Executable
prefire
in class Director
public void preinitialize()
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
public boolean transferInputs(IOPort port)
Director
transferInputs
in class Director
port
- The port to transfer tokens from.public boolean transferOutputs(IOPort port)
Director
transferOutputs
in class Director
port
- The port to transfer tokens from.