Пример #1
0
 /// <summary>
 /// Initializes a default Genetic Algorith.
 /// </summary>
 public GeneticAlgorithm()
 {
     this.Mutation  = new GaussianMutation();
     this.Crossover = new PointCrossover(3);
     this.Selection = new RouletteSelection();
     this.Pairing   = new TournamentPairing();
 }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of a GeneticAlgorithm.
 /// </summary>
 /// <param name="mutationFunction">Mutation function to apply during evolution.</param>
 /// <param name="crossoverFunction">Crossover Function used during evolution.</param>
 /// <param name="selectionFunction">Selection Function used in chromosome selection.</param>
 /// <param name="pairingFunction">Pairing function used to select pairs of chromosomes during crossover.</param>
 public GeneticAlgorithm(IMutationFunction mutationFunction, ICrossoverFunction crossoverFunction,
                         ISelectionFunction selectionFunction, IPairingFunction pairingFunction)
 {
     this.Mutation  = mutationFunction;
     this.Crossover = crossoverFunction;
     this.Selection = selectionFunction;
     this.Pairing   = pairingFunction;
 }