Darwin Neuroevolution Framework
Public Member Functions | List of all members
darwin::Population Class Referenceabstract

A population implementation encapsulates the fixed-size set of genotypes, together with the rules for creating a new generation from the previous one. More...

#include <darwin.h>

Inheritance diagram for darwin::Population:
core::NonCopyable

Public Member Functions

virtual size_t size () const =0
 The fixed number of genotypes in the population.
 
virtual Genotypegenotype (size_t index)=0
 Indexed access to a genotype in the population.
 
virtual const Genotypegenotype (size_t index) const =0
 Indexed access to a genotype in the population.
 
virtual vector< size_t > rankingIndex () const =0
 Return the indexes of the ranked genotypes (sorted from best to worst) More...
 
virtual int generation () const =0
 The current generation number.
 
virtual void createPrimordialGeneration (int population_size)=0
 Initialize an initial generation.
 
virtual void createNextGeneration ()=0
 Creates a new generation based on the current one. More...
 
Genotypeoperator[] (size_t index)
 Array subscript operator (required for pp::for_each)
 

Detailed Description

A population implementation encapsulates the fixed-size set of genotypes, together with the rules for creating a new generation from the previous one.

See also
Domain
PopulationFactory

Member Function Documentation

◆ createNextGeneration()

virtual void darwin::Population::createNextGeneration ( )
pure virtual

Creates a new generation based on the current one.

It assumes that all the genotypes have been evaluated (see Domain::evaluatePopulation())

See also
Domain::evaluatePopulation()

◆ rankingIndex()

virtual vector<size_t> darwin::Population::rankingIndex ( ) const
pure virtual

Return the indexes of the ranked genotypes (sorted from best to worst)

The rankings are calculated based on the fitness values assigned to each genotype, and potentially other criteria internal to the population (for example a population may break the fitness ties by favoring less complex genotypes)


The documentation for this class was generated from the following file: