public static GeneticFunction GetGene() { GeneticFunction result = null; int r = GeneticPrimes.rnd.Next(7); switch (r) { case 0: result = new AddFunction(); break; case 1: result = new SubtractFunction(); break; case 2: result = new MultiplyFunction(); break; case 3: result = new DivideFunction(); break; case 4: result = new OddFunction(); break; case 5: result = new SquareRootFunction(); break; case 6: result = new SquareFunction(); break; } result.modifier = GeneticPrimes.rnd.Next(rndRange); return result; }
public override GeneticFunction Clone() { GeneticFunction result = new MultiplyFunction(); result.modifier = modifier; return(result); }
public static GeneticFunction GetGene() { GeneticFunction result = null; int r = GeneticPrimes.rnd.Next(7); switch (r) { case 0: result = new AddFunction(); break; case 1: result = new SubtractFunction(); break; case 2: result = new MultiplyFunction(); break; case 3: result = new DivideFunction(); break; case 4: result = new OddFunction(); break; case 5: result = new SquareRootFunction(); break; case 6: result = new SquareFunction(); break; } result.modifier = GeneticPrimes.rnd.Next(rndRange); return(result); }
public override GeneticFunction Clone() { GeneticFunction result = new MultiplyFunction(); result.modifier = modifier; return result; }