BernoulliVariable

class BernoulliVariable<T> @JvmOverloads constructor(parent: ModelElement, bernoulliRV: BernoulliRV, val success: T, val failure: T, name: String? = null) : ModelElement, BernoulliPickerIfc<T> , RNStreamControlIfc, StreamNumberIfc, BernoulliVariableCIfc(source)

A BernoulliVariable models two choices (success, failure) governed by a Bernoulli random variable

Parameters

parent

the parent model element

bernoulliRV

the Bernoulli random variable with success probability mapped to success.

success

the thing associated with success. Must have the same type as failure.

failure

the thing associated with failure. Must have the same type as success.

name

the name of the model element

Constructors

Link copied to clipboard
constructor(parent: ModelElement, successProbability: Double, success: T, failure: T, streamNumber: Int = 0, name: String? = null)

A BernoulliVariable models two choices (success, failure) governed by a Bernoulli random variable

constructor(parent: ModelElement, bernoulliRV: BernoulliRV, success: T, failure: T, name: String? = null)

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

Provides a reference to the underlying source of randomness during the replication. Controls the underlying BernoulliRV source. This changes the source for the current replication only. The random variable will start to use this source immediately; however, if a replication is started after this method is called, the random source will be reassigned to the initial random source before the next replication is executed. To change the random source for the entire experiment (all replications) use the initialRandomSource property

Link copied to clipboard
open override val failure: T
Link copied to clipboard
open override var initialBernoulliRV: BernoulliRV

Provides a reference to the underlying source of randomness to initialize each replication. Controls the underlying BernoulliRV source for the element. This is the source to which each replication will be initialized. This is only used when the replication is initialized. Changing the reference has no effect during a replication.

Link copied to clipboard
open override val randomElement: T

Returns a randomly selected value

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 val streamNumber: Int
Link copied to clipboard
open override val 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