RMap

class RMap<K, V>(map: Map<K, V>, stream: RNStreamIfc = KSLRandom.nextRNStream()) : Map<K, V> , RElementIfc<V>

Permits random sampling of the elements of the map. Elements are randomly sampled with equal probability based on the number of element in the map. There must be at least one element to permit random sampling.

Constructors

Link copied to clipboard
constructor(map: Map<K, V>, 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
open override val entries: Set<Map.Entry<K, V>>
Link copied to clipboard
open override val keys: Set<K>
Link copied to clipboard
open override val randomElement: V

Selected a value equally likely from the map

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

Functions

Link copied to clipboard
open override fun advanceToNextSubStream()

Positions the RNG at the beginning of its next substream

Link copied to clipboard

Computes the box plot summaries for the data within the map

Link copied to clipboard

Computes the confidence intervals for the data in the map

Link copied to clipboard
open override fun containsKey(key: K): Boolean
Link copied to clipboard
open override fun containsValue(value: V): Boolean
Link copied to clipboard
open fun forEach(p0: BiConsumer<in K, in V>)
Link copied to clipboard
open operator override fun get(key: K): V?
Link copied to clipboard
open fun getOrDefault(key: K, defaultValue: V): V
Link copied to clipboard
open override fun isEmpty(): Boolean
Link copied to clipboard

The map of arrays is considered rectangular if all arrays in the map have the same number of elements (same size).

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(): V

Returns an element randomly selected from the list

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

Returns sample of size from the list

Link copied to clipboard

Computes the statistical summaries for the data within the map

Link copied to clipboard

Converts the data map to a 2-D array. The values of the map are extracted

Link copied to clipboard
fun Map<String, DoubleArray>.toDataFrame(): AnyFrame

Converts the data stored in each array to columns within a DataFrame, with the column names as the key from the map and the columns holding the data. Each array must have the same size.

Link copied to clipboard
Link copied to clipboard

Converts the inner DoubleArray to List

Link copied to clipboard
fun Map<String, DoubleArray>.toObservationData(tableName: String = "tblObservations", context: String? = null, subject: String? = null): List<ObservationDataDb>

Converts the data map to a long format view of the observations.

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

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