/// <summary> /// Initializes a new instance of the <see cref="UniformGenerator"/> class. /// </summary> /// /// <param name="range">Random numbers range.</param> /// <param name="seed">Seed value to initialize random numbers generator.</param> /// public UniformGenerator( Range range, int seed ) { rand = new UniformOneGenerator( seed ); min = range.Min; length = range.Length; }
/// <summary> /// Initializes a new instance of the <see cref="ExponentialGenerator"/> class. /// </summary> /// /// <param name="rate">Rate value (inverse mean).</param> /// <param name="seed">Seed value to initialize random numbers generator.</param> /// /// <exception cref="ArgumentException">Rate value should be greater than zero.</exception> /// public ExponentialGenerator( float rate, int seed ) { // check rate value if ( rate <= 0 ) throw new ArgumentException( "Rate value should be greater than zero." ); this.rand = new UniformOneGenerator( seed ); this.rate = rate; }
/// <summary> /// Set seed of the random numbers generator. /// </summary> /// /// <param name="seed">Seed value.</param> /// /// <remarks>Resets random numbers generator initializing it with /// specified seed value.</remarks> /// public void SetSeed( int seed ) { rand = new UniformOneGenerator( seed ); }
/// <summary> /// Initializes a new instance of the <see cref="StandardGenerator"/> class. /// </summary> /// /// <param name="seed">Seed value to initialize random numbers generator.</param> /// public StandardGenerator( int seed ) { rand = new UniformOneGenerator( seed ); }
/// <summary> /// Initializes a new instance of the <see cref="StandardGenerator"/> class. /// </summary> /// public StandardGenerator( ) { rand = new UniformOneGenerator( ); }
/// <summary> /// Set seed of the random numbers generator. /// </summary> /// /// <param name="seed">Seed value.</param> /// /// <remarks>Resets random numbers generator initializing it with /// specified seed value.</remarks> /// public void SetSeed( int seed ) { rand = new UniformOneGenerator( seed ); useSecond = false; }