GLBaseMutator Class Reference

#include <GLBaseMutator.h>

Inheritance diagram for GLBaseMutator:

GLMutatorCombined GLMutatorGeneMove GLMutatorGenesSwapping GLMutatorShuffling

List of all members.

Public Member Functions

 GLBaseMutator (double mutation_rate=0.5, bool check_range=false)
 GLBaseMutator (const GLBaseMutator &mutator)
virtual ~GLBaseMutator ()
virtual GLBaseMutatorcopy () const =0
double getMutationRate () const
virtual bool mutateOrganism (GLBaseOrganism *organism)=0
virtual void reset ()
void setMutationRate (double mutation_rate, bool checkRange=false)


Detailed Description

Abstract base class for all the mutators in GenLib.

Definition at line 9 of file GLBaseMutator.h.


Constructor & Destructor Documentation

GLBaseMutator::GLBaseMutator ( double  mutation_rate = 0.5,
bool  check_range = false 
) [inline]

Creates the base mutator.

Parameters:
mutation_rate rate of the mutation, interpretation is upto concrete implementation of the mutator. Normally one would expect to keep it in (0; 1] interval.
check_range if true, check is made that mutation rate is > 0 and < 1.

Definition at line 20 of file GLBaseMutator.h.

GLBaseMutator::GLBaseMutator ( const GLBaseMutator mutator  ) 

Copying constructor.

Parameters:
mutator source for copying.
Copying constructor.
Parameters:
mutator source to copy from.

Definition at line 9 of file GLBaseMutator.cpp.

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

Destructor, destroys everything.

Definition at line 33 of file GLBaseMutator.h.


Member Function Documentation

virtual GLBaseMutator* GLBaseMutator::copy (  )  const [pure virtual]

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

Returns:
copy of the current exemplar of the mutator.

Implemented in GLMutatorCombined, GLMutatorGeneMove, GLMutatorGenesSwapping, and GLMutatorShuffling.

double GLBaseMutator::getMutationRate (  )  const [inline]

Returns the mutation rate. Its interpretation depends on concrete implementation of the mutator.

Returns:
the mutatio rate.

Definition at line 47 of file GLBaseMutator.h.

virtual bool GLBaseMutator::mutateOrganism ( GLBaseOrganism organism  )  [pure virtual]

Performs the mutation on the organism. If passed organism was changed (mutated) returns true, otherwise returns false.

Parameters:
organism organism to be mutated.
Returns:
true if organism was mutated and false otherwise.

Implemented in GLMutatorCombined, GLMutatorGeneMove, GLMutatorGenesSwapping, and GLMutatorShuffling.

void GLBaseMutator::reset (  )  [virtual]

Resets the mutator (e.g. sets counter, if any, to zero etc.).

Definition at line 18 of file GLBaseMutator.cpp.

void GLBaseMutator::setMutationRate ( double  mutation_rate,
bool  check_range = false 
)

Sets the new mutation rate for the mutator.

Parameters:
mutation_rate rate of the mutation, interpretation is upto concrete implementation of the mutator. Normally one would expect to keep it in (0; 1) interval.
checkRange if true, check is made that mutation rate is > 0 and < 1.
Sets the new mutation rate for the mutator.
Parameters:
mutation_rate rate of the mutation, interpretation is upto concrete implementation of the mutator. Normally one would expect to keep it in (0; 1] interval.
check_range if true, check is made that mutation rate is > 0 and < 1.

Definition at line 31 of file GLBaseMutator.cpp.


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

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