Randomness for optimization projects.
Randomness for optimization projects.
(as-int prng min-int max-int)
Returns an integer generated with prng
between [min-int; max-int[
.
Returns an integer generated with `prng` between `[min-int; max-int[`.
(as-int-pair prng min-int max-int)
Returns a pair of random integer between [min-int; max-int[
.
Returns a pair of random integer between `[min-int; max-int[`.
(build kw params)
(build registry kw params)
(build registry prng kw params)
Returns the distribution
matching name kw
, built with params params
.
If supplied, the registry
is where kw
will be searched for, search in built-in registry otherwise.
If supplied, the prng
will be leveraged to generate the distribution, will use xoroshiro otherwise.
Returns the `distribution` matching name `kw`, built with params `params`. If supplied, the `registry` is where `kw` will be searched for, search in built-in registry otherwise. If supplied, the `prng` will be leveraged to generate the distribution, will use xoroshiro otherwise.
(built-in)
Creates an instance of the built-in prng of your platform (java or javascript).
Creates an instance of the built-in prng of your platform (java or javascript).
Returns the cumulative probability before p
Returns the cumulative probability before `p`
(distribution-registry)
Returns the base registry.
Returns the base registry.
(draw distribution)
(draw kw params)
(draw)
returns a random value following distribution
.
`(draw)` returns a random value following `distribution`.
(draw-doubles prng n min-int max-int)
Draw n
random doubles with prng
, between [min-int; max-int[
.
Draw `n` random doubles with `prng`, between `[min-int; max-int[`.
(draw-ints prng n min-int max-int)
Draw n
random integers with prng
, between [min-int; max-int[
.
Draw `n` random integers with `prng`, between `[min-int; max-int[`.
(duplicate this)
Duplicates this prng to a new one, starting at the seed value.
Duplicates this prng to a new one, starting at the seed value.
(jump this)
Jump to a completly different place.
Jump to a completly different place.
(median distribution)
(median kw params)
Returns the median of the distribution
Returns the median of the distribution
(reset this)
Returns a prng that starts again at the seed value.
Returns a prng that starts again at the seed value.
(rnd this)
Returns a random number and change the state of the prng so next call will return a new value.
Returns a random number and change the state of the prng so next call will return a new value.
(rnd-range this)
Returns the range in which rnd is returned.
Returns the range in which rnd is returned.
(seed this)
Returns the seed of the random number generator.
Returns the seed of the random number generator.
(xoroshiro128)
(xoroshiro128 seed)
Creates a xoroshiro128 prng instance.
Creates a xoroshiro128 prng instance.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close