#include <Individual.h>
Inheritance diagram for prapi::ga::Individual< T >:

the genotype, and a couple of other properties like fitness and age. The reason why an Individual consists of a list of genes instead of a single list of values is that crossing over can only occur between genes. If genes were handled as a one-dimesional sequence, one had to figure out some un-userfriendly ways to define borders for genes.
Public Methods | |
| Individual () | |
| Create a new individual with fitness and age set to zero. | |
| Individual (const util::List< Gene< T > > &other) | |
| Create a new individual with the given list as its genotype and fitness and age set to zero. | |
| Individual (const Individual &other) | |
| Create a copy of another individual. | |
| Individual (const util::List< T > &values) | |
| Create a new individual with the given genes. | |
| Individual & | operator= (const Individual &other) |
| Copy the contents of another individual. | |
Public Attributes | |
| int | age |
| The age of an individual. | |
| double | fitness |
| The fitness of an individual. | |
Friends | |
| template<class U> bool | operator< (const Individual< U > &i1, const Individual< U > &i2) |
| template<class U> bool | operator> (const Individual< U > &i1, const Individual< U > &i2) |
| template<class U> bool | operator<= (const Individual< U > &i1, const Individual< U > &i2) |
| template<class U> bool | operator>= (const Individual< U > &i1, const Individual< U > &i2) |
|
||||||||||
|
Create a new individual with the given genes. This constructor assumes that each value in values represents one gene. That is, each gene is represented by a single value. A gene is created for each value and appended to the internal genotype of this individual. |