Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

prapi::ga::Mutator< T > Class Template Reference

#include <GeneticEngine.h>

List of all members.

Detailed Description

template<class T = double>
class prapi::ga::Mutator< T >

Mutator is responsible for making mutations in a population.

Public Methods

 Mutator (double probability=0.02)
 Create a new mutator with the given mutation probability.

virtual void mutate (util::List< Individual< T > > &population)
 Make random mutations to a population.

virtual T mutate (T value)
 Mutate a single "synthetic base pair".

Public Attributes

double mutationProbability
 A value in the range [0,1] indicating the probability for a gene to change when mutating a population.

Member Function Documentation

template<class T = double>
virtual T prapi::ga::Mutator< T >::mutate   value [inline, virtual]

Mutate a single "synthetic base pair".

The default implementation returns T(drand48()).

value  the old value of a gene slot
new, mutated value for the gene slot

template<class T>
void prapi::ga::Mutator< T >::mutate util::List< Individual< T > > &    population [virtual]

Make random mutations to a population.

The default implementation loops through all individuals in a population and randomly mutates some genes in each.

The documentation for this class was generated from the following file:
Documentation generated on 11.09.2003 with Doxygen.
The documentation is copyrighted material.
Copyright © Topi Mäenpää 2003. All rights reserved.