public abstract class SequencedModelDirector extends Director
The SequencedModelDirector
- Computes the sequenced actors and passes these in two lists to the
SequenceScheduler (one list for independent sequenced actors, and one list
for sequenced actors that are dependent on other actors e.g. control actors)
Red (beth) |
Red (beth) |
NamedObj.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
protected int |
_iterationCount
The iteration count.
|
protected boolean |
_postfireReturns
The value that the postfire method will return.
|
protected SequenceScheduler |
_scheduler
The scheduler for this director.
|
protected java.util.List<SequenceAttribute> |
_sequencedList
The list of sequenced actors in the model.
|
Parameter |
defaultOutputInitialValue
If true, enable default output initial values.
|
Parameter |
fireUnexecutedActors
If true, fire any unexecuted actors that were not fired during
the sequence schedule.
|
Parameter |
iterations
A Parameter representing the number of times that postfire may be
called before it returns false.
|
Parameter |
userDefinedDefaultOutputInitialValue
The user defined default output initial value.
|
Parameter |
userDefinedOutputInitialValue
If true, enable user defined output initial values.
|
_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 |
---|
SequencedModelDirector()
Construct a director in the default workspace with an empty string
as its name.
|
SequencedModelDirector(CompositeEntity container,
java.lang.String name)
Construct a director in the given container with the given name.
|
SequencedModelDirector(Workspace workspace)
Construct a director in the workspace with an empty name.
|
Modifier and Type | Method and Description |
---|---|
protected static java.lang.String |
_getInitialValueParameterName(TypedIOPort port,
int channel)
Return the initialValueParameter Name for each of the port.
|
protected void |
_init()
Initialize the object.
|
protected void |
_setScheduler(SequenceScheduler scheduler)
Copied from SDFDirector; also, same as in StaticSchedulingDirector
Set the local scheduler for execution of this Director.
|
void |
checkAttributeType(Actor actor,
java.util.List sequenceAttributes,
java.util.List processAttributes)
Check for SequenceAttribute or ProcessAttribute for multiple
or wrong occurrence in the model.
|
java.lang.Object |
clone(Workspace workspace)
Code copied from StaticSchedulingDirector
FIXME: Do we just want a SequencedModelDirector to be a subclass of
StaticSchedulingDirector?
|
protected void |
fireSchedule(SequenceSchedule seqSchedule)
Fire the given SequenceSchedule.
|
void |
getContainedEntities(CompositeActor compositeActor)
The SequencedModelDirector adds all actors with sequence numbers to the
_sequencedList, regardless of whether or not the actors have a
process attribute.
|
SequenceScheduler |
getScheduler()
Return the scheduler that is responsible for scheduling the
directed actors.
|
void |
initialize()
Initialize the actors associated with this director and then
set the iteration count to zero.
|
void |
invalidateSchedule()
Indicate that a schedule for the model may no longer be valid.
|
boolean |
isScheduleValid()
Return true if the current (cached) schedule is valid.
|
Receiver |
newReceiver()
Return a new receiver consistent with the Sequence domain.
|
boolean |
postfire()
Return false if the system has finished executing, either by
reaching the iteration limit, or having an actor in the system return
false in postfire.
|
void |
preinitialize()
Preinitialize will be added to in subclasses
Preinitialize the actors associated with this director and
compute the schedule.
|
void |
setOutputInitialValues(Entity actorEntity)
Set the initial values for output ports.
|
void |
setScheduler(SequenceScheduler scheduler)
Copied from SDFScheduler; also, same as in StaticSchedulingDirector
Set the scheduler for this SequenceDirector.
|
java.lang.String[] |
suggestedModalModelDirectors()
Return an array of suggested ModalModel directors to use with
SequencedModelDirector.
|
boolean |
supportMultirateFiring()
Return true to indicate that a ModalModel under control
of this director supports multirate firing.
|
_actorFinished, _consultTimeRegulators, _description, _isEmbedded, _isTopLevel, _schedule, _transferInputs, _transferOutputs, addInitializable, attributeChanged, createSchedule, defaultDependency, delayDependency, finish, fire, fireAt, fireAt, fireAt, fireAtCurrentTime, fireContainerAt, fireContainerAt, getCausalityInterface, getCurrentTime, getDeadline, getEnvironmentTime, getErrorTolerance, getExecutionAspect, getGlobalTime, getModelNextIterationTime, getModelStartTime, getModelStopTime, getModelTime, getNextIterationTime, getStartTime, getStopTime, getTimeResolution, implementsStrictActorSemantics, initialize, invalidateResolvedTypes, isEmbedded, isFireFunctional, isStopRequested, isStrict, iterate, mutexLockObject, notifyTokenSentToCommunicationAspect, prefire, preinitialize, removeInitializable, requestInitialization, resume, resumeActor, scheduleContainedActors, setContainer, setCurrentTime, setEmbedded, setModelTime, setTimeResolution, stop, stopFire, suspend, terminate, transferInputs, transferOutputs, 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 iterations
public Parameter userDefinedOutputInitialValue
public Parameter userDefinedDefaultOutputInitialValue
public Parameter defaultOutputInitialValue
public Parameter fireUnexecutedActors
protected java.util.List<SequenceAttribute> _sequencedList
protected SequenceScheduler _scheduler
protected boolean _postfireReturns
protected int _iterationCount
public SequencedModelDirector() throws IllegalActionException, NameDuplicationException
IllegalActionException
- If the name has a period in it, or
the director is not compatible with the specified container.NameDuplicationException
- If the container already contains
an entity with the specified name.public SequencedModelDirector(Workspace workspace) throws IllegalActionException, NameDuplicationException
workspace
- The workspace for this object.IllegalActionException
- If the name has a period in it, or
the director is not compatible with the specified container.NameDuplicationException
- If the container already contains
an entity with the specified name.public SequencedModelDirector(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 Director
workspace
- The workspace for the cloned object.java.lang.CloneNotSupportedException
- Not thrown in this base classNamedObj.exportMoML(Writer, int, String)
,
NamedObj.setDeferringChangeRequests(boolean)
public SequenceScheduler getScheduler()
setScheduler(SequenceScheduler)
public void invalidateSchedule()
invalidateSchedule
in class Director
public boolean isScheduleValid() throws IllegalActionException
IllegalActionException
- If there's no scheduler.public void initialize() throws IllegalActionException
initialize
in interface Initializable
initialize
in class Director
IllegalActionException
- If the initialize() method of
one of the associated actors throws it, or if there is no
scheduler.public void setOutputInitialValues(Entity actorEntity) throws IllegalActionException
actorEntity
- The entityIllegalActionException
- If thrown while getting the width of a port or
getting the value of a parameter.public Receiver newReceiver()
newReceiver
in class Director
public void preinitialize() throws IllegalActionException
preinitialize
in interface Initializable
preinitialize
in class Director
IllegalActionException
- If the preinitialize() method of
one of the associated actors throws it.public void getContainedEntities(CompositeActor compositeActor) throws IllegalActionException
compositeActor
- The composite actor to be searched for entities.IllegalActionException
- If thrown while checking the attribute type.public void checkAttributeType(Actor actor, java.util.List sequenceAttributes, java.util.List processAttributes) throws IllegalActionException
actor
- The actor to be checked.sequenceAttributes
- The list of sequence attributes to be checked.processAttributes
- The list of process attributes to be checkedIllegalActionException
- If sequenceAttributes has a length greater than one
or if actor is not an instance of ControlActor.public boolean postfire() throws IllegalActionException
postfire
in interface Executable
postfire
in class Director
IllegalActionException
- If the iterations parameter
does not contain a legal value.public java.lang.String[] suggestedModalModelDirectors()
suggestedModalModelDirectors
in class Director
Director.suggestedModalModelDirectors()
public boolean supportMultirateFiring()
supportMultirateFiring
in class Director
public void setScheduler(SequenceScheduler scheduler) throws IllegalActionException, NameDuplicationException
scheduler
- The scheduler that this director will use.IllegalActionException
- Not thrown in this base class,
but derived classes may throw it if the scheduler is not compatible.NameDuplicationException
- Not thrown in this base class,
but derived classes may throw it if the scheduler is not compatible.getScheduler()
protected void _setScheduler(SequenceScheduler scheduler)
scheduler
- The Scheduler responsible for execution.protected void fireSchedule(SequenceSchedule seqSchedule) throws IllegalActionException
seqSchedule
- The SequenceSchedule to fireIllegalActionException
- From actor.iterate()protected void _init() throws IllegalActionException, NameDuplicationException
IllegalActionException
- If there is a problem instantiating
the director's parameters.NameDuplicationException
- If there is a problem instantiating
the director's parameters.protected static java.lang.String _getInitialValueParameterName(TypedIOPort port, int channel)
port
- The port to be analyzed.channel
- The channel of the port to be analyzed.