/// <summary> /// constructor /// </summary> public CauchyDistributionIRandomNumber() { seed1 = (uint)Math.Abs(DateTime.Now.Millisecond); seed2 = seed1 + 1; ud1 = new UniformDistributionIRandomNumber(seed1); ud2 = new UniformDistributionIRandomNumber(seed2); }
/// <summary> /// constructor /// </summary> public HalfNormalDistributionIRandomNumber() { seed1 = (uint)Math.Abs(DateTime.Now.Millisecond); seed2 = seed1 + 1; ud1 = new UniformDistributionIRandomNumber(seed1); ud2 = new UniformDistributionIRandomNumber(seed2); even = true; }
/// <summary> /// 種を設定する /// </summary> /// <param name="the_seed_1"></param> public void SetSeed(uint the_seed_1, uint the_seed_2) { seed1 = the_seed_1; if (the_seed_1 == the_seed_2 && the_seed_1 == uint.MaxValue) { seed2 = 0; } else if (the_seed_1 == the_seed_2) { seed2 = the_seed_1 + 1; } else { seed2 = the_seed_2; } ud1 = new UniformDistributionIRandomNumber(seed1); ud2 = new UniformDistributionIRandomNumber(seed2); }
/// <summary> /// constructor /// </summary> /// <param name="the_seed"></param> public HalfNormalDistributionIRandomNumber(uint the_seed_1, uint the_seed_2) { seed1 = the_seed_1; if (the_seed_1 == the_seed_2 && the_seed_1 == uint.MaxValue) { seed2 = 0; } else if (the_seed_1 == the_seed_2) { seed2 = the_seed_1 + 1; } else { seed2 = the_seed_2; } ud1 = new UniformDistributionIRandomNumber(seed1); ud2 = new UniformDistributionIRandomNumber(seed2); even = true; }