pyneat.reporting module

Additional reporters (on top of what are offered by NEAT-Python) that are triggered on particular events.

class pyneat.reporting.LogFileReporter(filename, log_level=20, show_species_detail=True)[source]

Bases: neat.reporting.BaseReporter

Write the same information as the StdOutReporter, but instead of printing to standard out, the outputs are written to a log file.

filename

The name of the log file to use.

Type:str
log_level

The log level (either DEBUG, INFO, WARNING, ERROR, or CRITICAL). Note: All LogFileReporter logs are INFO level.

Type:logging.level
show_species_detail

Whether to show detailed species information.

Type:bool
generation

The current generation.

Type:int
generation_start_time

The start time of the current generation.

Type:int
generation_times

The length of time to complete each generation.

Type:list
num_extinctions

The number of extinctions that have occurred.

Type:int
complete_extinction()[source]

The log message to write after a complete extinction has occurred.

end_generation(config, population, species_set)[source]

The log message to write when a generation is ended.

Parameters:
  • config (CustomConfig) – The global configuration settings for the entire algorithm.
  • population (dict) – The population of individuals. A dictionary of genome key, genome pairs.
  • species_set (SpeciesSet) – The speciation scheme for dividing the population into species.
found_solution(config, generation, best)[source]

The log message to write after a solution has been found.

info(msg)[source]

Write a custom log message.

Parameters:msg (str) – The log message to write.
post_evaluate(config, population, species, best_genome)[source]

The log message to write after evaluating the fitness of the population.

Parameters:
  • config (CustomConfig) – The global configuration settings for the entire algorithm.
  • population (dict) – The population of individuals. A dictionary of genome key, genome pairs.
  • species (SpeciesSet) – The speciation scheme for dividing the population into species.
  • best_genome (Genome) – The best genome from the population.
species_stagnant(sid, species)[source]

The log message to write when a species has stagnated.

start_generation(generation)[source]

The log message to write when a generation is started.

Parameters:generation (int) – The current generation number.