public class CompositeExecutionAspect extends TypedCompositeActor implements ActorExecutionAspect
| Red (derler) |
| Red (derler) |
| Modifier and Type | Class and Description |
|---|---|
static class |
CompositeExecutionAspect.CompositeExecutionAspectAttributes
Attributes for actors decorated by this CompositeExecutionAspects.
|
CompositeEntity.ContainedObjectsIterator| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<NamedObj> |
_actors
Actors decorated by this aspect.
|
protected java.util.List<NamedObj> |
_currentlyExecuting
List of currently executing actors.
|
protected java.util.List<ExecutionAspectListener> |
_executionAspectListeners
Listeners that want to be informed about execution events.
|
protected boolean |
_lastActorFinished
True if in the last request to schedule an actor, this actor
finished execution.
|
Parameter |
justMonitor
This parameter indicates whether the tokens received via the
ImmediateReceivers are immediately forwarded to the wrapped
receivers or whether they are delayed by this communication aspect
and only forwarded through a CommunicationResponsePort.
|
_actorFiringListeners, _causalityInterface, _derivedPiggybacks, _initializables, _notifyingActorFiring, _piggybacks, _publishedPorts, _publisherRelations, _stopRequested, _subscribedPorts_levelCrossingLinks_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKSCOMPLETED, NOT_READY, STOP_ITERATING| Constructor and Description |
|---|
CompositeExecutionAspect(CompositeEntity container,
java.lang.String name)
Create a new actor in the specified container with the specified
name.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addExecutingListener(ExecutionAspectListener listener)
Add schedule listener.
|
void |
attributeChanged(Attribute attribute)
React to the change of the justMonitor attribute by
updating internal variables.
|
java.lang.Object |
clone(Workspace workspace)
Clone the actor into the specified workspace.
|
DecoratorAttributes |
createDecoratorAttributes(NamedObj target)
Return the decorated attributes for the target NamedObj.
|
java.util.List<NamedObj> |
decoratedObjects()
Return a list of the entities deeply contained by the container
of this ExecutionAspect.
|
double |
getExecutionTime(NamedObj actor)
Get the execution time of an actor.
|
void |
initialize()
Initialize local variables.
|
void |
initializeDecoratedActors()
Iterate through all entities deeply contained by the container,
record for each that it is not executing.
|
boolean |
isGlobalDecorator()
Return true to indicate that this decorator should
decorate objects across opaque hierarchy boundaries.
|
boolean |
isWaitingForResource(Actor actor)
Check whether the execution of an actor is handled by
this aspect actor.
|
boolean |
lastScheduledActorFinished()
If the last actor that was scheduled finished execution
then this method returns true.
|
void |
notifyExecutionListeners(NamedObj entity,
java.lang.Double time,
ExecutionAspectListener.ExecutionEventType eventType)
Notify execution listeners about rescheduling events.
|
boolean |
postfire()
Iterate through resource mapping output ports and if they contain
tokens, inform the director of the actors in the tokens that these
actors can resume execution.
|
void |
removeExecutionListener(ExecutionAspectListener listener)
Remove schedule listener.
|
Time |
schedule(NamedObj actor,
Time currentPlatformTime,
Time deadline,
Time executionTime)
Schedule a new actor for execution.
|
Time |
schedule(Time environmentTime)
Perform rescheduling actions when no new actor requests to be
scheduled.
|
void |
setContainer(CompositeEntity container)
Override the base class to first set the container, then establish
a connection with any decorated objects it finds in scope in the new
container.
|
void |
setRequestPort(NamedObj actor,
java.lang.String portName)
Set the name of the port that will receive scheduling requests
for the actor.
|
_addEntity, _addPort, _addRelation, _checkTypesFromTo, _destinationTypeConstraints, attributeTypeChanged, isBackwardTypeInferenceEnabled, newPort, newRelation, resolveTypes, typeConstraintList, typeConstraints_actorFiring, _actorFiring, _finishedAddEntity, _setDirector, _transferPortParameterInputs, addActorFiringListener, addInitializable, addPiggyback, connectionsChanged, createReceivers, createSchedule, fire, getCausalityInterface, getDirector, getExecutiveDirector, getManager, getPublishedPort, getPublishedPortChannel, getPublishedPorts, getSubscribedPortChannel, inferringWidths, inferWidths, inputPortList, isFireFunctional, isOpaque, isPublishedPort, isStrict, iterate, linkToPublishedPort, linkToPublishedPort, linkToPublishedPort, linkToPublishedPort, needsWidthInference, newInsideReceiver, newReceiver, notifyConnectivityChange, outputPortList, prefire, preinitialize, recordFiring, registerPublisherPort, registerPublisherPort, removeActorFiringListener, removeInitializable, removePiggyback, requestChange, setDirector, setManager, stop, stopFire, terminate, unlinkToPublishedPort, unlinkToPublishedPort, unlinkToPublishedPort, unlinkToPublishedPort, unregisterPublisherPort, unregisterPublisherPort, wrapup_adjustDeferrals, _containedDecorators, _deepOpaqueEntityList, _description, _exportMoMLContents, _removeEntity, _removeRelation, _validateSettables, allAtomicEntityList, allowLevelCrossingConnect, classDefinitionList, connect, connect, containedObjectsIterator, deepCompositeEntityList, deepEntityList, deepGetEntities, deepNamedObjList, deepOpaqueEntityList, deepRelationSet, entityList, entityList, exportLinks, exportMoML, getAttribute, getEntities, getEntity, getPort, getRelation, getRelations, isAtomic, lazyAllAtomicEntityList, lazyAllCompositeEntityList, lazyAllCompositeTransparentAndOpaqueEntityList, lazyClassDefinitionList, lazyDeepEntityList, lazyEntityList, lazyRelationList, numberOfEntities, numberOfRelations, numEntities, numRelations, relationList, removeAllEntities, removeAllRelations, setClassDefinition, statistics, uniqueName_checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName_removePort, connectedPortList, connectedPorts, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts_setParent, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, clone, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspaceequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdescription, getContainer, getDisplayName, getFullName, getName, getName, setNamecreateReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortListfire, isFireFunctional, isStrict, iterate, prefire, stop, stopFire, terminateaddInitializable, preinitialize, removeInitializable, wrapupgetDerivedLevel, getDerivedList, propagateValuepublic Parameter justMonitor
protected java.util.List<NamedObj> _actors
protected boolean _lastActorFinished
protected java.util.List<ExecutionAspectListener> _executionAspectListeners
protected java.util.List<NamedObj> _currentlyExecuting
public CompositeExecutionAspect(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container - The container.name - The name of this actor within the container.IllegalActionException - If this actor cannot be contained
by the proposed container (see the setContainer() method).NameDuplicationException - If the name coincides with
an entity already in the container.public void addExecutingListener(ExecutionAspectListener listener) throws IllegalActionException
addExecutingListener in interface ActorExecutionAspectlistener - The listener to be added.IllegalActionException - If an error occurs in the initialization
of actors scheduled by this ExecutionAspect.public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged in class TypedCompositeActorattribute - The attribute that changed.IllegalActionException - If token in attribute cannot
be accessed.public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
clone in class CompositeActorworkspace - The workspace for the new object.java.lang.CloneNotSupportedException - If a derived class contains
an attribute that cannot be cloned.NamedObj.exportMoML(Writer, int, String),
NamedObj.setDeferringChangeRequests(boolean)public DecoratorAttributes createDecoratorAttributes(NamedObj target)
createDecoratorAttributes in interface Decoratortarget - The NamedObj that will be decorated.public java.util.List<NamedObj> decoratedObjects()
decoratedObjects in interface Decoratorpublic double getExecutionTime(NamedObj actor) throws IllegalActionException
getExecutionTime in interface ActorExecutionAspectactor - The actor.IllegalActionException - Thrown in attribute or token cannot be read.public void initialize()
throws IllegalActionException
initialize in interface Initializableinitialize in class CompositeActorIllegalActionException - Thrown if list of actors
decorated by this aspect cannot be retrieved.public void initializeDecoratedActors()
throws IllegalActionException
initializeDecoratedActors in interface ActorExecutionAspectIllegalActionException - If the decorator parameters cannot be read.public boolean isGlobalDecorator()
isGlobalDecorator in interface Decoratorpublic boolean isWaitingForResource(Actor actor)
isWaitingForResource in interface ActorExecutionAspectactor - The actor.public boolean lastScheduledActorFinished()
lastScheduledActorFinished in interface ActorExecutionAspectpublic void notifyExecutionListeners(NamedObj entity, java.lang.Double time, ExecutionAspectListener.ExecutionEventType eventType)
notifyExecutionListeners in interface ActorExecutionAspectentity - Entity that is being scheduled.time - Time when entity is being scheduled.eventType - Type of event.public boolean postfire()
throws IllegalActionException
postfire in interface Executablepostfire in class CompositeActorIllegalActionException - Not explicitly thrown here.public Time schedule(Time environmentTime) throws IllegalActionException
schedule in interface ActorExecutionAspectenvironmentTime - The outside time.IllegalActionException - Thrown in subclasses.public Time schedule(NamedObj actor, Time currentPlatformTime, Time deadline, Time executionTime) throws IllegalActionException
schedule in interface ActorExecutionAspectactor - The actor to be scheduled.currentPlatformTime - The current platform time.deadline - The deadline of the event.executionTime - The execution time of the actor.IllegalActionException - Thrown if actor parameters such
as execution time or priority cannot be read.public void setContainer(CompositeEntity container) throws IllegalActionException, NameDuplicationException
setContainer in class CompositeActorcontainer - The container to attach this attribute to..IllegalActionException - If this attribute is not of the
expected class for the container, or it has no name,
or the attribute and container are not in the same workspace, or
the proposed container would result in recursive containment.NameDuplicationException - If the container already has
an attribute with the name of this attribute.ComponentEntity.getContainer()public void setRequestPort(NamedObj actor, java.lang.String portName)
actor - The actor.portName - The request port.public void removeExecutionListener(ExecutionAspectListener listener)
removeExecutionListener in interface ActorExecutionAspectlistener - The listener to be removed.