
DiscreteRandomSource |
ptolemy.actor.lib.DiscreteRandomSource |
An actor that produces tokens with a given probability mass function.
The probability mass function is a parameter, pmf, of this
actor. The pmf must be an array that contains entries that
are all between 0.0 and 1.1, and sum to 1.0. By default, pmf is
initialized to {0.5, 0.5}.
Output values are selected at random from the values parameter,
which contains an ArrayToken. This array must have the same length as
pmf. Thus the i-th token in values has probability
pmf[i]. The output port has the same type as the elements of
the values array. The default values are {0, 1}, which are
integers.
Author(s): Jeff Tsay, Yuhong Xiong
Version:$Id: DiscreteRandomSource.java,v 1.48 2006/03/30 16:33:59 cxh Exp $
Pt.Proposed Rating:Yellow (eal)
Pt.Accepted Rating:Yellow (ssachs)
pmf
The probability mass function.
This parameter contains an array of doubles, with default value
{0.5, 0.5}.
values
The values to be sent to the output.
This parameter contains an ArrayToken, initially with value
{0, 1} (an int array).