MS-RCPSP
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
EvolutionaryAlgorithm::Mutator< T > Class Template Referenceabstract

Base class for mutation operators. More...

#include <Mutator.h>

Inheritance diagram for EvolutionaryAlgorithm::Mutator< T >:
Inheritance graph
[legend]

Public Member Functions

 Mutator (double _p_mut)
 
virtual T * mutate (T *sample) const =0
 
void force_mutate (T *sample) const
 

Protected Member Functions

virtual void mutate_gene (T *sample, int idx) const =0
 

Protected Attributes

double p_mut
 

Detailed Description

template<class T>
class EvolutionaryAlgorithm::Mutator< T >

Base class for mutation operators.

If you want to implement your own mutation operator, create a subclass of Mutator and implement Mutator::mutate and Mutator::mutate_gene functions.

Definition at line 19 of file Mutator.h.

Constructor & Destructor Documentation

template<class T >
EvolutionaryAlgorithm::Mutator< T >::Mutator ( double  _p_mut)
inline
Parameters
_p_mutMutation probability.

Definition at line 22 of file Mutator.h.

Member Function Documentation

template<class T >
void EvolutionaryAlgorithm::Mutator< T >::force_mutate ( T *  sample) const
inline

Mutates given sample without creating a new one. Used to force mutation in the specimen for clone removal.

Definition at line 31 of file Mutator.h.

template<class T >
virtual T* EvolutionaryAlgorithm::Mutator< T >::mutate ( T *  sample) const
pure virtual

Performs mutation on the given sample. Returns new sample instance.

Implemented in EvolutionaryAlgorithm::SimpleMutator< T >.

template<class T >
virtual void EvolutionaryAlgorithm::Mutator< T >::mutate_gene ( T *  sample,
int  idx 
) const
protectedpure virtual

Mutates single gene in the specimen.

Parameters
sampleSpecimen to operate on.
idxIndex of the gene to be mutated.

Member Data Documentation

template<class T >
double EvolutionaryAlgorithm::Mutator< T >::p_mut
protected

Mutation probability.

Definition at line 40 of file Mutator.h.


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