Пример #1
0
        /// <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(BinaryMutation mutationOptions, double weight = 1)
        {
            var mutations = GeneticFactory.ConstructBinaryMutationOperators(mutationOptions, weight);

            if (_mutations == null)
            {
                _mutations = mutations;
            }
            else
            {
                _mutations.AddRange(mutations);
            }

            _mutationF += ComputeWeightedSum(mutations);
        }
Пример #2
0
        private BinaryChromosome GetMutation(BinaryChromosome chromosome, BinaryMutation mutation)
        {
            var rator = GeneticFactory.ConstructBinaryMutationOperators(mutation).First();

            return(rator.Invoke(chromosome) as BinaryChromosome);
        }
Пример #3
0
 /// <summary>
 /// Gets the default mutation operators.
 /// </summary>
 /// <returns>The default mutation operators.</returns>
 protected override List <IMutation> GetDefaultMutations()
 {
     return(GeneticFactory.ConstructBinaryMutationOperators(DEFAULT_MUTATION_OPTIONS));
 }