예제 #1
0
 // VALUE Return a Float 0 - 1
 public float Value(Normalization n, float t)
 {
     if (n == Normalization.STDNORMAL)
     {
         return((float)NormalDistribution.Normalize(_rand.NextSingle(true), t));
     }
     else if (n == Normalization.POWERLAW)
     {
         return((float)PowerLaw.Normalize(_rand.NextSingle(true), t, 0, 1));
     }
     else
     {
         return(_rand.NextSingle(true));
     }
 }
예제 #2
0
 // RANDOM RAINBOW COLOR
 public Color Rainbow(Normalization n, float t)
 {
     if (n == Normalization.STDNORMAL)
     {
         return(WaveToRgb.LinearToRgb((float)NormalDistribution.Normalize(_rand.NextSingle(true), t)));
     }
     else if (n == Normalization.POWERLAW)
     {
         return(WaveToRgb.LinearToRgb((float)PowerLaw.Normalize(_rand.NextSingle(true), t, 0, 1)));
     }
     else
     {
         return(WaveToRgb.LinearToRgb(_rand.NextSingle(true)));
     }
 }
예제 #3
0
 // RANGE Return a Float min < x < max
 public float Range(Int32 minValue, Int32 maxValue, Normalization n, float t)
 {
     if (n == Normalization.STDNORMAL)
     {
         return(SpecialFunctions.ScaleFloatToRange((float)NormalDistribution.Normalize(_rand.NextSingle(true), t), minValue, maxValue, 0, 1));
     }
     else if (n == Normalization.POWERLAW)
     {
         return((float)PowerLaw.Normalize(_rand.NextSingle(true), t, minValue, maxValue));
     }
     else
     {
         return(_rand.Next(minValue, maxValue));
     }
 }
예제 #4
0
 /// <summary>
 /// Returns the next pseudo-random number integer between <paramref name="min"/> [inclusive] and <paramref name="max"/> [inclusive].
 /// in Power Law distribution
 /// </summary>
 /// <param name="min">Minimum.</param>
 /// <param name="max">Maximum.</param>
 /// <param name="temperature">Temperature.</param>
 public float RangePower(float min, float max, float temperature)
 {
     return(ScaleFloatToRange((float)PowerLaw.Normalize(_rand.NextSingle(true), temperature, 0, 1), min, max, 0.0f, 1.0f));
 }
예제 #5
0
 /// <summary>
 /// Returns a power-law pseudo-random number between 0.0 [inclusive] and 1.0 [inclusive] (Read Only).
 /// </summary>
 /// <returns>
 /// This method returns a single-precision pseudo-random number greater than or equal to zero, and less
 /// than or equal to one.
 /// </returns>
 /// <param name="temperature">Temperature.</param>
 public float valuePower(float temperature)
 {
     return((float)PowerLaw.Normalize(_rand.NextSingle(true), temperature, 0, 1));
 }