/// <summary> /// Adds new mutation operators to the metadata. /// </summary> /// <param name="mutationOptions">The mutation options.</param> /// <param name="weight">The operator weight.</param> internal override void AddMutationOperators(PermutationMutation mutationOptions, double weight = 1) { var mutations = GeneticFactory.ConstructPermutationMutationOperators(mutationOptions, weight); if (_mutations == null) { _mutations = mutations; } else { _mutations.AddRange(mutations); } _mutationF += ComputeWeightedSum(mutations); }
/// <summary> /// Gets the default mutation operators. /// </summary> /// <returns>The default mutation operators.</returns> protected override List <IMutation> GetDefaultMutations() { return(GeneticFactory.ConstructPermutationMutationOperators(DEFAULT_MUTATION_OPTIONS)); }
private PermutationChromosome GetMutation(PermutationChromosome chromosome, PermutationMutation mutation) { var rator = GeneticFactory.ConstructPermutationMutationOperators(mutation).First(); return(rator.Invoke(chromosome) as PermutationChromosome); }