MCScope

class MCScope(coroutineContext: CoroutineContext, random: RandomGenerator)

A scope for a Monte-Carlo computations or multi-coroutine random number generation. The scope preserves the order of random generator calls as long as all concurrency calls is done via launch and async functions.

Constructors

MCScope
Link copied to clipboard
common
fun MCScope(coroutineContext: CoroutineContext, random: RandomGenerator)

Functions

equals
Link copied to clipboard
common
open operator fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
common
open fun hashCode(): Int
toString
Link copied to clipboard
common
open fun toString(): String

Properties

coroutineContext
Link copied to clipboard
common
val coroutineContext: CoroutineContext
random
Link copied to clipboard
common
val random: RandomGenerator

Extensions

async
Link copied to clipboard
common
inline fun <T> MCScope.async(context: CoroutineContext = EmptyCoroutineContext, start: CoroutineStart = CoroutineStart.DEFAULT, crossinline block: suspend MCScope.() -> T): Deferred<T>
Specialized async for MCScope.
launch
Link copied to clipboard
common
inline fun MCScope.launch(context: CoroutineContext = EmptyCoroutineContext, start: CoroutineStart = CoroutineStart.DEFAULT, crossinline block: suspend MCScope.() -> Unit): Job
Specialized launch for MCScope.