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.
FSMActor.PortScope
CompositeEntity.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, LINKS
COMPLETED, 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, _init, _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, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isBackwardTypeInferenceEnabled
createReceivers, getManager, inputPortList, newReceiver, outputPortList
addInitializable, removeInitializable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
getDerivedLevel, getDerivedList, propagateValue
public 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 FSMActor
attribute
- 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 FSMActor
workspace
- 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 Executable
fire
in class FSMActor
IllegalActionException
- 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 Actor
getCausalityInterface
in class FSMActor
public Director getDirector()
getDirector
in interface Actor
getDirector
in class FSMActor
public 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 Actor
getExecutiveDirector
in class FSMActor
public State getInitialState()
getInitialState
in class FSMActor
public void initialize() throws IllegalActionException
initialize
in interface Initializable
initialize
in class FSMActor
IllegalActionException
- If the director or initialize() of the
superclass throws it.public boolean isFireFunctional()
isFireFunctional
in interface Executable
isFireFunctional
in class FSMActor
public boolean isStrict() throws IllegalActionException
isStrict
in interface Executable
isStrict
in class FSMActor
IllegalActionException
- Thrown if causality interface
cannot be computed.public int iterate(int count) throws IllegalActionException
iterate
in interface Executable
iterate
in class FSMActor
count
- 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 FSMActor
name
- 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 Executable
postfire
in class FSMActor
IllegalActionException
- If postfire() of the director throws
it.public boolean prefire() throws IllegalActionException
prefire
in interface Executable
prefire
in class FSMActor
IllegalActionException
- If prefire() of the director throws
it.public void preinitialize() throws IllegalActionException
preinitialize
in interface Initializable
preinitialize
in class FSMActor
IllegalActionException
- If preinitialize() of the director or
refinements throws it.public void readInputs() throws IllegalActionException
readInputs
in class FSMActor
IllegalActionException
- If a shadow variable cannot take
the token read from its corresponding channel (should not occur).public void stop()
stop
in interface Executable
stop
in class FSMActor
public void stopFire()
stopFire
in interface Executable
stopFire
in class FSMActor
public boolean synchronizeToRealtime()
public void terminate()
terminate
in interface Executable
terminate
in class FSMActor
public java.util.Set<Inequality> typeConstraints()
typeConstraints
in interface TypedActor
typeConstraints
in class FSMActor
Inequality
public void wrapup() throws IllegalActionException
wrapup
in interface Initializable
wrapup
in class FSMActor
IllegalActionException
- 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 ModalController
protected void _setCurrentEvent(Event event)
event
- The current event.