/// <summary> /// Main genome evaluation loop with no phenome caching (decode on each loop). /// </summary> private void Evaluate_NonCaching(IList <TGenome> genomeList) { _phenomeEvaluator.NewGeneration(); Parallel.ForEach(genomeList, _parallelOptions, delegate(TGenome genome) { TPhenome phenome = _genomeDecoder.Decode(genome); if (null == phenome) { // Non-viable genome. genome.EvaluationInfo.SetFitness(0.0); genome.EvaluationInfo.AuxFitnessArr = null; } else { FitnessInfo fitnessInfo = _phenomeEvaluator.Evaluate(phenome); genome.EvaluationInfo.SetFitness(fitnessInfo._fitness); genome.EvaluationInfo.AuxFitnessArr = fitnessInfo._auxFitnessArr; } }); }