示例#1
0
        /// <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;
        }
示例#2
0
        /// <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;
        }
示例#3
0
 /// <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);
 }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StandardGenerator"/> class.
 /// </summary>
 ///
 public StandardGenerator( )
 {
     rand = new UniformOneGenerator( );
 }
示例#5
0
 /// <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);
 }
示例#6
0
 /// <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 );
 }
示例#7
0
 /// <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;
 }
示例#8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StandardGenerator"/> class.
 /// </summary>
 /// 
 public StandardGenerator( )
 {
     rand = new UniformOneGenerator( );
 }
示例#9
0
 /// <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;
 }
示例#10
0
        /// <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;
        }
示例#11
0
 /// <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 );
 }
示例#12
0
        /// <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;
        }