Esempio n. 1
0
 private void Population_OnGenomesDeletion(object sender, PopulationManagerEventArgs e)
 {
     for (int i = 0; i < e.Genomes.Count; i++)
     {
         GeneticNeuralNetwork gnn = e.Genomes[i];
         gnn.OnFitnessScoreChange -= Genome_OnFitnessScoreChange;
     }
 }
Esempio n. 2
0
        private void Population_OnGenomesChanged(object sender, PopulationManagerEventArgs e)
        {
            int index = 0;

            for (int i = 0; i < Teams.Count; i++)
            {
                Team t = Teams[i];
                if (t.Control is NeuralNetworkControl)
                {
                    NeuralNetworkControl gnn = (NeuralNetworkControl)t.Control;
                    gnn.Genome = e.Genomes[i];
                    gnn.Genome.OnFitnessScoreChange += Genome_OnFitnessScoreChange;
                    index++;
                }
            }
        }