public override float Evaluate(Individual individual) { int foodScore = 0; int poisonScore = 0; foreach (Board b in boards) { b.ResetBoard(); ANNWeightPhenotype phenotype = (ANNWeightPhenotype)individual.Phenotype; ann.SetWeights(phenotype.Weights); for (int i = 0; i < timeSteps; i++) { b.player.Move(b.player.GetMove()); } foodScore += b.player.foodScore; poisonScore += b.player.poisonScore; } return((float)(foodScore * foodWeight + poisonScore * poisonWeight)); }