public class NonStrictFSMDirector extends FSMDirector
1. The port is referred by any guard expression of the preemptive transitions leaving the current state, the output actions and/or set actions of the enabled transition.
2. No preemptive transition is enabled and the port is referred by the refinements of the current state, any guard expression of the nonpreemptive transitions leaving the current state, the output actions and/or set actions of the enabled transition.
A port is said to be referred by a guard/output action/set action expression of a transition if the port name appears in that expression. A port is said to be referred by a state refinement if the it is not a dangling port and has a consumption rate greater than zero in the refinement.
FIXME: This is highly preliminary. Missing capabilities: FIXME: Currently this director uses the default receiver of FSMDirector, which is a mailbox, so there is no way to consume more than one token. This director could use a different receiver and support a syntax in the guard expression language to support consumption of more than one token. FIXME: This director does not support immediate transitions.
Red (cxh) |
Red (zhouye) |
NamedObj.ContainedObjectsIterator
_currentLocalReceiverMap, _indexOffset, _localReceiverMaps, controllerName
_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 |
---|
NonStrictFSMDirector(CompositeEntity container,
java.lang.String name)
Construct a director in the given container with the given name.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone(Workspace workspace)
Clone the actor into the specified workspace.
|
void |
fire()
Fire the modal model.
|
void |
getNonpreemptiveTransitionsReferredInputPorts(State state)
Given a state, get a set of input ports referred in the guards of
the preemptive transitions leaving that state.
|
void |
getOutputActionsReferredInputPorts(Transition transition)
Given a transition, get a set of input ports referred in the
outputActions of that transition.
|
void |
getPreemptiveTransitionsReferredInputPorts(State state)
Given a state, get a set of input ports referred in the guards of
the preemptive transitions leaving that state.
|
void |
getReferredInputPorts(java.util.Set portSet,
java.util.Set referredInputPorts)
Given a set of ports, get those that are input ports of the container
and put them in the indicated referred set.
|
void |
getRefinementReferredInputPorts(State state)
Given a state, get a set of input ports referred by the refinements
of that state.
|
void |
getSetActionsReferredInputPorts(Transition transition)
Given a transition, get a set of input ports referred in the set
actions of that transition.
|
java.util.Set |
getTransitionReferredInputPorts(java.util.List transitionList)
Given a list of transitions, get a set of referred input ports
in the guard expressions of all the transitions leaving this state.
|
void |
initialize()
Initialize the director.
|
boolean |
postfire()
Call the postfire() method of the super class.
|
boolean |
transferInputs(IOPort port)
Override the super class by only transferring inputs for those
input ports that are referred by the guard expressions of the
preemptive transitions leaving the current state.
|
_buildLocalReceiverMaps, _currentLocalReceivers, _getLastChosenTransition, _getStateRefinementsToPostfire, _getTransitionRefinementsToPostfire, _readInputs, _readOutputsFromRefinement, _setCurrentConnectionMap, _setCurrentState, _transferOutputs, attributeChanged, defaultDependency, fireAt, getContext, getController, getIndex, getModelNextIterationTime, getModifiedVariables, getParseTreeEvaluator, handleModelError, implementsStrictActorSemantics, invalidateSchedule, isStrict, newReceiver, prefire, preinitialize, resetOutputReceivers, setContainer, setIndex
_actorFinished, _consultTimeRegulators, _description, _isEmbedded, _isTopLevel, _schedule, _transferInputs, addInitializable, createSchedule, delayDependency, finish, fireAt, fireAt, fireAtCurrentTime, fireContainerAt, fireContainerAt, getCausalityInterface, getCurrentTime, getDeadline, getEnvironmentTime, getErrorTolerance, getExecutionAspect, getGlobalTime, getModelStartTime, getModelStopTime, getModelTime, getNextIterationTime, getStartTime, getStopTime, getTimeResolution, initialize, invalidateResolvedTypes, isEmbedded, isFireFunctional, isStopRequested, iterate, mutexLockObject, notifyTokenSentToCommunicationAspect, preinitialize, removeInitializable, requestInitialization, resume, resumeActor, scheduleContainedActors, setCurrentTime, setEmbedded, setModelTime, setTimeResolution, stop, stopFire, suggestedModalModelDirectors, supportMultirateFiring, suspend, terminate, 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, 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
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
description, getContainer, getDisplayName, getFullName, getName, getName, setName
public NonStrictFSMDirector(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- Container of this director.name
- Name of this director.IllegalActionException
- If the name has a period in it, or
the director is not compatible with the specified container.NameDuplicationException
- If the container 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 FSMDirector
workspace
- The workspace for the new actor.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
If no preemptive transition is enabled, get additional input ports referred by the refinements of the current state and transfer at most one token from these input ports. Fire the refinements. After this, get additional input ports referred by the nonpreemptive transitions from the current state and transfer at most one token from these input ports. Then examine the nonpreemptive transitions. If there is more than one transition enabled, an exception is thrown. If there is exactly one nonpreemptive transition enabled, then it is chosen. Get additional input ports referred by the output actions and set actions of the enabled transition and executed the output actions.
fire
in interface Executable
fire
in class FSMDirector
IllegalActionException
- If the super class throws it.public void getNonpreemptiveTransitionsReferredInputPorts(State state) throws IllegalActionException
state
- The given state.IllegalActionException
- If there is no controller or
if any guard expression is illegal.public void getOutputActionsReferredInputPorts(Transition transition) throws IllegalActionException
transition
- The transition.IllegalActionException
- If there is no controller or if
the outputActions is illegal.public void getPreemptiveTransitionsReferredInputPorts(State state) throws IllegalActionException
state
- The given state.IllegalActionException
- If there is no controller or
if any guard expression is illegal.public void getReferredInputPorts(java.util.Set portSet, java.util.Set referredInputPorts)
portSet
- The given set of portsreferredInputPorts
- The referred set.public void getRefinementReferredInputPorts(State state) throws IllegalActionException
state
- The given state.IllegalActionException
- If refinement with given name is not
found, or if the port rate does not contain a valid expression.public void getSetActionsReferredInputPorts(Transition transition) throws IllegalActionException
transition
- The given transition.IllegalActionException
- If there is no controller or
if any set action expression is illegal.public java.util.Set getTransitionReferredInputPorts(java.util.List transitionList) throws IllegalActionException
transitionList
- The list of Transitions.IllegalActionException
- If there is no controller or if
the guard expression is illegal.public void initialize() throws IllegalActionException
initialize
in interface Initializable
initialize
in class FSMDirector
IllegalActionException
- If the super class throws it.public boolean postfire() throws IllegalActionException
postfire
in interface Executable
postfire
in class FSMDirector
IllegalActionException
- If the super class throws it.public boolean transferInputs(IOPort port) throws IllegalActionException
transferInputs
in class FSMDirector
port
- The input port to transfer tokens from.IllegalActionException
- If the port is not an opaque input port.