|
||||||||||
| 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.actor.Director
ptolemy.actor.sched.StaticSchedulingDirector
ptolemy.domains.ct.kernel.CTDirector
ptolemy.domains.ct.kernel.CTMultiSolverDirector
ptolemy.domains.ct.kernel.CTMixedSignalDirector
This is a CTDirector that supports the interaction of the continuous-time simulation with event-based domains. This director can both serve as a top-level director and an inside director that is contained by a composite actor in an event-based domain. If it is a top-level director, it acts exactly like a CTMultiSolverDirector. If it is embedded in another event-based domain, it will run ahead of the global time and prepare to roll back if necessary.
This class has an extra parameter as compare to the CTMultiSolverDirector,
which is the maximum run ahead of time length (runAheadLength).
The default value is 1.0.
The running ahead of time is achieved by the following mechanism.
runAheadLength, t3. The fire end time is t1+min(t2, t3)
| Green (chf) |
| Green (liuj) |
| Nested Class Summary |
| Nested classes inherited from class ptolemy.kernel.util.NamedObj |
NamedObj.ContainedObjectsIterator |
| Field Summary | |
protected int |
_Nroll
The number of rollbacks. |
Parameter |
runAheadLength
Parameter of the run ahead length. |
| Fields inherited from class ptolemy.domains.ct.kernel.CTMultiSolverDirector |
breakpointODESolver, ODESolver |
| Fields inherited from class ptolemy.domains.ct.kernel.CTDirector |
_postfireReturns, _refireActors, errorTolerance, initStepSize, maxIterations, maxStepSize, minStepSize, startTime, stopTime, synchronizeToRealTime, timeResolution, valueResolution |
| Fields inherited from class ptolemy.actor.Director |
_currentTime, _stopRequested |
| Fields inherited from class ptolemy.kernel.util.NamedObj |
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
| Fields inherited from interface ptolemy.actor.Executable |
COMPLETED, NOT_READY, STOP_ITERATING |
| Constructor Summary | |
CTMixedSignalDirector()
Construct a director in the default workspace with an empty string as its name. |
|
CTMixedSignalDirector(CompositeEntity container,
java.lang.String name)
Construct a director in the given container with the given name. |
|
CTMixedSignalDirector(Workspace workspace)
Construct a director in the workspace with an empty name. |
|
| Method Summary | |
protected void |
_catchUp()
Catch up the simulation from a known good state to the outside current time. |
protected void |
_initParameters()
Initialize parameters in addition to the parameters inherited from CTMultiSolverDirector. |
protected boolean |
_isStoppedByEvent()
Return true if the current fire phase is stopped due to the occurrence of events (predictable or unpredictable). |
protected boolean |
_isTopLevel()
Return true if this is a top-level director. |
protected void |
_markStates()
Mark the current state as the known good state. |
protected void |
_rollback()
Rollback the system to a "known good" state. |
protected void |
_setIterationEndTime(double time)
Set the end time for this iteration. |
void |
attributeChanged(Attribute attribute)
React to a change in an attribute. |
boolean |
canBeInsideDirector()
Return true indicating that this director can be an inside director. |
void |
fire()
Execute the directed (sub)system to the iteration end time. |
double |
getIterationEndTime()
Return the end time of this director's current iteration. |
double |
getOutsideTime()
Return the time of the outside domain. |
void |
initialize()
First initialize the execution as in CTMultiSolverDirector. |
boolean |
postfire()
If this is a top-level director, behave exactly as a CTMultiSolverDirector, otherwise always return true. |
boolean |
prefire()
Always returns true, indicating that the (sub)system is always ready for one iteration. |
| Methods inherited from class ptolemy.domains.ct.kernel.CTMultiSolverDirector |
_continuousPhaseExecution, _discretePhaseExecution, _fireOneIteration, _isOutputAccurate, _isStateAccurate, _predictNextStepSize, _prefireDynamicActors, _processBreakpoints, _refinedStepWRTOutput, _refinedStepWRTState, canBeTopLevelDirector, getBreakpointSolver, getODESolver, hasCurrentEvent, preinitialize |
| Methods inherited from class ptolemy.actor.sched.StaticSchedulingDirector |
_setScheduler, addDebugListener, getScheduler, invalidateSchedule, isScheduleValid, removeDebugListener, setScheduler, setScheduleValid |
| Methods inherited from class ptolemy.actor.Director |
_description, _isEmbedded, domainPolymorphicTransferInputs, domainPolymorphicTransferOutputs, fireAtCurrentTime, getCurrentTime, getTimeResolution, initialize, invalidateResolvedTypes, iterate, needWriteAccess, requestInitialization, setContainer, setTimeResolution, stop, stopFire, terminate, transferInputs, transferOutputs, wrapup |
| Methods inherited from class ptolemy.kernel.util.Attribute |
_getContainedObject, _propagateExistence, clone, getContainer, setName |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public Parameter runAheadLength
protected int _Nroll
| Constructor Detail |
public CTMixedSignalDirector()
public CTMixedSignalDirector(Workspace workspace)
workspace - The workspace of this object.
public CTMixedSignalDirector(CompositeEntity container,
java.lang.String name)
throws IllegalActionException,
NameDuplicationException
container - The container.name - Name of this director.
IllegalActionException - If the director is not compatible
with the specified container. May be thrown in a derived class.
NameDuplicationException - If the container is not a
CompositeActor and the name collides with an entity in the container.| Method Detail |
public void attributeChanged(Attribute attribute)
throws IllegalActionException
attributeChanged in class CTMultiSolverDirectorattribute - The changed attribute.
IllegalActionException - If the superclass throws it.public boolean canBeInsideDirector()
canBeInsideDirector in class CTMultiSolverDirector
public void fire()
throws IllegalActionException
fire in interface Executablefire in class CTMultiSolverDirectorIllegalActionException - If thrown by the ODE solver,
or the prefire() or the fire() methods of an actor.public final double getIterationEndTime()
public double getOutsideTime()
public void initialize()
throws IllegalActionException
initialize in interface Executableinitialize in class CTMultiSolverDirectorIllegalActionException - If this director has no container or
no scheduler, or thrown by a contained actor.CTMultiSolverDirector.initialize()
public boolean postfire()
throws IllegalActionException
postfire in interface Executablepostfire in class CTMultiSolverDirectorIllegalActionException - Not thrown in this base class.
public boolean prefire()
throws IllegalActionException
If this is not a top-level director, some additional work is done
to synchronize time with the executive director. In particular,
it will compare its local time, say t, with the current time
of the executive director, say t0.
If t == t0, do nothing.
If t > t0, then rollback to the "known good" time (which should be
less than the outside time) and catch up
to the outside time.
If t < t0, then throw an exception because the CT subsystem
should always run ahead of time.
The iteration end time is computed. If this is a
top-level director, the iteration end time is the (local) current
time plus the (local) current step size.
If this director is not a top-level director, the time is
resolved from the current time of the outside domains, say t1,
the next iteration time of the outside domain, say t2, and
the runAheadLength parameter of this director, say t3.
The iteration end time is set
to be t1 + min(t2, t3). The iteration end time may be
further refined by the fire() method due to event detection.
In particular, when the first event is detected, say at t4,
then the iteration end time is set to t4.
prefire in interface Executableprefire in class CTMultiSolverDirectorIllegalActionException - If the local time is
less than the current time of the executive director,
or thrown by a directed actor.
protected void _catchUp()
throws IllegalActionException
IllegalActionException - If thrown from the execution
methods from any actor.protected void _initParameters()
runAheadLength). The default value is 1.0.
_initParameters in class CTMultiSolverDirector
protected boolean _isStoppedByEvent()
throws IllegalActionException
IllegalActionException - If thrown by the scheduler.protected final boolean _isTopLevel()
_isTopLevel in class Director
protected void _markStates()
throws IllegalActionException
IllegalActionException - If thrown by the scheduler.
protected void _rollback()
throws IllegalActionException
IllegalActionException - If thrown by the goToMarkedState()
method of an actor.protected void _setIterationEndTime(double time)
time - The fire end time.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||