public NEATGenome TournamentSelection(int numComparisons)
{
double bestScoreSoFar = 0;
int chosenOne = 0;
for (int i = 0; i < numComparisons; ++i)
{
var thisTry = (int) RangeRandomizer.Randomize(0,Population.Size() - 1);
if (Population.Get(thisTry).Score > bestScoreSoFar)
{
chosenOne = thisTry;
bestScoreSoFar = Population.Get(thisTry).Score;
}
}
return (NEATGenome) Population.Get(chosenOne);
}
}