StochasticUniversalSampling

Stochastic Universal Sampling (§A.5): draws individuals proportionally to their selection probabilities using a single random start and n equally-spaced pointers, giving lower-variance sampling than independent roulette spins. A run is reproducible for a fixed random stream.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun sample(weighted: List<Pair<Solution, Double>>, n: Int, rnStream: RNStreamIfc): List<Solution>

Samples n individuals from the (item, probability) pairs in weighted using SUS driven by rnStream. Probabilities need not sum to one; they are normalized internally.