src/lib/MersenneTwister.js
/** 
   * Creates a new instance of the MersenneTwister class or re-uses existing instance for a given seed.
   * It's the preferred way to as a memory optimisation use to create as little instances as possible.
   * 
   * @param {number} seed
   * @returns {MersenneTwister}
   */
Creates a new instance of the MersenneTwister class or re-uses existing instance for a given seed.
It's the preferred way to as a memory optimisation use to create as little instances as possible.

@param {number} seed
@returns {MersenneTwister}
Creates a new instance of the MersenneTwister class or re - uses existing instance for a given seed . It ' s the preferred way to as a memory optimisation use to create as little instances as possible . @param { number } seed @returns { MersenneTwister }
static fromSeed(seed) {
    if (!this[instancesValue]) {
      this[instancesValue] = new Map();
    }
    if (this[instancesValue].has(seed)) {
      return this[instancesValue].get(seed);
    }
    const instance = new MersenneTwister(seed);
    this[instancesValue].set(seed, instance);
    return instance;
  }
static fromSeed ( seed ) { if ( ! this [ instancesValue ] ) { this [ instancesValue ] = new Map ( ) ; } if ( this [ instancesValue ] . has ( seed ) ) { return this [ instancesValue ] . get ( seed ) ; } const instance = new MersenneTwister ( seed ) ; this [ instancesValue ] . set ( seed , instance ) ; return instance ; }
Creates a new instance of the MersenneTwister class or re-uses existing instance for a given seed.
Creates a new instance of the MersenneTwister class or re - uses existing instance for a given seed .