Class PoissonClock

  • All Implemented Interfaces:
    java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, TimedActor, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

    public class PoissonClock
    extends RandomSource
    implements TimedActor
    This actor produces discrete events according to a Poisson process. The time between events is given by independent and identically distributed exponential random variables. The values produced rotate sequentially through those given in the values parameter, which is an array of anything and defaults to {1, 0}. The type of the output can be any token type. This type is inferred from the element type of the values parameter. The mean time between events is given by the meanTime parameter, which defaults to 1.0.

    In the initialize() method and postfire() methods, 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.

    If the trigger input is connected, then any event on it will cause the Poisson process to immediately produce the next event, as if the time for that event had arrived.

    If this actor is inactive at the time at which it would have otherwise produced an output, then it will stop producing outputs. This should not happen.

    Since:
    Ptolemy II 1.0
    Version:
    $Id$
    Author:
    Edward A. Lee
    Pt.AcceptedRating:
    Yellow (yuhong)
    Pt.ProposedRating:
    Yellow (eal)
    • Field Detail

      • fireAtStart

        public Parameter 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

        public Parameter meanTime
        The mean time between events, where the output value transitions. This parameter must contain a DoubleToken.
      • stopTime

        public Parameter stopTime
        The time at which postfire() should return false. This is a double that defaults to Infinity, which means that postfire() never returns false (or at least, doesn't do so due to stopTime having been exceeded).
      • values

        public Parameter values
        The values that will be produced at the output. This parameter can contain any ArrayToken, and it defaults to {1, 0}.