//随机产生一个符合正态分布的数 u均数,d为方差
public static double Rand(double u, double d)
{
double u1, u2, z, x;
//Random ram = new Random();
if (d <= 0)
{
return u;
}
u1 = (new Random(GetRandomSeed())).NextDouble();
u2 = (new Random(GetRandomSeed())).NextDouble();
z = Math.Sqrt(-2 * Math.Log(u1)) * Math.Sin(2 * Math.PI * u2);
x = u + d * z;
return x;
}