예제 #1
0
 ///<summary>Change the fitness of all entries using fitness mod function</summary>
 public void modifyFitness(DFitnessMod p_mod)
 {
     foreach (FitnessObject <T> fitobj in m_objects)
     {
         fitobj.modifyFitness(p_mod);
     }
 }
예제 #2
0
            public DNABasedEvolutionManager(ISpecies <ADNA <T> > p_species, float p_mutation_chance_percentage, int p_size, DFitnessMod p_dna_ageing, float p_interval)
            {
                m_gene_pool = new FitnessList <ADNA <T> >(p_size);
                m_mutation_chance_percentage = p_mutation_chance_percentage;
                m_species = p_species;

                m_interval = new IntervalEventManager();
                m_interval.addListener(p_interval, () => {
                    m_gene_pool.modifyFitness(p_dna_ageing);
                });
            }
예제 #3
0
 ///<summary>Change this objects fitness with modification function</summary>
 public void modifyFitness(DFitnessMod p_mod)
 {
     m_fitness = p_mod(m_fitness);
 }