Vita
Classes | Public Types | Public Member Functions | List of all members
vita::population< T > Class Template Reference

A group of individuals which may interact together (for example by mating) producing offspring. More...

#include <population.h>

Classes

class  base_iterator
 

Public Types

using const_iterator = base_iterator< true >
 
using iterator = base_iterator< false >
 
using layer_t = std::vector< T >
 

Public Member Functions

void add_layer ()
 
void add_to_layer (unsigned, const T &)
 
unsigned allowed (unsigned) const
 
const_iterator begin () const
 
const_iterator end () const
 
const problemget_problem () const
 
void inc_age ()
 
unsigned individuals () const
 
unsigned individuals (unsigned) const
 
void init_layer (unsigned)
 
bool is_valid () const
 
unsigned layers () const
 
bool load (std::istream &, const problem &)
 
T & operator[] (coord)
 
const T & operator[] (coord) const
 
void pop_from_layer (unsigned)
 
 population (const problem &)
 
void remove_layer (unsigned)
 
bool save (std::ostream &) const
 
void set_allowed (unsigned, unsigned)
 

Detailed Description

template<class T>
class vita::population< T >

A group of individuals which may interact together (for example by mating) producing offspring.

Template Parameters
Tthe type of the an individual

Typical population size in GP ranges from ten to many thousands. The population is organized in one or more layers that can interact in many ways (depending on the evolution strategy).

Definition at line 36 of file population.h.

Member Typedef Documentation

◆ const_iterator

template<class T >
using vita::population< T >::const_iterator = base_iterator<true>

Definition at line 66 of file population.h.

◆ iterator

template<class T >
using vita::population< T >::iterator = base_iterator<false>

Definition at line 67 of file population.h.

◆ layer_t

template<class T >
using vita::population< T >::layer_t = std::vector<T>

Definition at line 42 of file population.h.


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