private bool IsGenomeInSpecies(IGenome genome, Species compareWithSpecies, EvolutionAlgorithm ea)
        {
//			// Pick a member of the species at random.
//			IGenome compareWithGenome = compareWithSpecies.Members[(int)Math.Floor(compareWithSpecies.Members.Count * Utilities.NextDouble())];
//			return (genome.CalculateCompatibility(compareWithGenome, ea.NeatParameters) < ea.NeatParameters.compatibilityThreshold);

            // Compare against the species champ. The species champ is the exemplar that represents the species.
            IGenome compareWithGenome = compareWithSpecies.Members[0];

            //IGenome compareWithGenome = compareWithSpecies.Members[(int)Math.Floor(compareWithSpecies.Members.Count * Utilities.NextDouble())];
            return(genome.IsCompatibleWithGenome(compareWithGenome, ea.NeatParameters));
        }
示例#2
0
        private bool IsGenomeInSpecies(IGenome genome, Species compareWithSpecies, EvolutionAlgorithm ea)
        {
            //			// Pick a member of the species at random.
            //			IGenome compareWithGenome = compareWithSpecies.Members[(int)Math.Floor(compareWithSpecies.Members.Count * Utilities.NextDouble())];
            //			return (genome.CalculateCompatibility(compareWithGenome, ea.NeatParameters) < ea.NeatParameters.compatibilityThreshold);

            // Compare against the species champ. The species champ is the exemplar that represents the species.
            IGenome compareWithGenome = compareWithSpecies.Members[0];
            //IGenome compareWithGenome = compareWithSpecies.Members[(int)Math.Floor(compareWithSpecies.Members.Count * Utilities.NextDouble())];
            return genome.IsCompatibleWithGenome(compareWithGenome, ea.NeatParameters);
        }