public static void Cleanup() { var randomizersList = new Dictionary <Type, IRandomizeble>(); randomizersList[typeof(decimal)] = new DecimalRandom(); randomizersList[typeof(string)] = new StringRandom(); randomizersList[typeof(char)] = new CharRandom(); randomizersList[typeof(int)] = new Int32Random(); randomizersList[typeof(long)] = new Int64Random(); randomizersList[typeof(bool)] = new BoolRandom(); randomizersList[typeof(byte)] = new ByteRandom(); randomizersList[typeof(sbyte)] = new SByteRandom(); randomizersList[typeof(float)] = new FloatRandom(); randomizersList[typeof(double)] = new DoubleRandom(); randomizersList[typeof(short)] = new Int16Random(); randomizersList[typeof(uint)] = new UInt32Random(); randomizersList[typeof(ushort)] = new UInt16Random(); randomizersList[typeof(ulong)] = new UInt64Random(); randomizersList[typeof(DateTime)] = new DateTimeRandom(); UniversalRandom.AddRandomizers(randomizersList); UniversalRandom.AddInterceptors(new List <IInterceptor> { new ListInterceptor(), new EnumInterceptor(), new ArrayInterceptor() }); }
public RealGaussianMutation(List <double> sigmas, IEvaluationProfile <double> evaluationProfile, int?seed = null, double probability = 1.0) : base(probability, evaluationProfile) { uniformRNG = new BoolRandom(seed); gaussianRNG = new NormalRealRandom(seed); this.sigmas = new List <double>(sigmas); }
public APopulationCrossover(ACrossover crossover, double prob, int?seed = null) { CrossoverMethod = crossover; Probability = prob; crossoverRNG = new BoolRandom(seed); integerRNG = new UniformIntegerRandom(seed); }
public RealGaussianMutation(double sigma, IEvaluationProfile <double> evaluationProfile, int?seed = null, double probability = 1.0) : base(probability, evaluationProfile) { uniformRNG = new BoolRandom(seed); gaussianRNG = new NormalRealRandom(seed); sigmas = new List <double>(evaluationProfile.iSize); for (int i = 0; i < evaluationProfile.iSize; ++i) { sigmas.Add(sigma); } }
static UniversalRandom() { _randomizers[typeof(decimal)] = new DecimalRandom(); _randomizers[typeof(string)] = new StringRandom(); _randomizers[typeof(char)] = new CharRandom(); _randomizers[typeof(int)] = new Int32Random(); _randomizers[typeof(long)] = new Int64Random(); _randomizers[typeof(bool)] = new BoolRandom(); _randomizers[typeof(byte)] = new ByteRandom(); _randomizers[typeof(sbyte)] = new SByteRandom(); _randomizers[typeof(float)] = new FloatRandom(); _randomizers[typeof(double)] = new DoubleRandom(); _randomizers[typeof(short)] = new Int16Random(); _randomizers[typeof(uint)] = new UInt32Random(); _randomizers[typeof(ushort)] = new UInt16Random(); _randomizers[typeof(ulong)] = new UInt64Random(); _randomizers[typeof(DateTime)] = new DateTimeRandom(); _interceptors.Add(new ArrayInterceptor()); _interceptors.Add(new EnumInterceptor()); _interceptors.Add(new ListInterceptor()); }
public BinaryRandomGenerator(IConstraint <bool> constraint, int?seed = null) : base(constraint) { rng = new BoolRandom(seed); }
public ACrossover(double probability, int?seed = null) { Probability = probability; crossoverRNG = new BoolRandom(seed); }
public UniformCrossover(double probability, int?seed = null) : base(probability, seed) { rng = new BoolRandom(seed); }
public BinaryBitFlipMutation(double probability, IEvaluationProfile <bool> evaluationProfile, int?seed = null) : base(probability, evaluationProfile) { rng = new BoolRandom(seed); }