public class SchedulingRelation extends Transition
A scheduling relation may carry argument values to be supplied to the event to be scheduled, who has parameters defined on it. The number and types of the evaluated arguments must match those of the parameters declared by the event.
If the guard of a scheduling relation is omitted, it is defaulted to true, which means the scheduling relation is unconditional.
A scheduling relation can be assigned a priority, which is an integer number. The default priority is 0. Priorities are used to order the scheduling relations from the same event. Scheduling relations with higher priorities (smaller priority numbers) are scheduled before those with lower priorities from the same event, if they are scheduled at exactly the same time in the future.
NamedObj.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
StringAttribute |
arguments
The attribute for arguments.
|
Parameter |
canceling
A Boolean-valued parameter that defines whether this scheduling relation
is cancelling.
|
StringAttribute |
delay
The attribute for the model-time delay.
|
Priority |
priority
The priority of this scheduling relation.
|
StringParameter |
triggers
A comma-separated list of port names and variable names to be
monitored.
|
annotation, defaultTransition, error, exitAngle, fsmTransitionParameterName, gamma, guardExpression, history, immediate, nondeterministic, outputActions, preemptive, refinementName, setActions, showFSMTransitionParameter, termination
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
Constructor and Description |
---|
SchedulingRelation(PteraController container,
java.lang.String name)
Construct a scheduling relation with the given name contained by the
specified entity.
|
Modifier and Type | Method and Description |
---|---|
void |
attributeChanged(Attribute attribute)
React to a change in an attribute.
|
java.lang.Object |
clone(Workspace workspace)
Clone the scheduling relation into the specified workspace.
|
Token |
getArguments(ParserScope scope)
Evaluate the parse tree of the arguments and return an ArrayToken or
RecordToken that contains the values of those arguments in the given
parser scope.
|
double |
getDelay(ParserScope scope)
Evaluate the delay parameter in the given parse scope and return its
value.
|
java.lang.String |
getLabel()
Return a string describing this scheduling relation.
|
java.util.List<NamedObj> |
getTriggers()
Get the list of ports or variables referred to in the triggers
attributes.
|
boolean |
isCanceling()
Return whether this scheduling relation is cancelling.
|
boolean |
isEnabled(ParserScope scope)
Evaluate the guard in the given parser scope, and return whether this
scheduling relation is enabled (with its guard evaluated to true).
|
_checkPort, choiceActionList, commitActionList, destinationState, getFullLabel, getGuardExpression, getParseTreeEvaluator, getRefinement, isDefault, isEnabled, isErrorTransition, isHistory, isImmediate, isNondeterministic, isPreemptive, isTermination, setContainer, setFsmTransitionParameter, setGuardExpression, sourceState
_checkContainer, _checkRelation, _propagateExistence, deepLinkedPortList, deepLinkedPorts, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, unlinkAll
_description, _getContainedObject, link, linkedObjectsList, linkedPortList, linkedPortList, linkedPorts, linkedPorts, numLinks, relationGroupList, unlink
_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, handleModelError, 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
public StringAttribute arguments
public Parameter canceling
public StringAttribute delay
public Priority priority
public StringParameter triggers
public SchedulingRelation(PteraController container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container.name
- The name of the scheduling relation.IllegalActionException
- If the container is incompatible
with this scheduling relation.NameDuplicationException
- If the name coincides with
any relation already in the container.public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged
in class Transition
attribute
- The attribute that changed.IllegalActionException
- If thrown by the superclass
attributeChanged() method, or the changed attribute is the
arguments parameter or the delay parameter and is given
an expression that does not evaluate to a boolean value, or this
scheduling relation is set to cancelling but the values of
arguments and delay are not acceptable.public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
clone
in class Transition
workspace
- The workspace for the new scheduling relation.java.lang.CloneNotSupportedException
- If a derived class contains
an attribute that cannot be cloned.NamedObj.exportMoML(Writer, int, String)
,
NamedObj.setDeferringChangeRequests(boolean)
public Token getArguments(ParserScope scope) throws IllegalActionException
scope
- The parser scope in which the arguments are evaluated.ArrayToken
or RecordToken
.IllegalActionException
- If the evaluation is unsuccessful.public double getDelay(ParserScope scope) throws IllegalActionException
scope
- The parser scope in which the delay is evaluated.IllegalActionException
- If the evaluation is unsuccessful.public java.lang.String getLabel()
getLabel
in class Transition
public java.util.List<NamedObj> getTriggers() throws IllegalActionException
IllegalActionException
- If the value of the triggers parameter
cannot be obtained.public boolean isCanceling()
public boolean isEnabled(ParserScope scope) throws IllegalActionException
isEnabled
in class Transition
scope
- The parser scope in which the guard is to be evaluated.IllegalActionException
- If thrown when evaluating the guard.