
PoissonClock |
ptolemy.actor.lib.PoissonClock |
This actor produces a signal that is piecewise constant, with transitions
between levels taken at times given by a Poisson process.
It has various uses. Its simplest use in the DE domain
is to generate a sequence of events at intervals that are spaced
randomly, according to an exponential distribution.
In CT, it can be used to generate a piecewise constant waveform
with randomly spaced transition times.
In both domains, the output value can cycle through a set of values.
The mean time between events is given by the meanTime parameter.
An event is defined to be the transition to a new output value.
The default mean time is 1.0.
The values parameter must contain an ArrayToken, or an
exception will be thrown when it is set.
By default the elements of the array are IntTokens with values 1 and 0,
Thus, the default output value is always 1 or 0.
In the initialize() method and in each invocation of the fire() method,
the actor uses the fireAt() method of the director to request
the next firing. The first firing is always at the start time, unless
the parameter fireAtStart is changed to false.
It may in addition fire at any time in response to a trigger
input. On such firings, it simply repeats the most recent output
(or generates a new output if the time is suitable.)
Thus, the trigger, in effect, asks the actor what its current
output value is. Some directors, such as those in CT, may also fire the
actor at other times, without requiring a trigger input. Again, the actor
simply repeats the previous output.
Thus, the output can be viewed as samples of the piecewise
constant waveform,
where the time of each sample is the time of the firing that
produced it.
The type of the output can be any token type. This type is inferred from
the element type of the values parameter.
Author(s): Edward A. Lee
Version:$Id: PoissonClock.java,v 1.28 2005/07/08 19:56:03 cxh Exp $
Pt.Proposed Rating:Yellow (eal)
Pt.Accepted Rating:Yellow (yuhong)
fireAtStart
If true, then this actor will request a firing at the start time.
Otherwise, the first firing will be requested at the first random
time. This is a boolean-valued parameter that defaults to true.
meanTime
The mean time between events, where the output value transitions.
This parameter must contain a DoubleToken.
values
The values that will be produced at the output.
This parameter can contain any ArrayToken, and it defaults to {1, 0}.