ptolemy.domains.fsm.kernel
Class InterfaceAutomatonTransition
java.lang.Object
ptolemy.kernel.util.NamedObj
ptolemy.kernel.Relation
ptolemy.kernel.ComponentRelation
ptolemy.domains.fsm.kernel.Transition
ptolemy.domains.fsm.kernel.InterfaceAutomatonTransition
- All Implemented Interfaces:
- Changeable, java.lang.Cloneable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Nameable, java.io.Serializable
- public class InterfaceAutomatonTransition
- extends Transition
A Transition for Interface Automaton. In the Interface Automata paper
written by Luca de Alfaro and Henzinger, transitions are called actions.
However, the name action conflicts with the Action class in this package,
so this class uses the name transition. There are three types of transitions:
input, output, and internal. Each transition has a label. The labels for
input, output, and internal transitions end with "?", "!", and ";",
respectively. The type of transition is determined by the ending character
of the label this way. Each input transition corresponds to an input port of
the InterfaceAutomaton that contains it, and its label, excluding the
ending "?", must be the same as the input port name; Similarly, each output
transition corresponds to an output port, and its label, excluding the
ending "!", must be the same as the output port name; Each internal
transitions corresponds to a parameter of the InterfaceAutomaton that
contains it, and its label, excluding the ending ";", must be the same as
the parameter name.
The guard of each transition is set automatically. Users should not set
the guard. For an input transition, the guard is set to _isPresent,
where is the port corresponding to this transition; For output
and internal transitions, the guard is set to true. Each of the output
and internal transitions contain an Action. The expression of the Action
is also set automatically. For output transition, the action is set to
=true, where is the output port corresponding to
this transition; for internal transition, the action is set to
=true, where is the parameter corresponding to this
transition.
- Since:
- Ptolemy II 2.0
- Version:
- $Id: InterfaceAutomatonTransition.java,v 1.22 2004/04/13 03:30:47 cxh Exp $
- Author:
- Yuhong Xiong, Xiaojun Liu and Edward A. Lee
- See Also:
InterfaceAutomaton,
Action,
Serialized Form
- Accepted Rating:
- Proposed Rating:
| Fields inherited from class ptolemy.kernel.util.NamedObj |
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
| Methods inherited from class ptolemy.domains.fsm.kernel.Transition |
_checkPort, choiceActionList, clone, commitActionList, destinationState, getGuardExpression, getRefinement, getRelationList, getTriggerExpression, isEnabled, isPreemptive, isTriggered, setGuardExpression, sourceState |
| Methods inherited from class ptolemy.kernel.util.NamedObj |
_addAttribute, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDerivedLevel, getDerivedList, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, message, propagateExistence, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setModelErrorHandler, setPersistent, setSource, toplevel, toString, uniqueName, validateSettables, workspace |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
label
public StringAttribute label
- The label of this transition. Must ends with "?" or "!" or ";"
_INPUT_TRANSITION
protected static final int _INPUT_TRANSITION
- See Also:
- Constant Field Values
_OUTPUT_TRANSITION
protected static final int _OUTPUT_TRANSITION
- See Also:
- Constant Field Values
_INTERNAL_TRANSITION
protected static final int _INTERNAL_TRANSITION
- See Also:
- Constant Field Values
InterfaceAutomatonTransition
public InterfaceAutomatonTransition(InterfaceAutomaton container,
java.lang.String name)
throws IllegalActionException,
NameDuplicationException
- Construct a transition with the specified container and name.
The container argument must not be null, or a NullPointerException
will be thrown. This transition will use the workspace of the
container for synchronization and version counts.
If the name argument is null, then the name is set to the empty string.
- Parameters:
container - An interface automaton.name - The name of this transition.
- Throws:
IllegalActionException - If the container is incompatible
with this transition.
NameDuplicationException - If the name coincides with
any relation already in the container.
attributeChanged
public void attributeChanged(Attribute attribute)
throws IllegalActionException
- React to a change in an attribute. If the changed attribute is
label, use the ending character of the label to determine
the transition type, and set the guard and output action of this
transition. For internal transition, also create the parameter
corresponding to the transition.
Increment the version number of the workspace.
- Overrides:
attributeChanged in class Transition
- Parameters:
attribute - The attribute that changed.
- Throws:
IllegalActionException - If thrown by the superclass
attributeChanged() method, or the changed attribute is
label and it does not ends with "?" or "!" or ";".
getLabel
public java.lang.String getLabel()
- Return the label of this transition. If the label has not been set,
return an empty string.
- Overrides:
getLabel in class Transition
- Returns:
- The label of this transition.
getType
public int getType()
- Return the transition type. The transition type is one of
_INPUT_TRANSITION, _OUTPUT_TRANSITION, or _INTERNAL_TRANSITION.
- Returns:
- the transition type.
setContainer
public void setContainer(CompositeEntity container)
throws IllegalActionException,
NameDuplicationException
- Override the base class to ensure that the proposed container
is an instance of InterfaceAutomaton or null. If it is, call the
base class setContainer() method. A null argument will remove
this transition from its container.
- Overrides:
setContainer in class Transition
- Parameters:
container - The proposed container.
- Throws:
IllegalActionException - If setting the container would
result in a recursive containment structure, or if
this transition and container are not in the same workspace, or
if the argument is not an InterfaceAutomaton or null.
NameDuplicationException - If the container already has
an relation with the name of this transition.
setTriggerExpression
public void setTriggerExpression(java.lang.String expression)
- Throw an exception. Trigger expression is not used in
InterfaceAutomaton, so this method should not be called in this class.
- Overrides:
setTriggerExpression in class Transition
- Parameters:
expression - The trigger expression.
- Throws:
java.lang.UnsupportedOperationException - Always thrown.