Chromosome::GaChromosomeParams Class Reference

This class is base class for all chromosomes' parameters. Built-in genetic operations (crossover, mutation, fitness function and comparator) share their parameters with chromosomes parameters. More...

#include <D:/Temp/vs/gal/source/Chromosome.h>

Inherits Common::GaParameters.

Inherited by Chromosome::Representation::GaBinaryChromosomeParams.

List of all members.

Public Member Functions

 GaChromosomeParams (float mutationProbability, int mutationSize, bool improvingOnlyMutations, float crossoverProbability, int numberOfCrossoverPoints)
 This constructor initializes parameters with user-defined values.
 GaChromosomeParams ()
 This constructor initializes parameters with default values.
1. mutation probability: 3%
2. mutation size: 1 (only one value is mutated)
3. only improving mutations are accepted: yes
4. crossover probability: 80%
5. number of crossover points: 1.
virtual GaParameters *GACALL Clone () const
 More details are given in specification of GaParameters::Clone method.
void GACALL SetMutationProbability (float probability)
 SetMutationProbability method sets probability of mutation operation being performed during coupling of selected parents.
float GACALL GetMutationProbability () const
 This method is not thread-safe.
void GACALL SetMutationSize (int size)
 SetMutationSize method sets maximal number of affected values in chromosome's code by mutation operation.
int GetMutationSize () const
 This method is not thread-safe.
void GACALL SetImprovingMutationsFlag (bool improvingOnly)
 SetImprovingMutationsFlag method sets improving-mutation flag.
bool GACALL GetImprovingMutationsFlag () const
 This method is not thread-safe.
void GACALL SetCrossoverProbability (float probability)
 SetCrossoverProbability method sets probability of crossover operation being performed during coupling of selected parents.
float GACALL GetCrossoverProbability () const
 This method is not thread-safe.
void GACALL SetNumberOfCrossoverPoints (int numberOfPoints)
 SetNumberOfCrossoverPoints method sets number of crossover points.
int GACALL GetNumberOfCrossoverPoints () const
 This method is not thread-safe.

Protected Attributes

float _mutationProbability
 Mutation probability in interval (0, 1) of mutation operation being performed during coupling of selected parents.
int _mutationSize
 Maximal number of affected values in chromosome�s code by mutation operation.
bool _improvingOnlyMutations
 This flag if set, instructs that only mutations which lead to improvement of fitness value should be accepted. If it isn't set, then all mutation should be accepted.
float _crossoverProbability
 probability in interval (0, 1) of crossover operation being performed during coupling of selected parents.
int _numberOfCrossoverPoints
 Number of crossover points between two parents when crossover operation is performed.


Detailed Description

This class is base class for all chromosomes' parameters. Built-in genetic operations (crossover, mutation, fitness function and comparator) share their parameters with chromosomes parameters.

This class has no built-in synchronizator, so LOCK_OBJECT and LOCK_THIS_OBJECT macros cannot be used with instances of this class. No public or private methods are thread-safe.


Constructor & Destructor Documentation

Chromosome::GaChromosomeParams::GaChromosomeParams ( float  mutationProbability,
int  mutationSize,
bool  improvingOnlyMutations,
float  crossoverProbability,
int  numberOfCrossoverPoints 
) [inline]

This constructor initializes parameters with user-defined values.

Parameters:
mutationProbability mutation probability in interval (0, 1).
mutationSize maximal number of affected values in chromosome's code by mutation operation.
improvingOnlyMutations state of improving only mutation flag.
crossoverProbability crossover probability in interval (0, 1).
numberOfCrossoverPoints number of crossover points.

Chromosome::GaChromosomeParams::GaChromosomeParams (  )  [inline]

This constructor initializes parameters with default values.
1. mutation probability: 3%
2. mutation size: 1 (only one value is mutated)
3. only improving mutations are accepted: yes
4. crossover probability: 80%
5. number of crossover points: 1.


Member Function Documentation

virtual GaParameters* GACALL Chromosome::GaChromosomeParams::Clone (  )  const [inline, virtual]

More details are given in specification of GaParameters::Clone method.

This method is not thread-safe.

Implements Common::GaParameters.

void GACALL Chromosome::GaChromosomeParams::SetMutationProbability ( float  probability  )  [inline]

SetMutationProbability method sets probability of mutation operation being performed during coupling of selected parents.

This method is not thread-safe.

Parameters:
probability new probability of mutation operation. Value is in interval (0, 1).

float GACALL Chromosome::GaChromosomeParams::GetMutationProbability (  )  const [inline]

This method is not thread-safe.

Returns:
Method returns probability of mutation operation being performed during coupling of selected parents.

void GACALL Chromosome::GaChromosomeParams::SetMutationSize ( int  size  )  [inline]

SetMutationSize method sets maximal number of affected values in chromosome's code by mutation operation.

This method is not thread-safe.

Parameters:
size maximal number of affected values in chromosome's code.

int Chromosome::GaChromosomeParams::GetMutationSize (  )  const [inline]

This method is not thread-safe.

Returns:
Method returns maximal number of affected values in chromosome's code by mutation operation.

void GACALL Chromosome::GaChromosomeParams::SetImprovingMutationsFlag ( bool  improvingOnly  )  [inline]

SetImprovingMutationsFlag method sets improving-mutation flag.

This method is not thread-safe.

Parameters:
improvingOnly if this parameter is set to true, then only the mutations which lead to improvement of fitness value should be accepted. If this parameter is set to false, all mutations are accepted.

bool GACALL Chromosome::GaChromosomeParams::GetImprovingMutationsFlag (  )  const [inline]

This method is not thread-safe.

Returns:
Method returns true if only the mutations which lead to improvement of fitness value should be accepted. If all mutation should be accepted, then this method return false.

void GACALL Chromosome::GaChromosomeParams::SetCrossoverProbability ( float  probability  )  [inline]

SetCrossoverProbability method sets probability of crossover operation being performed during coupling of selected parents.

This method is not thread-safe.

Parameters:
probability new probability of crossover operation. Value is in interval (0, 1).

float GACALL Chromosome::GaChromosomeParams::GetCrossoverProbability (  )  const [inline]

This method is not thread-safe.

Returns:
Method returns probability of crossover operation being performed during coupling of selected parents.

void GACALL Chromosome::GaChromosomeParams::SetNumberOfCrossoverPoints ( int  numberOfPoints  )  [inline]

SetNumberOfCrossoverPoints method sets number of crossover points.

This method is not thread-safe.

Parameters:
numberOfPoints new number of crossover points.

int GACALL Chromosome::GaChromosomeParams::GetNumberOfCrossoverPoints (  )  const [inline]

This method is not thread-safe.

Returns:
Method returns number of crossover points.


Member Data Documentation

Mutation probability in interval (0, 1) of mutation operation being performed during coupling of selected parents.

Maximal number of affected values in chromosome�s code by mutation operation.

This flag if set, instructs that only mutations which lead to improvement of fitness value should be accepted. If it isn't set, then all mutation should be accepted.

probability in interval (0, 1) of crossover operation being performed during coupling of selected parents.

Number of crossover points between two parents when crossover operation is performed.


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

Genetic Algorithm Library
Coolsoft Software Development