
HSDirector |
ptolemy.domains.hs.kernel.HSDirector |
Abstract base class for directors in the CT domain. A CTDirector
has a CTScheduler which provides static schedules for firing
the actors in different phases of execution in one iteration.
<P>
A CTDirector may have more than one ODE solver. In each phase of execution,
one ODE solver takes charge of solving the behavior of a model. This solver
is called the <I>current ODE solver</I>.
<P>
The continuous time (CT) domain is a timed domain. There is a global
notion of time that all the actors are aware of. Time is maintained
by the director. The method getModelTime() returns the current notion of
model time. Time can be set by the setModelTime() method, but this
method should not the called by the actors. Time can only be set
by directors or their ODE solvers. Because ODE solvers can change time
in their fire() methods, we need to record the beginning time of an
iteration to support roll back. The _setIterationBeginTime() method is just
designed for this purpose. It is called in the prefire() method of each
iteration to store the beginning time, and the getIterationBeginTime()
returns the lastest stored time.
<P>
This base class maintains a list of parameters that may be used by
ODE solvers and actors. These parameters are: <Br>
<LI> <code>startTime</code>: The start time of the
simulation. This parameter is effective only if the director
is at the top level. The default value is 0.0.
<LI> <code>stopTime</code>: The stop time of the simulation.
This parameter is effective only if the director
is at the top level. The default value is Infinity, which
results in execution that does not stop on its own.
<LI> <code>initStepSize</code>: The suggested integration step size
by the user. This will be the step size for fixed step
size ODE solvers if there is no breakpoint. However, it is just
a hint. The default value is 0.1
<LI> <code>minStepSize</code>: The minimum step
size that users want to use in the simulation. The default value is 1e-5.
<LI> <code>maxStepSize</code>: The maximum step
size that users want to use in the simulation. Usually used to control
the simulation speed. The default value is 1.0.
<LI> <code>maxIterations</code>:
Used only in implicit ODE solvers. This is the maximum number of
iterations for finding the fixed point at one time point.
The default value is 20.
<LI> <code>errorTolerance</code>: This is the local truncation
error tolerance, used for controlling the integration accuracy
in variable step size ODE solvers. If the local truncation error
at some step size control actors are greater than this tolerance, then the
integration step is considered to have failed, and should be restarted with
a reduced step size. The default value is 1e-4.
<LI> <code>valueResolution</code>:
This is used to control the convergence of fixed point iterations.
If in two successive iterations the difference of the state variables
is less than this resolution, then the fixed point is considered to have
reached. The default value is 1e-6.
<P>
This director maintains a breakpoint table to record all predictable
breakpoints that are greater than or equal to
the current time. The breakpoints are sorted in their chronological order.
Breakpoints at the same time are considered to be identical, and the
breakpoint table does not contain duplicate time points. A breakpoint can
be inserted into the table by calling the fireAt() method. The fireAt method
may be requested by the director, which inserts the stop time of the
execution. The fireAt method may also be requested by actors and the
requested firing time will be inserted into the breakpoint table.
Author(s): Jie Liu, Haiyang Zheng
Version:$Id: HSDirector.doc.html,v 1.1 2006/02/22 18:40:27 mangal Exp $
Pt.Proposed Rating:Green (hyzheng)
Pt.Accepted Rating:Green (hyzheng)
errorTolerance
Error tolerance for local truncation error control, only effective
in variable step size methods.
The default value is 1e-4, and the type is double.
initStepSize
User's hint for the initial integration step size.
The default value is 0.1, and the type is double.
maxIterations
The maximum number of iterations in looking for a fixed point.
The default value is 20, and the type is int.
maxStepSize
User's guide for the maximum integration step size.
The default value is 1.0, and the type is double.
minStepSize
User's guide for the minimum integration step size.
The default value is 1e-5, and the type is double.
startTime
Starting time of the simulation. The default value is 0.0,
and the type is double.
stopTime
Stop time of the simulation. The default value is Infinity,
and the type is double.
synchronizeToRealTime
Indicator whether the execution will synchronize to real time. The
default value is false, and the type is boolean.
valueResolution
Value resolution in looking for a fixed-point state resolution.
The default value is 1e-6, and the type is double.