pyneat.species module¶
Divides a population into species based on genetic distance.
-
class
pyneat.species.
Species
(key, generation)[source]¶ Bases:
object
Encapsulates all information about a particular species.
-
representative
¶ The genome that is the representative of the species, against which new genomes will be compared to see if they belong in this species.
Type: Genome
-
fitness_history
¶ All previous fitness values. One for each generation this species has survived for.
Type: :list:`float`
-
get_fitnesses
()[source]¶ Get the fitnesses of each genome that belongs to this species.
Returns: The fitness of each genome that belongs to this species. Return type: list
-
-
class
pyneat.species.
SpeciesSet
(config, reporters)[source]¶ Bases:
neat.config.DefaultClassConfig
Encapsulates the speciation scheme.
-
species_set_config
¶ The speciation configuration.
Type: DefaultClassConfig
-
reporters
¶ The set of reporters that log events.
Type: ReporterSet
-
species_key_generator
¶ Keeps track of the next species ID.
Type: generator
-
get_species
(genome_key)[source]¶ Get the species to given individual belongs to.
Parameters: genome_key (int) – The unique key of the genome to check. Returns: The species the individual belongs to. Return type: Species
-
get_species_id
(genome_key)[source]¶ Get the species ID of the species the given individual belongs to.
Parameters: genome_key (int) – The unique key of the genome to check. Returns: The key of the species the individual belongs to. Return type: int
-