public class HybridModalDirector extends FSMDirector implements ContinuousStatefulComponent, ContinuousStepSizeController
Note that when a multi-step solver is used, the guards on the transitions are only evaluated when either the step size is zero or the multi-step solver has just completed its last step. The guards are not evaluated during intermediate steps.
This director is based on HSFSMDirector by Xiaojun Liu and Haiyang Zheng.
NamedObj.ContainedObjectsIterator
_currentLocalReceiverMap, _indexOffset, _localReceiverMaps, controllerName
_actorsFinishedExecution, _aspectForActor, _aspectsPresent, _defaultMicrostep, _executionAspects, _finishRequested, _initializables, _nextScheduleTime, _stopRequested, _tokenSentToCommunicationAspect, _zeroTime, localClock, startTime, stopTime
_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 |
---|
HybridModalDirector(CompositeEntity container,
java.lang.String name)
Construct a director in the given container with the given name.
|
Modifier and Type | Method and Description |
---|---|
protected ContinuousDirector |
_enclosingContinuousDirector()
Return the enclosing continuous director, or null if there
is none.
|
java.lang.Object |
clone(Workspace workspace)
Clone the actor into the specified workspace.
|
void |
fire()
Fire the model model for one iteration.
|
double |
getErrorTolerance()
Return error tolerance used for detecting enabled transitions.
|
ParseTreeEvaluator |
getParseTreeEvaluator()
Return the parse tree evaluator used to evaluate guard expressions.
|
boolean |
isStepSizeAccurate()
Return true if all actors that were fired in the current iteration
report that the step size is accurate and if no transition is enabled.
|
boolean |
postfire()
Override the base class so that if there is no enabled transition
then we record for each comparison operation in each
guard expression the distance between the current value of the
variable being compared and the threshold.
|
boolean |
prefire()
Override the base class to set current time to match that of
the enclosing executive director, if there is one, regardless
of whether that time is in the future or past.
|
double |
refinedStepSize()
Return the minimum of the step sizes suggested by any
actors that were fired in the current iteration.
|
void |
rollBackToCommittedState()
Roll back to committed state.
|
double |
suggestedStepSize()
Return the minimum of the step sizes suggested by any
actors that were fired in current iteration.
|
_buildLocalReceiverMaps, _currentLocalReceivers, _getLastChosenTransition, _getStateRefinementsToPostfire, _getTransitionRefinementsToPostfire, _readInputs, _readOutputsFromRefinement, _setCurrentConnectionMap, _setCurrentState, _transferOutputs, attributeChanged, defaultDependency, fireAt, getContext, getController, getIndex, getModelNextIterationTime, getModifiedVariables, handleModelError, implementsStrictActorSemantics, initialize, invalidateSchedule, isStrict, newReceiver, preinitialize, resetOutputReceivers, setContainer, setIndex, transferInputs
_actorFinished, _consultTimeRegulators, _description, _isEmbedded, _isTopLevel, _schedule, _transferInputs, addInitializable, createSchedule, delayDependency, elapsedTimeSinceStart, finish, fireAt, fireAt, fireAtCurrentTime, fireContainerAt, fireContainerAt, getCausalityInterface, getCurrentTime, getDeadline, getEnvironmentTime, getExecutionAspect, getGlobalTime, getModelStartTime, getModelStopTime, getModelTime, getNextIterationTime, getStartTime, getStopTime, getTimeResolution, initialize, invalidateResolvedTypes, isEmbedded, isFireFunctional, isStopRequested, iterate, mutexLockObject, notifyTokenSentToCommunicationAspect, preinitialize, removeInitializable, requestInitialization, resume, resumeActor, scheduleContainedActors, setCurrentTime, setEmbedded, setModelTime, setTimeResolution, stop, stopFire, suggestedModalModelDirectors, supportMultirateFiring, suspend, terminate, transferOutputs, transferOutputs, wrapup
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent
_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, 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
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
description, getContainer, getDisplayName, getFullName, getName, getName, setName
public HybridModalDirector(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- Container of this director.name
- Name of this director.IllegalActionException
- If the name has a period in it, or
the director is not compatible with the specified container.NameDuplicationException
- If the container is not a
CompositeActor and the name collides with an entity in the container.public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
clone
in class FSMDirector
workspace
- The workspace for the new actor.java.lang.CloneNotSupportedException
- If a derived class contains
an attribute that cannot be cloned.NamedObj.exportMoML(Writer, int, String)
,
NamedObj.setDeferringChangeRequests(boolean)
public void fire() throws IllegalActionException
fire
in interface Executable
fire
in class FSMDirector
IllegalActionException
- If there is more than one
transition enabled and nondeterminism is not permitted,
or there is no controller, or it is thrown by any
choice action.public final double getErrorTolerance()
public ParseTreeEvaluator getParseTreeEvaluator()
ParseTreeEvaluatorForGuardExpression
is returned.
The parse tree evaluator is set to construction mode.getParseTreeEvaluator
in class FSMDirector
public boolean isStepSizeAccurate()
isStepSizeAccurate
in interface ContinuousStepSizeController
public boolean postfire() throws IllegalActionException
postfire
in interface Executable
postfire
in class FSMDirector
IllegalActionException
- If thrown by any commit action
or there is no controller.public boolean prefire() throws IllegalActionException
prefire
in interface Executable
prefire
in class FSMDirector
IllegalActionException
- If thrown by the superclass.public double refinedStepSize() throws IllegalActionException
refinedStepSize
in interface ContinuousStepSizeController
IllegalActionException
- If the step size cannot be further refined.public void rollBackToCommittedState() throws IllegalActionException
rollBackToCommittedState
in interface ContinuousStatefulComponent
IllegalActionException
- If the rollback attempts to go
back further than the last committed time.public double suggestedStepSize() throws IllegalActionException
suggestedStepSize
in interface ContinuousStepSizeController
IllegalActionException
- If an actor requests an
illegal step size.protected ContinuousDirector _enclosingContinuousDirector()