Package ptolemy.actor.gt
Class FSMMatcher
- java.lang.Object
-
- All Implemented Interfaces:
java.lang.Cloneable
,Actor
,Executable
,GTCompositeActor
,GTEntity
,Initializable
,TypedActor
,ExplicitChangeContext
,Changeable
,Debuggable
,DebugListener
,Derivable
,Instantiable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
,ValueListener
public class FSMMatcher extends FSMActor implements GTCompositeActor, GTEntity, ValueListener
A matcher to match any FSM actor.- Since:
- Ptolemy II 7.1
- Version:
- $Id$
- Author:
- Thomas Huining Feng
- Pt.AcceptedRating:
- Red (tfeng)
- Pt.ProposedRating:
- Yellow (tfeng)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.domains.modal.kernel.FSMActor
FSMActor.PortScope
-
Nested classes/interfaces inherited from class ptolemy.kernel.CompositeEntity
CompositeEntity.ContainedObjectsIterator
-
-
Field Summary
Fields Modifier and Type Field Description GTIngredientsAttribute
criteria
The attribute containing all the criteria in a list (GTIngredientList
).GTIngredientsEditor.Factory
editorFactory
The editor factory for ingredients in this matcher.GTIngredientsAttribute
operations
The attribute containing all the operations in a list (GTIngredientList
).PatternObjectAttribute
patternObject
The attribute that specifies the name of the corresponding entity in the pattern.-
Fields inherited from class ptolemy.domains.modal.kernel.FSMActor
_currentState, _disabledRefinements, _initializables, _inputTokenMap, _lastChosenTransition, _lastChosenTransitions, _lastTakenTransitions, _stateRefinementsToPostfire, _stopRequested, errorCause, errorClass, errorMessage, finalStateNames, initialStateName, probability, resetOnEachRun, seed, stateDependentCausality, timeout
-
Fields inherited from class ptolemy.kernel.CompositeEntity
_levelCrossingLinks
-
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
-
Fields inherited from interface ptolemy.actor.Executable
COMPLETED, NOT_READY, STOP_ITERATING
-
-
Constructor Summary
Constructors Constructor Description FSMMatcher(CompositeEntity container, java.lang.String name)
Create an FSMMatcher in the specified container with the specified name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GTIngredientsAttribute
getCriteriaAttribute()
Return the attribute that stores all the criteria for this matcher.java.lang.String
getDefaultIconDescription()
Return a string that contains the SVG icon description ("<svg>...</svg>") for this matcher.GTIngredientsAttribute
getOperationsAttribute()
Return the attribute that stores all the operations for this matcher.PatternObjectAttribute
getPatternObjectAttribute()
Return the attribute that stores the name of the corresponding entity in the pattern of the sameTransformationRule
, if this entity is in the replacement, or null otherwise.java.util.Set<java.lang.String>
labelSet()
Return the set of names of ingredients contained in this entity that can be resolved.boolean
match(NamedObj object)
Test whether this FSMMatcher can match the given object.ComponentRelation
newRelation(java.lang.String name)
Create a new instance of Transition with the specified name in this actor, and return it.void
updateAppearance(GTIngredientsAttribute attribute)
Update appearance of this entity.void
valueChanged(Settable settable)
React to the fact that the specified Settable has changed.-
Methods inherited from class ptolemy.domains.modal.kernel.FSMActor
_addEntity, _addRelation, _areAllImmediateTransitionsDisabled, _chooseTransitions, _destinationState, _getChannelForIdentifier, _getPortForIdentifier, _getStateRefinementsToPostfire, _getTransitionRefinementsToPostfire, _init, _initializeRefinements, _isRefinementOutput, _isSafeToClear, _readInputs, _schedule, _setCurrentConnectionMap, _setTimeForRefinement, addChosenTransition, addInitializable, attributeChanged, clone, createReceivers, currentState, enabledTransitions, exportSubmodel, fire, 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
-
Methods inherited from class ptolemy.kernel.CompositeEntity
_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
-
Methods inherited from class ptolemy.kernel.ComponentEntity
_checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName
-
Methods inherited from class ptolemy.kernel.Entity
_addPort, _removePort, connectedPortList, connectedPorts, connectionsChanged, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts
-
Methods inherited from class ptolemy.kernel.InstantiableNamedObj
_setParent, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
-
Methods inherited from class ptolemy.kernel.util.NamedObj
_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
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ptolemy.actor.Actor
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
-
Methods inherited from interface ptolemy.kernel.util.Derivable
getDerivedLevel, getDerivedList, propagateValue
-
Methods inherited from interface ptolemy.actor.Executable
fire, isFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminate
-
Methods inherited from interface ptolemy.actor.Initializable
addInitializable, initialize, preinitialize, removeInitializable, wrapup
-
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
-
Methods inherited from interface ptolemy.actor.TypedActor
isBackwardTypeInferenceEnabled, typeConstraints
-
-
-
-
Field Detail
-
criteria
public GTIngredientsAttribute criteria
The attribute containing all the criteria in a list (GTIngredientList
).
-
editorFactory
public GTIngredientsEditor.Factory editorFactory
The editor factory for ingredients in this matcher.
-
operations
public GTIngredientsAttribute operations
The attribute containing all the operations in a list (GTIngredientList
).
-
patternObject
public PatternObjectAttribute patternObject
The attribute that specifies the name of the corresponding entity in the pattern.
-
-
Constructor Detail
-
FSMMatcher
public FSMMatcher(CompositeEntity container, java.lang.String name) throws NameDuplicationException, IllegalActionException
Create an FSMMatcher in the specified container with the specified name. The name must be unique within the container or an exception is thrown. The container argument must not be null, or a NullPointerException will be thrown.- Parameters:
container
- The container.name
- The name of this actor within the container.- Throws:
IllegalActionException
- If the entity cannot be contained by the proposed container.NameDuplicationException
- If the name coincides with an entity already in the container.
-
-
Method Detail
-
getCriteriaAttribute
public GTIngredientsAttribute getCriteriaAttribute()
Return the attribute that stores all the criteria for this matcher.- Specified by:
getCriteriaAttribute
in interfaceGTEntity
- Returns:
- The attribute that stores all the criteria.
-
getDefaultIconDescription
public java.lang.String getDefaultIconDescription()
Return a string that contains the SVG icon description ("<svg>...</svg>") for this matcher. This icon description is the default icon for the matcher, which may be changed by the criteria.- Specified by:
getDefaultIconDescription
in interfaceGTEntity
- Returns:
- The icon description.
-
getOperationsAttribute
public GTIngredientsAttribute getOperationsAttribute()
Return the attribute that stores all the operations for this matcher.- Specified by:
getOperationsAttribute
in interfaceGTEntity
- Returns:
- The attribute that stores all the operations.
-
getPatternObjectAttribute
public PatternObjectAttribute getPatternObjectAttribute()
Return the attribute that stores the name of the corresponding entity in the pattern of the sameTransformationRule
, if this entity is in the replacement, or null otherwise.- Specified by:
getPatternObjectAttribute
in interfaceGTEntity
- Returns:
- The attribute that stores the name of the corresponding entity.
- See Also:
labelSet()
-
labelSet
public java.util.Set<java.lang.String> labelSet()
Return the set of names of ingredients contained in this entity that can be resolved.
-
match
public boolean match(NamedObj object)
Test whether this FSMMatcher can match the given object. The matching is shallow in the sense that objects contained by this GTEntity need not match the corresponding objects in the given object for the return result to be true.
-
newRelation
public ComponentRelation newRelation(java.lang.String name) throws IllegalActionException, NameDuplicationException
Create a new instance of Transition with the specified name in this actor, and return it. This method is write-synchronized on the workspace.- Overrides:
newRelation
in classFSMActor
- Parameters:
name
- The name of the new transition.- Returns:
- A transition with the given name.
- Throws:
IllegalActionException
- If the name argument is null.NameDuplicationException
- If name collides with that of a transition already in this actor.
-
updateAppearance
public void updateAppearance(GTIngredientsAttribute attribute)
Update appearance of this entity.- Specified by:
updateAppearance
in interfaceGTEntity
- Parameters:
attribute
- The attribute containing ingredients of this entity.- See Also:
GTEntityUtils.updateAppearance(GTEntity, GTIngredientsAttribute)
-
valueChanged
public void valueChanged(Settable settable)
React to the fact that the specified Settable has changed.- Specified by:
valueChanged
in interfaceValueListener
- Parameters:
settable
- The object that has changed value.- See Also:
GTEntityUtils.valueChanged(GTEntity, Settable)
-
-