public class PteraController extends ModalController
PteraDirector to execute the events in it.
Each Ptera modal model has one or more Ptera controllers. One of those
controllers is the top level controller, which can be obtained with ModalModel.getController(). The other controllers are refinements of
events.
| Red (tfeng) |
| Yellow (tfeng) |
FSMActor.PortScopeCompositeEntity.ContainedObjectsIterator| Modifier and Type | Field and Description |
|---|---|
PteraDirector |
director
The Ptera director contained by this controller.
|
Parameter |
LIFO
A Boolean parameter that decides whether simultaneous events should be
placed in the event queue in the last-in-first-out (LIFO) fashion or
not.
|
_mirrorDisable_currentState, _disabledRefinements, _initializables, _inputTokenMap, _lastChosenTransition, _lastChosenTransitions, _lastTakenTransitions, _stateRefinementsToPostfire, _stopRequested, errorCause, errorClass, errorMessage, finalStateNames, initialStateName, probability, resetOnEachRun, seed, stateDependentCausality, timeout_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 |
|---|
PteraController(CompositeEntity container,
java.lang.String name)
Construct an Ptera controller with a name and a container.
|
PteraController(Workspace workspace)
Construct an Ptera controller in the specified workspace with
no container and an empty string as a name.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.util.TreeMap<java.lang.Class<? extends Entity>,java.lang.String> |
_getRefinementClasses()
Return a map from the classes of the entities to be dropped into a state
and the class names of the refinements that can be used to contain those
entities.
|
protected void |
_setCurrentEvent(Event event)
Set the event currently being executed.
|
void |
attributeChanged(Attribute attribute)
React to a change in an attribute.
|
java.lang.Object |
clone(Workspace workspace)
Clone the controller into the specified workspace.
|
void |
fire()
Invoke the fire() method of the enclosed
PteraDirector. |
CausalityInterface |
getCausalityInterface()
Return a causality interface for this actor.
|
Director |
getDirector()
Return the director responsible for the execution of this actor.
|
Director |
getExecutiveDirector()
Return the executive director.
|
State |
getInitialState()
Return null as the initial state.
|
void |
initialize()
Initialize this controller by initializing the director that it
contains, which sets the initial events, and initializing all the
refinements.
|
boolean |
isFireFunctional()
Return the result of isFireFunctional() from the director.
|
boolean |
isStrict()
Return the result of isStrict() from the director.
|
int |
iterate(int count)
Invoke a specified number of iterations of the actor by calling
iterate() of the director.
|
ComponentRelation |
newRelation(java.lang.String name)
Create a new instance of
SchedulingRelation with the specified
name in this actor, and return it. |
boolean |
postfire()
Invoke postfire() of the director.
|
boolean |
prefire()
Invoke prefire() of the director.
|
void |
preinitialize()
Preinitialize the controller by invoking preinitialize() of the
director and that of the refinements.
|
void |
readInputs()
Set the value of the shadow variables for input ports of this actor.
|
void |
stop()
Stop execution by invoking stop() of the director.
|
void |
stopFire()
Request that execution of the current iteration stop as soon
as possible by invoking stopFire() of the director.
|
boolean |
synchronizeToRealtime()
Return whether the synchronizeToRealtime attribute of this controller is
set or not.
|
void |
terminate()
Invoke terminate() of the director.
|
java.util.Set<Inequality> |
typeConstraints()
Return the type constraints of this actor.
|
void |
wrapup()
Wrap up the controller by invoking wrapup() of the director and that of
the refinements.
|
_addPort, _checkContainer, addRefinement, dropObject, getRefinedState, newPort, setMirrorDisable_addEntity, _addRelation, _areAllImmediateTransitionsDisabled, _chooseTransitions, _destinationState, _getChannelForIdentifier, _getPortForIdentifier, _getStateRefinementsToPostfire, _getTransitionRefinementsToPostfire, _initializeRefinements, _isRefinementOutput, _isSafeToClear, _readInputs, _schedule, _setCurrentConnectionMap, _setTimeForRefinement, addChosenTransition, addInitializable, createReceivers, currentState, enabledTransitions, exportSubmodel, foundUnknown, getContext, getLastChosenTransition, getLastChosenTransitions, getLastTakenTransitions, getManager, getModifiedVariables, getPortScope, handleModelError, hasInput, hasInput, inputPortList, isBackwardTypeInferenceEnabled, isOpaque, newReceiver, outputPortList, readOutputsFromRefinement, removeInitializable, reset, setLastChosenTransition, setNewIteration, setSupportMultirate, wasTransitionTaken_adjustDeferrals, _containedDecorators, _deepOpaqueEntityList, _description, _exportMoMLContents, _finishedAddEntity, _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, setContainer, statistics, uniqueName_checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName_removePort, connectedPortList, connectedPorts, connectionsChanged, 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, attributeTypeChanged, 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, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspaceequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisBackwardTypeInferenceEnabledcreateReceivers, getManager, inputPortList, newReceiver, outputPortListaddInitializable, removeInitializabledescription, getContainer, getDisplayName, getFullName, getName, getName, setNamegetDerivedLevel, getDerivedList, propagateValuepublic Parameter LIFO
public PteraDirector director
public PteraController(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container - The container, which must be an PteraModalModel.name - The name.IllegalActionException - If the container is incompatible with
this actor.NameDuplicationException - If the name coincides with an actor
already in the container.public PteraController(Workspace workspace) throws IllegalActionException, NameDuplicationException
workspace - The workspace that will list the controller.IllegalActionException - If the container is incompatible with
this actor.NameDuplicationException - If the name coincides with an actor
already in the container.public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged in class FSMActorattribute - The attribute that changed.IllegalActionException - If thrown by the superclass
attributeChanged() method, or if the value of the LIFO parameter cannot
be read.public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
clone in class FSMActorworkspace - The workspace for the new controller.java.lang.CloneNotSupportedException - If a derived class contains
an attribute that cannot be cloned.NamedObj.exportMoML(Writer, int, String),
NamedObj.setDeferringChangeRequests(boolean)public void fire()
throws IllegalActionException
PteraDirector.fire in interface Executablefire in class FSMActorIllegalActionException - If the PteraDirector throws it.PteraDirector.fire()public CausalityInterface getCausalityInterface()
BreakCausalityInterface.
FIXME: A causality interface special for Ptera should be returned
instead.getCausalityInterface in interface ActorgetCausalityInterface in class FSMActorpublic Director getDirector()
getDirector in interface ActorgetDirector in class FSMActorpublic Director getExecutiveDirector()
getDirector()).
Otherwise, the executive director is the director of the Ptera
controller at a higher level in the refinement hierarchy.getExecutiveDirector in interface ActorgetExecutiveDirector in class FSMActorpublic State getInitialState()
getInitialState in class FSMActorpublic void initialize()
throws IllegalActionException
initialize in interface Initializableinitialize in class FSMActorIllegalActionException - If the director or initialize() of the
superclass throws it.public boolean isFireFunctional()
isFireFunctional in interface ExecutableisFireFunctional in class FSMActorpublic boolean isStrict()
throws IllegalActionException
isStrict in interface ExecutableisStrict in class FSMActorIllegalActionException - Thrown if causality interface
cannot be computed.public int iterate(int count)
throws IllegalActionException
iterate in interface Executableiterate in class FSMActorcount - The number of iterations to perform.IllegalActionException - If iterating is not
permitted, or if prefire(), fire(), or postfire() throw it.public ComponentRelation newRelation(java.lang.String name) throws IllegalActionException, NameDuplicationException
SchedulingRelation with the specified
name in this actor, and return it. This method is write-synchronized on
the workspace.newRelation in class FSMActorname - The name of the new scheduling relation.IllegalActionException - If the name argument is null.NameDuplicationException - If name collides with that
of a scheduling relation already in this actor.public boolean postfire()
throws IllegalActionException
postfire in interface Executablepostfire in class FSMActorIllegalActionException - If postfire() of the director throws
it.public boolean prefire()
throws IllegalActionException
prefire in interface Executableprefire in class FSMActorIllegalActionException - If prefire() of the director throws
it.public void preinitialize()
throws IllegalActionException
preinitialize in interface Initializablepreinitialize in class FSMActorIllegalActionException - If preinitialize() of the director or
refinements throws it.public void readInputs()
throws IllegalActionException
readInputs in class FSMActorIllegalActionException - If a shadow variable cannot take
the token read from its corresponding channel (should not occur).public void stop()
stop in interface Executablestop in class FSMActorpublic void stopFire()
stopFire in interface ExecutablestopFire in class FSMActorpublic boolean synchronizeToRealtime()
public void terminate()
terminate in interface Executableterminate in class FSMActorpublic java.util.Set<Inequality> typeConstraints()
typeConstraints in interface TypedActortypeConstraints in class FSMActorInequalitypublic void wrapup()
throws IllegalActionException
wrapup in interface Initializablewrapup in class FSMActorIllegalActionException - If wrapup() of the director or
refinements throws it.protected java.util.TreeMap<java.lang.Class<? extends Entity>,java.lang.String> _getRefinementClasses()
_getRefinementClasses in class ModalControllerprotected void _setCurrentEvent(Event event)
event - The current event.