Пример #1
0
 public GeneticAlgo(IConfigureGeneticParameters parameters, ICreateGenomes <TGenome, TFitness> genomeCreator, [CanBeNull] IComparer <TFitness> fitnessComparer)
 {
     if (genomeCreator == null)
     {
         throw new ArgumentNullException(nameof(genomeCreator));
     }
     m_parameters      = parameters;
     m_genomeCreator   = genomeCreator;
     m_fitnessComparer = fitnessComparer;
 }
Пример #2
0
        public GeneticAlgo(ICanModifyTheGeneticParameters <TGenome> parameters,
                           [NotNull] ICreateGenomes <TGenome, TFitness> genomeCreator,
                           [CanBeNull] IComparer <TFitness> fitnessComparer)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException(nameof(parameters));
            }
            if (genomeCreator == null)
            {
                throw new ArgumentNullException(nameof(genomeCreator));
            }

            m_parameters        = parameters;
            m_parameterModifier = parameters;
            m_genomeCreator     = genomeCreator;
            m_fitnessComparer   = fitnessComparer;
        }