|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.util.Attribute
ptolemy.domains.fsm.kernel.RelationList
A RelationList contains a list of relations of a guard expression. It provides facilities to access the former and current information of each relation of a guard expression during its evaluation. The information includes type and difference information. (See ParseTreeEvaluatorForGuardExpression for detailed explanation of type and difference.) This attribute is non-persistent and will not be exported into MoML.
This class is designed to be used with ParseTreeEvaluatorForGuardExpression. The common usage would be like:
// Construct a relation list for a transition. // The first argument of the constructor is a // transition. _relationList = new RelationList(this, "relationList");
// Associate the relation list with the ParseTreeEvaluatorForGuardExpression _parseTreeEvaluator = new ParseTreeEvaluatorForGuardExpression(_relationList);
ParseTreeEvaluatorForGuardExpression,
Transition,
Serialized Form
| Red (hyzheng) |
| Red (hyzheng) |
| Nested Class Summary |
| Nested classes inherited from class ptolemy.kernel.util.NamedObj |
ptolemy.kernel.util.NamedObj.ContainedObjectsIterator |
| Field Summary |
| Fields inherited from class ptolemy.kernel.util.NamedObj |
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
| Constructor Summary | |
RelationList(Transition transition,
java.lang.String name)
Construct a relation list with the given name contained by the specified transition. |
|
| Method Summary | |
void |
addRelation(int type,
double difference)
Construct a relation node with the given type and difference information of a relation, and add it to the end of the relation list. |
void |
clearRelationList()
Clear the relation list by resetting each relation node. |
void |
commitRelationValues()
Update the relation list by updating each relation node. |
void |
destroy()
Destroy the relation list by deleting all its elements. |
double |
getFormerMaximumDistance()
Return the former difference of the relation which has the maximum current difference. |
boolean |
hasEvent()
Return true if there is some event caused by some relation type change. |
boolean |
isEmpty()
Return true if the relation list is empty. |
int |
length()
Return the number of relations in the relation list. |
double |
maximumDifference()
Iterating the relation list and get the maximum current difference of all the relations. |
int |
maximumDifferenceIndex()
Return the index of the relation with the maximum current difference. |
void |
setRelation(int relationIndex,
int type,
double difference)
Update the relation in the relation list referred by the relation index argument with the given type and difference information. |
| Methods inherited from class ptolemy.kernel.util.Attribute |
_getContainedObject, _propagateExistence, clone, getContainer, setContainer, setName |
| Methods inherited from class ptolemy.kernel.util.NamedObj |
_addAttribute, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _description, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeChanged, 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 |
| Constructor Detail |
public RelationList(Transition transition,
java.lang.String name)
throws ptolemy.kernel.util.IllegalActionException,
ptolemy.kernel.util.NameDuplicationException
transition - The transition container.name - The name of this relation list.
ptolemy.kernel.util.IllegalActionException - If the relation list is not
of an acceptable class for the container, or if the name contains
a period.
ptolemy.kernel.util.NameDuplicationException - If the transition already
has an attribute with the name.| Method Detail |
public void addRelation(int type,
double difference)
type - The relation type of the relation.difference - The difference of the relation.public void clearRelationList()
public void commitRelationValues()
public void destroy()
public double getFormerMaximumDistance()
public boolean hasEvent()
public boolean isEmpty()
public int length()
public double maximumDifference()
public int maximumDifferenceIndex()
public void setRelation(int relationIndex,
int type,
double difference)
relationIndex - The position of the relation in the
relation list.type - The current type of the relation.difference - The current difference of the relation.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||