withSeed

inline fun <T> withSeed(seed: Long, block: () -> T): T

Runs block with RandomContext set to specified seed.

Resets the seed after the block has been ran.

Parameters

seed

the seed for RandomContext, which controls all distributions sampled within the block

block

code to run while RandomContext is set to the specified seed