PARACOSM AGENTOS | API Reference v0.9.1035
Home Simulation API Docs GitHub npm
Home Simulation API Docs GitHub npm AgentOS Discord
paracosm - v0.9.1035
    Preparing search index...

    Class SeededRng

    Mulberry32: fast 32-bit seeded PRNG. Deterministic: same seed always produces same sequence.

    Index
    • Returns true with the given probability (0-1).

      Parameters

      • probability: number

      Returns boolean

    • Current PRNG state, as a 32-bit integer. Captured into snapshots and restored via fromState for deterministic resume.

      Returns number

    • Returns an integer in [min, max] inclusive.

      Parameters

      • min: number
      • max: number

      Returns number

    • Picks a random element from an array.

      Type Parameters

      • T

      Parameters

      • arr: readonly T[]

      Returns T

    • Construct a SeededRng positioned at a specific internal state. Different from the seed-based constructor: the returned RNG produces the same sequence as the source did AT THE MOMENT getState() was captured.

      Parameters

      • state: number

      Returns SeededRng