using System; namespace HeuristicLab.Problems.ProgramSynthesis.Push.Extensions { using HeuristicLab.Core; public static class RandomExtensions { /// /// Generates a random biased towards min /// Source /// /// Minimum random int /// Maximum random int /// The bigger this values is, the bigger is the probability that min will be generated /// Random number generater /// public static int NextBiased(this IRandom random, int min, int max, double biasLevel) { return (int)(min + (max - min) * Math.Pow(random.NextDouble(), biasLevel)); } } }