GLMutatorGenesSwapping Class Reference

#include <GLMutatorGenesSwapping.h>

Inheritance diagram for GLMutatorGenesSwapping:

GLBaseMutator

List of all members.

Public Member Functions

 GLMutatorGenesSwapping (double mutationRate=0.5)
 GLMutatorGenesSwapping (const GLMutatorGenesSwapping &source)
virtual ~GLMutatorGenesSwapping ()
virtual GLBaseMutatorcopy () const
virtual bool mutateOrganism (GLBaseOrganism *organism)


Detailed Description

Class, which performs mutation based on the swapping pair of genes. Requires, that class which is passed to it was implementing ExchangableGenesInterface.

Definition at line 11 of file GLMutatorGenesSwapping.h.


Constructor & Destructor Documentation

GLMutatorGenesSwapping::GLMutatorGenesSwapping ( double  mutationRate = 0.5  )  [inline]

Simple constructor.

Parameters:
mutationRate probability that 2 gene will be swapped. Should be in (0; 1) interval.

Definition at line 19 of file GLMutatorGenesSwapping.h.

GLMutatorGenesSwapping::GLMutatorGenesSwapping ( const GLMutatorGenesSwapping source  )  [inline]

Copying constructor.

Parameters:
source where the data should be copied from.

Definition at line 26 of file GLMutatorGenesSwapping.h.

virtual GLMutatorGenesSwapping::~GLMutatorGenesSwapping (  )  [inline, virtual]

Destructor, destroys everything.

Definition at line 32 of file GLMutatorGenesSwapping.h.


Member Function Documentation

virtual GLBaseMutator* GLMutatorGenesSwapping::copy (  )  const [inline, virtual]

Creates copy of the current exemplar of the mutator. Should be overloaded in childrens.

Returns:
copy of the current exemplar of the mutator.

Implements GLBaseMutator.

Definition at line 39 of file GLMutatorGenesSwapping.h.

bool GLMutatorGenesSwapping::mutateOrganism ( GLBaseOrganism organism  )  [virtual]

Mutator. Passed pointer should point to the class implementing GLExchengableGenesInterface. Randomly chooses 2 genes and swap them.

Parameters:
organism pointer to the organism to be mutated.
Returns:
true if organism was mutated and false otherwise.
Mutator. Passed pointer should point to the class implementing GLExchengableGenesInterface. Randomly chooses 2 genes and swap them.
Parameters:
organism pointer to the organism to be mutated.
mutation_probability probability of the organism to be mutated.
Returns:
true if organism was mutated and false otherwise.

Implements GLBaseMutator.

Definition at line 19 of file GLMutatorGenesSwapping.cpp.


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

Generated on Sat Jun 13 13:58:10 2009 for GenLib by  doxygen 1.5.9