Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Individual Class Reference

The carrier of a genome; can have phenotype. More...

#include <individual.h>

List of all members.

Public Methods

 Individual (const Genome &prototype)
void incarnate (bool init)
void set (const String &key, Object *val)
void remove (const String &key)
Object & operator[] (const String &key)
const Object & operator[] (const String &key) const
const Map< String, Object > & features () const
double evaluate (EAEnvironment &envr, bool force=false)
int getage () const
const Selectorselector () const
void setSelector (const SelectionPrms &templ)
bool execute (const GeneticMsg &msg) const
void init ()
bool pointMutate (const MutationRate &k)
const GenstructgetGene (const GeneticID &n) const
void addking ()
int getkings () const
void recombine (const Individual &a, const Individual &b)
double equality (const Individual &other) const
void print (TextOStream &out) const
virtual DataOStream & operator>> (DataOStream &out) const
virtual void check () const

Static Public Methods

void addGenesTo (Genome &g, const StringMap &params)


Detailed Description

The carrier of a genome; can have phenotype.

Another central feature of an Individual is that it's fitness in an EAEnvironment can be measured.

Definition at line 33 of file individual.h.


Constructor & Destructor Documentation

Individual const Genome   prototype [explicit]
 

Construction from genotypic template.

Definition at line 56 of file individual.cc.

References incarnate().


Member Function Documentation

void addGenesTo Genome   g,
const StringMap &    params
[static]
 

Passthrough to the Genome of the Individual.

Definition at line 65 of file individual.cc.

References Selector::addGenesTo().

Referenced by SimplePopulation::SimplePopulation().

void addking   [inline]
 

Passthrough to the Genome of the Individual.

Definition at line 143 of file individual.h.

References Genome::addking().

Referenced by EAStrategy::evolve().

void check   [virtual]
 

Implementation for Object.

Definition at line 212 of file individual.cc.

References Genome::check().

double equality const Individual &    other const [inline]
 

Passthrough to the Genome of the Individual.

Definition at line 149 of file individual.h.

References Gentainer::equality(), and genome.

double evaluate EAEnvironment   envr,
bool    force = false
 

Evaluates the fitness of the phenotype in the given environment.

The evaluation is done as many times as defined for the environment. The resulting fitness of the evaluations is averaged. The multiple evaluation is useful if the environment or the decoding from genotype to phenotype has randomness.

The fitness is also cached for later comparisons, if the genotype does not change.

Parameters:
envr  Environment to evaluate the fitness in.
force  Force re-evaluation of the fitness.

Definition at line 103 of file individual.cc.

References EAEnvironment::evals(), and EAEnvironment::evaluate().

Referenced by EAStrategy::evolve().

bool execute const GeneticMsg   msg const [inline]
 

Passthrough to the Genome of the Individual.

Definition at line 133 of file individual.h.

References Gentainer::execute().

Referenced by InterGene::execute().

const Map<String,Object>& features   const [inline]
 

Returns a reference to the phenotypic features of the Individual.

Definition at line 77 of file individual.h.

int getage   const [inline]
 

Returns the age of the individual; how many generations it has been an elite.

Definition at line 108 of file individual.h.

Referenced by print().

const Genstruct* getGene const GeneticID &    n const [inline]
 

Passthrough to the Genome of the Individual.

Definition at line 139 of file individual.h.

References Gentainer::getGene().

Referenced by FloatTestEAEnv::evaluateg(), and BinaryTestEAEnv::evaluateg().

int getkings   const [inline]
 

Passthrough to the Genome of the Individual.

Definition at line 145 of file individual.h.

References Genome::getkings().

void incarnate bool    init
 

Resets the individual to birth conditions; removes any phenotypic features.

Parameters:
init  Giving a TRUE value causes the genome of the individual to be initialized (randomized).

Definition at line 69 of file individual.cc.

References Gentainer::execute(), and Selector::read().

Referenced by Individual(), pointMutate(), and recombine().

void init   [inline]
 

Passthrough to the Genome of the Individual.

Definition at line 135 of file individual.h.

References Genome::init().

DataOStream & operator>> DataOStream &    out const [virtual]
 

Implementation for Object.

Verbose printout.

Definition at line 203 of file individual.cc.

const Object& operator[] const String &    key const [inline]
 

Returns a const phenotypic feature.

Definition at line 69 of file individual.h.

Object& operator[] const String &    key [inline]
 

Returns a phenotypic feature.

Definition at line 66 of file individual.h.

bool pointMutate const MutationRate   k
 

Passthrough to the Genome of the Individual.

Definition at line 157 of file individual.cc.

References incarnate(), and Gentainer::pointMutate().

void print TextOStream &    out const
 

Brief printout.

Definition at line 174 of file individual.cc.

References getage(), and Genome::print().

void recombine const Individual &    a,
const Individual &    b
 

Passthrough to the Genome of the Individual.

Definition at line 152 of file individual.cc.

References genome, incarnate(), and Gentainer::recombine().

void remove const String &    key [inline]
 

Remove a phenotypic feature.

Definition at line 63 of file individual.h.

const Selector& selector   const [inline]
 

Returns the selection handler of the Individual.

Definition at line 112 of file individual.h.

Referenced by SelectionMatrix::calculateMatrix().

void set const String &    key,
Object *    val
[inline]
 

Add or change a phenotypic feature.

Definition at line 58 of file individual.h.

void setSelector const SelectionPrms   templ
 

Sets the selector of the Individual using the given template.

This method is typically called by a Population or it's EAStrategy, and the template consists of global selection parameters.

Definition at line 223 of file individual.cc.


The documentation for this class was generated from the following files:
Generated on Thu Feb 10 20:12:01 2005 for NeHeP by doxygen1.2.18