RandomBridge

Bridges a deterministic RNG to jMetal's PseudoRandomGenerator interface.

This utility centralizes random generation so that experiments are reproducible under a single master seed. It installs an adapter over SplittableRandom that implements exactly the methods required by your jMetal variant.

Design notes:

  • Installation is explicit: call installDeterministic once at startup to set the master seed.

  • Use childSeed to derive stable seeds for labeled sub‑runs (for example "BEST", "WORST", "AVERAGE").

  • Use withSeed to temporarily swap the jMetal RNG inside a sequential block and then restore it.

  • The adapter intentionally does not override methods that your interface does not require.

Determinism:

  • Determinism is guaranteed for the same JVM, jMetal version, adapter logic, and identical call order.

  • Program-level sequential execution must be ensured by the caller when determinism is requested.

Functions

Link copied to clipboard
fun childSeed(label: String, index: Int = 0): Long

Derives a stable child seed from the installed master seed for a labeled sub‑run.

Link copied to clipboard

Installs a deterministic RNG into jMetal under the provided master seed.

Link copied to clipboard

Indicates whether a deterministic RNG has been installed into jMetal via installDeterministic.

Link copied to clipboard
fun <T> withSeed(seed: Long, block: () -> T): T

Temporarily replaces jMetal's RNG with one seeded by seed for the duration of block, then restores the previous generator.