RVariable

abstract class RVariable(streamNum: Int = 0, val streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider, name: String? = null) : RVariableIfc, IdentityIfc, DoubleEmitterIfc(source)

An abstract base class for building random variables. Implement the random generation procedure in the method generate().

Parameters

streamNum

the random number stream number, defaults to 0, which means the next stream

streamProvider

the provider of random number streams, defaults to KSLRandom.DefaultRNStreamProvider

name

an optional name

Inheritors

Constructors

Link copied to clipboard
constructor(streamNum: Int = 0, streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider, 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
override var previousValue: Double

The last (previous) randomly generated value. This value does not change until the next randomly generated value is obtained

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

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 instance(streamNum: Int): RVariableIfc

An instance of the random variable with the stream provided by the same underlying stream provider

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
override fun sample(): Double