BernoulliPicker

class BernoulliPicker<T>(successProbability: Double, successOption: T, failureOption: T, stream: RNStreamIfc = KSLRandom.nextRNStream()) : RElementIfc<T>

Allows the picking between two alternatives according to a Bernoulli process.

Parameters

successProbability

the probability associated with success

success

the success choice

failure

the failure choice

stream

the associated random number stream

Constructors

Link copied to clipboard
constructor(successProbability: Double, successOption: T, failureOption: T, streamNum: Int)
constructor(successProbability: Double, successOption: T, failureOption: T, stream: RNStreamIfc = KSLRandom.nextRNStream())

Properties

Link copied to clipboard

If true, the stream will automatically participate in having its stream advanced to the next sub-stream via stream managers

Link copied to clipboard
open override var antithetic: Boolean

Tells the stream to start producing antithetic variates

Link copied to clipboard
var failure: T
Link copied to clipboard
open override val randomElement: T

Returns an element randomly selected from the list

Link copied to clipboard
open override var resetStartStreamOption: Boolean

If true, the stream will automatically participate in having its stream reset to its start stream via stream managers

Link copied to clipboard
open override var rnStream: RNStreamIfc

the underlying stream of random numbers

Link copied to clipboard
open val streamNumber: Int
Link copied to clipboard
var success: T

Functions

Link copied to clipboard
open override fun advanceToNextSubStream()

Positions the RNG at the beginning of its next substream

Link copied to clipboard
open override fun resetStartStream()

The resetStartStream method will position the RNG at the beginning of its stream. This is the same location in the stream as assigned when the RNG was created and initialized.

Link copied to clipboard
open override fun resetStartSubStream()

Resets the position of the RNG at the start of the current substream

Link copied to clipboard
open fun sample(): T

Returns an element randomly selected from the list

open fun sample(size: Int): List<T>

Returns sample of size from the list

Link copied to clipboard
open fun useStreamNumber(streamNumber: Int)

Assigns the stream associated with the supplied number from the default RNStreamProvider