|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.util.Attribute
ptolemy.actor.Director
ptolemy.domains.fsm.kernel.FSMDirector
ptolemy.domains.ct.kernel.HSModalDirector
public class HSModalDirector
An HSModalDirector governs the execution of the discrete dynamics of a hybrid system model.
Hierarchical Hybrid System Simulation describes how hybrid system models are built and simulated in Ptolemy II. A detailed discussion about the underlying semantics can be found at Operational Semantics of Hybrid Systems.
Red (liuxj) |
Yellow (hyzheng) |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj |
---|
NamedObj.ContainedObjectsIterator |
Field Summary | |
---|---|
private double |
_distanceToBoundary
Local variable to indicate the distance to boundary. |
private double |
_lastDistanceToBoundary
Local variable to indicate the last distance to boundary. |
private boolean |
_outputAccurate
Local variable to indicate whether the output is accurate. |
private boolean |
_transitionHasEvent
|
Fields inherited from class ptolemy.domains.fsm.kernel.FSMDirector |
---|
_currentLocalReceiverMap, _enabledRefinements, _enabledTransition, _localReceiverMaps, controllerName |
Fields inherited from class ptolemy.actor.Director |
---|
_actorsFinishedExecution, _currentTime, _finishRequested, _initializables, _stopRequested, timeResolution |
Fields inherited from class ptolemy.kernel.util.NamedObj |
---|
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _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 | |
---|---|
HSModalDirector()
Construct a director in the default workspace with an empty string as its name. |
|
HSModalDirector(CompositeEntity container,
java.lang.String name)
Construct a director in the given container with the given name. |
|
HSModalDirector(Workspace workspace)
Construct a director in the workspace with an empty name. |
Method Summary | |
---|---|
private Transition |
_checkEvent(java.util.List transitionList)
|
void |
emitCurrentStates()
Iterate the enbled refinements to emit the current states of their dynamic actors. |
void |
fire()
Set the values of input variables in the mode controller. |
double |
getCurrentStepSize()
Ask for the current step size used by the solver from the executive CT director. |
double |
getErrorTolerance()
Return error tolerance used for detecting enabled transitions. |
CTExecutionPhase |
getExecutionPhase()
Get the current execution phase of this director. |
CTGeneralDirector |
getExecutiveCTGeneralDirector()
Return the executive CT director of this director, or null if this director is at the top level or the executive director is not a CT general director. |
Time |
getIterationBeginTime()
Return the begin time of the current iteration, this method only makes sense in continuous-time domain. |
Time |
getModelTime()
Return the current time obtained from the executive director, if there is one, and otherwise return the local view of current time. |
java.lang.String |
getODESolverClassName()
Get the ODE solver class name. |
ParseTreeEvaluator |
getParseTreeEvaluator()
Return the parse tree evaluator used to evaluate guard expressions. |
void |
goToMarkedState()
Restore the states of all the enabled refinements to the previously marked states. |
boolean |
hasCurrentEvent()
Return true if the enabled refinements may produce events. |
void |
initialize()
Call the initialize method of the supper class. |
boolean |
isDiscretePhase()
Return true if this is the discrete phase execution. |
boolean |
isOutputAccurate()
Retun true if all the output-step-size-control actors of the enabled refinements are satisfied with the current step size and there is no enabled transition detected. |
boolean |
isStateAccurate()
Retun true if all the refinements can resolve their states with the current step size. |
void |
markState()
Make the current states of all the enabled refinements. |
Receiver |
newReceiver()
Return a CTReceiver. |
boolean |
postfire()
Return true if the mode controller wishes to be scheduled for another iteration. |
double |
predictedStepSize()
Return the smallest next step size predicted by the all the enabled refinements, which are refinements that returned true in their prefire() methods in this iteration. |
boolean |
prefire()
Set the controller and current state. |
boolean |
prefireDynamicActors()
Return true if all the dynamic actors contained by the enabled refinements return true from their prefire() method. |
double |
refinedStepSize()
Return the step size refined by all the enabled refinements, which are refinements that returned true in their prefire() methods in this iteration, or the enabled transition which requires the current time be the same with the time it is enabled. |
Methods inherited from class ptolemy.domains.fsm.kernel.FSMDirector |
---|
_buildLocalReceiverMaps, _checkTransition, _chooseTransition, _currentLocalReceivers, _getLastChosenTransition, _readInputs, _readOutputsFromRefinement, _setCurrentConnectionMap, _setCurrentState, attributeChanged, clone, defaultDependency, fireAt, getContext, getController, getModelNextIterationTime, getModifiedVariables, handleModelError, implementsStrictActorSemantics, isStrict, setContainer, setModelTime, transferInputs |
Methods inherited from class ptolemy.kernel.util.Attribute |
---|
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ptolemy.kernel.util.Nameable |
---|
description, getContainer, getDisplayName, getFullName, getName, getName, setName |
Field Detail |
---|
private double _distanceToBoundary
private double _lastDistanceToBoundary
private boolean _outputAccurate
private boolean _transitionHasEvent
Constructor Detail |
---|
public HSModalDirector()
public HSModalDirector(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 HSModalDirector(Workspace workspace)
workspace
- The workspace of this director.Method Detail |
---|
public void emitCurrentStates() throws IllegalActionException
emitCurrentStates
in interface CTTransparentDirector
IllegalActionException
- If the current states can not
be emitted.public void fire() throws IllegalActionException
fire
in interface Executable
fire
in class FSMDirector
IllegalActionException
- If there is more than one
transition enabled, or can not find the refinements associated with
the current state or enabled transition, or can not read inputs or
outputs from refinements.public double getCurrentStepSize()
getCurrentStepSize
in interface CTGeneralDirector
public final double getErrorTolerance()
getErrorTolerance
in interface CTGeneralDirector
getErrorTolerance
in class Director
public CTGeneralDirector getExecutiveCTGeneralDirector()
getExecutiveCTGeneralDirector
in interface CTGeneralDirector
public CTExecutionPhase getExecutionPhase()
getExecutionPhase
in interface CTGeneralDirector
public Time getIterationBeginTime()
getIterationBeginTime
in interface CTGeneralDirector
public Time getModelTime()
getModelTime
in class Director
Director.setModelTime(Time)
public ParseTreeEvaluator getParseTreeEvaluator()
ParseTreeEvaluatorForGuardExpression
is returned.
The parse tree evaluator is set to construction mode.
getParseTreeEvaluator
in class FSMDirector
public void goToMarkedState() throws IllegalActionException
goToMarkedState
in interface CTTransparentDirector
IllegalActionException
- If there is no marked state.public java.lang.String getODESolverClassName()
getODESolverClassName
in interface CTGeneralDirector
public boolean hasCurrentEvent()
hasCurrentEvent
in interface CTTransparentDirector
public void initialize() throws IllegalActionException
initialize
in interface Initializable
initialize
in class FSMDirector
IllegalActionException
- If the enabled refinements or
the super class throws it.public boolean isDiscretePhase()
isDiscretePhase
in interface CTGeneralDirector
public boolean isOutputAccurate()
isOutputAccurate
in interface CTTransparentDirector
public boolean isStateAccurate()
isStateAccurate
in interface CTTransparentDirector
public void markState()
markState
in interface CTTransparentDirector
public Receiver newReceiver()
newReceiver
in class FSMDirector
public boolean postfire() throws IllegalActionException
postfire
in interface Executable
postfire
in class FSMDirector
IllegalActionException
- If thrown by any action, or
there is no controller, or if the director does not
agree to fire the actor at the specified time.public double predictedStepSize()
predictedStepSize
in interface CTTransparentDirector
public boolean prefire() throws IllegalActionException
prefire
in interface Executable
prefire
in class FSMDirector
IllegalActionException
- If the controller does not exit,
or can not find the specified refinements associated with the current
state, or the prefire() method of refinements throw it, or the super
class throws it.public boolean prefireDynamicActors() throws IllegalActionException
prefireDynamicActors
in interface CTTransparentDirector
IllegalActionException
- If the local directors of refinements
throw it.public double refinedStepSize()
refinedStepSize
in interface CTTransparentDirector
private Transition _checkEvent(java.util.List transitionList)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |