Genome Interface
This is an outline of the minimal interface that is expected to be present on genome objects; example genome objects can be seen in DefaultGenome and iznn.IZGenome.
Class Methods
Takes a dictionary of configuration items, returns an object that will later be passed to the
write_configmethod. This configuration object is considered to be opaque by the rest of the library.Takes a file-like object and the configuration object created by parse_config. This method should write the configuration item definitions to the given file.
Initialization/Reproduction
Takes a unique genome instance identifier. The initializer should create the following members:
connections- (gene_key, gene) pairs for the connection gene set.
nodes- (gene_key, gene) pairs for the node gene set.
fitnessConfigure the genome as a new random genome based on the given configuration from the top-level
Configobject.
Crossover/Mutation
configure_crossover(self, genome1, genome2, config, fitness_criterion=None)Configure the genome as a child of the given parent genomes. The optional
fitness_criterionparameter ('max','min', orNone) determines which parent is considered fitter for the purpose of inheriting disjoint and excess genes. When'min', lower fitness is better. Defaults to'max'if not provided.Apply mutation operations to the genome, using the given configuration.
Speciation/Misc
Returns the genomic distance between this genome and the other. This distance value is used to compute genome compatibility for speciation.
Returns a measure of genome complexity. This object is currently only given to reporters at the end of a generation to indicate the complexity of the highest-fitness genome. In the DefaultGenome class, this method currently returns (number of nodes, number of enabled connections).