DEmpiricalRV

constructor(probData: List<ProbPoint>, streamNumber: Int = 0, streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider, name: String? = null)

Secondary constructor for the DEmpiricalRV class. This constructor initializes the object using a list of ProbPoint instances, representing the possible values and their associated probabilities, as well as their cumulative probabilities.

Parameters

probData

A list of ProbPoint objects that encapsulate the possible values, their probabilities, and cumulative probabilities.

streamNumber

The number identifying the random number stream to be used. Defaults to 0.

streamProvider

A provider interface for random number streams, defaults to KSLRandom.DefaultRNStreamProvider.

name

Optional name for the instance, providing a descriptive identifier.


constructor(histogram: HistogramIfc, streamNumber: Int = 0, streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider, name: String? = null)

Secondary constructor for the DEmpiricalRV class, allowing initialization using a histogram and optional parameters.

Parameters

histogram

An instance of HistogramIfc providing midpoints and bin fractions for initialization.

streamNumber

An optional stream number used for identifying the random number stream, defaulting to 0.

streamProvider

A random number stream provider of type RNStreamProviderIfc, with a default value of KSLRandom.DefaultRNStreamProvider.

name

An optional name for this random variable instance, defaulting to null.


constructor(values: DoubleArray, cdf: DoubleArray, streamNum: Int = 0, streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider, name: String? = null)

Parameters

values

array to select from

cdf

the cumulative probability associated with each element of array

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