public class InterfaceAutomaton extends FSMActor
When an InterfaceAutomaton is fired, the outgoing transitions of the current state are examined. An IllegalActionException is thrown if there is more than one enabled transition. If there is exactly one enabled transition then it is taken.
An InterfaceAutomaton enters its initial state during initialization. The name of the initial state is specified by the initialStateName string attribute.
State
,
InterfaceAutomatonTransition
FSMActor.PortScope
CompositeEntity.ContainedObjectsIterator
_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 |
---|
InterfaceAutomaton()
Construct an InterfaceAutomaton in the default workspace with an
empty string as its name.
|
InterfaceAutomaton(CompositeEntity container,
java.lang.String name)
Create an InterfaceAutomaton in the specified container with the
specified name.
|
InterfaceAutomaton(Workspace workspace)
Construct an InterfaceAutomaton in the specified workspace with an
empty string as its name.
|
Modifier and Type | Method and Description |
---|---|
protected void |
_addRelation(ComponentRelation relation)
Add an InterfaceAutomatonTransition to this InterfaceAutomaton.
|
void |
addPorts()
Add instances of TypedIOPort that correspond to input and output
transitions, if these port do not exist.
|
void |
combineInternalTransitions()
Combine each chain of internal transitions into one transition.
|
InterfaceAutomaton |
compose(InterfaceAutomaton automaton)
Return a new InterfaceAutomaton that is the composition of the
specified InterfaceAutomaton and this one.
|
InterfaceAutomaton |
compose(InterfaceAutomaton automaton,
boolean considerTransient)
Return a new InterfaceAutomaton that is the composition of the
specified InterfaceAutomaton and this one.
|
java.util.Set |
computeAlternatingSimulation(InterfaceAutomaton subAutomaton)
Return the unique maximal alternating simulation from the specified
automaton to this automaton.
|
java.util.Set |
deadlockStates()
Return the deadlock states in a Set.
|
java.util.Set |
epsilonClosure(State state)
Return the epsilon-closure of the specified state.
|
java.util.Set |
externallyEnabledDestinations(State sourceState,
java.lang.String transitionLabel)
Return the set of externally enabled destination states.
|
java.util.Set |
externallyEnabledInputTransitionLabels(State state)
Return the labels for the set of externally enabled input transitions
for the specified state.
|
java.util.Set |
externallyEnabledOutputTransitionLabels(State state)
Return the labels for the set of externally enabled output transitions
for the specified state.
|
void |
fire()
Choose the enabled transition among the outgoing transitions of
the current state.
|
java.lang.String |
getInfo()
Return a high-level description of this automaton.
|
java.util.Set |
inputNameSet()
Return the names of the input ports as a Set.
|
java.util.Set |
internalTransitionNameSet()
Return the names of the internal transitions as a Set.
|
boolean |
isClosed()
Return true if this automaton does not have any input and output;
false otherwise.
|
boolean |
isEmpty()
Return true if this automaton is empty; false otherwise.
|
ComponentRelation |
newRelation(java.lang.String name)
Create a new instance of InterfaceAutomatonTransition with the
specified name in this actor, and return it.
|
java.util.Set |
outputNameSet()
Return the names of the output ports as a Set.
|
void |
project(InterfaceAutomaton automaton)
Project this automaton into the specified one.
|
static java.util.Set |
reacheableAlternatingSimulation(java.util.Set alternatingSimulation,
InterfaceAutomaton superAutomaton,
InterfaceAutomaton subAutomaton)
Return the reacheable state pairs in the specified alternating
simulation.
|
void |
renameTransitionLabels(java.util.Map nameMap)
Rename the labels on some transitions.
|
_addEntity, _areAllImmediateTransitionsDisabled, _chooseTransitions, _destinationState, _getChannelForIdentifier, _getPortForIdentifier, _getStateRefinementsToPostfire, _getTransitionRefinementsToPostfire, _init, _initializeRefinements, _isRefinementOutput, _isSafeToClear, _readInputs, _schedule, _setCurrentConnectionMap, _setTimeForRefinement, addChosenTransition, addInitializable, attributeChanged, clone, createReceivers, currentState, enabledTransitions, exportSubmodel, foundUnknown, getCausalityInterface, getContext, getDirector, getExecutiveDirector, getInitialState, getLastChosenTransition, getLastChosenTransitions, getLastTakenTransitions, getManager, getModifiedVariables, getPortScope, handleModelError, hasInput, hasInput, initialize, inputPortList, isBackwardTypeInferenceEnabled, isFireFunctional, isOpaque, isStrict, iterate, newPort, newReceiver, outputPortList, postfire, prefire, preinitialize, readInputs, readOutputsFromRefinement, removeInitializable, reset, setLastChosenTransition, setNewIteration, setSupportMultirate, stop, stopFire, terminate, typeConstraints, wasTransitionTaken, wrapup
_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
_addPort, _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
description, getContainer, getDisplayName, getFullName, getName, getName, setName
getDerivedLevel, getDerivedList, propagateValue
public InterfaceAutomaton()
public InterfaceAutomaton(Workspace workspace)
workspace
- The workspace that will list the actor.public InterfaceAutomaton(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container.name
- The name of this automaton within the container.IllegalActionException
- If the entity cannot be contained
by the proposed container.NameDuplicationException
- If the name coincides with
an entity already in the container.public void addPorts()
public void combineInternalTransitions()
public InterfaceAutomaton compose(InterfaceAutomaton automaton) throws IllegalActionException
automaton
- An InterfaceAutomaton to compose with this one.IllegalActionException
- If this automaton is not composable
with the argument.public InterfaceAutomaton compose(InterfaceAutomaton automaton, boolean considerTransient) throws IllegalActionException
automaton
- An InterfaceAutomaton to compose with this one.considerTransient
- True to indicate that transient states
should be treated differently; false to indicate that transient
states are treated as regular ones.IllegalActionException
- If this automaton is not composable
with the argument.public java.util.Set computeAlternatingSimulation(InterfaceAutomaton subAutomaton) throws IllegalActionException
This method returns a set of instances of StatePair. The first state in each pair is in the super automaton, and the second state is in the sub automaton.
subAutomaton
- An interface automaton.IllegalActionException
- If this automaton or the specified
one is not consistent. For example, missing ports.StatePair
public java.util.Set deadlockStates() throws IllegalActionException
IllegalActionException
- If this automaton is not closed.public java.util.Set epsilonClosure(State state)
state
- The state from which the epsilon-closure is computed.public java.util.Set externallyEnabledDestinations(State sourceState, java.lang.String transitionLabel)
sourceState
- The source state from which the externally
enabled destinations are computed.transitionLabel
- The label for an externally enabled transition.public java.util.Set externallyEnabledInputTransitionLabels(State state)
state
- The state for which the externally enabled input
transitions are computed.public java.util.Set externallyEnabledOutputTransitionLabels(State state)
state
- The state for which the externally enabled output
transitions are computed.public void fire() throws IllegalActionException
fire
in interface Executable
fire
in class FSMActor
IllegalActionException
- If there is more than one
transition enabled.public java.lang.String getInfo()
(full name of automaton): (number of states) states (number of transitions) transitions (number of input names) input names (number of output names) output names (number of internal transition names) internal transition names Input Names: (list of input names) Output Names: (list of output names) Internal Transition Names: (list of internal transition names)
public java.util.Set inputNameSet()
public java.util.Set internalTransitionNameSet()
public boolean isClosed()
public boolean isEmpty()
public ComponentRelation newRelation(java.lang.String name) throws IllegalActionException, NameDuplicationException
newRelation
in class FSMActor
name
- The name of the new transition.IllegalActionException
- If the name argument is null.NameDuplicationException
- If name collides with that
of a transition already in this actor.public java.util.Set outputNameSet()
public void project(InterfaceAutomaton automaton) throws IllegalActionException
automaton
- The interface automaton to which this automaton will
be projected.IllegalActionException
- If this or the specified automaton
is not consistent. For example, missing ports.public static java.util.Set reacheableAlternatingSimulation(java.util.Set alternatingSimulation, InterfaceAutomaton superAutomaton, InterfaceAutomaton subAutomaton) throws IllegalActionException
alternatingSimulation
- A set of instances of StatePair.superAutomaton
- The automaton that contains the first state
in the state pairs in alternatingSimulation.subAutomaton
- The automaton that contains the second state
in the state pairs in alternatingSimulation.IllegalActionException
- If thrown by getInitialState().public void renameTransitionLabels(java.util.Map nameMap) throws IllegalActionException, NameDuplicationException
For input and output transitions, this method also renames the ports associated with the renamed transitions, if these ports are created already. This is done regardless of whether there are instances of transitions that correspond to the ports. For internal transitions, this method renames the parameter associated with the renamed transition.
nameMap
- A map between the old and the new label names.IllegalActionException
- If the new name is not legal.NameDuplicationException
- If the requested name change will
cause name collision.protected void _addRelation(ComponentRelation relation) throws IllegalActionException, NameDuplicationException
_addRelation
in class FSMActor
relation
- The InterfaceAutomatonTransition to contain.IllegalActionException
- If the transition has no name, or
is not an instance of Transition.NameDuplicationException
- If the name collides with a name
already on the contained transitions list.