RNStream

Instances of RNStream are what is made by the factory. Each created stream should be 2 to 127 {@literal 2^127} steps ahead of the last stream created.

Constructors

Link copied to clipboard
constructor(sName: 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

This stream generates antithetic variates if and only if {\tt antithetic = true}.

Link copied to clipboard
open override val antitheticValue: Double

Returns the antithetic value of the previous value

Link copied to clipboard
open override val id: Int

The id of this object

Link copied to clipboard
open override var label: String?
Link copied to clipboard
open override val name: String

Describes the stream (for writing the state, error messages, etc.).

Link copied to clipboard
open override var previousU: Double

The previous U generated (returned) by randU01()

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

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 antitheticInstance(name: String?): RNStreamIfc
Link copied to clipboard
open override fun instance(name: String?): RNStreamIfc

Returns a copy of the stream that has exactly the same state

Link copied to clipboard
open fun randInt(range: IntRange): Int

A convenience function for allowing the range to be specified via a range

open fun randInt(i: Int, j: Int): Int

Returns a (pseudo)random number from the discrete uniform distribution over the integers {i, i + 1, . . . , j }, using this stream. Calls randU01 once.

Link copied to clipboard
open override fun randU01(): Double

Returns a pseudo-random uniformly distributed number

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

Returns the seed for the start of the sub-stream

Link copied to clipboard

Returns the current state C_g of this stream. This is a vector of 6 integers. This method is convenient if we want to save the state for subsequent use.

Link copied to clipboard
open override fun toString(): String