Population::SelectionOperations::GaSelectDuplicatesParams Class Reference

This class should be used (directly or by inheritance) by selection operations which can control duplicates of chromosome in result set. More...

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

Inherits Population::GaSelectionParams.

Inherited by Population::SelectionOperations::GaSelectRandomBestParams, and Population::SelectionOperations::GaSelectTournamentParams.

List of all members.

Public Member Functions

 GaSelectDuplicatesParams (bool duplicates, int selectionSize)
 This constructor initializes parameters with user defined values.
 GaSelectDuplicatesParams ()
 This constructor initializes parameters with default values. Duplicates are not allowed, and selection size is 2.
virtual GaParameters *GACALL Clone () const
 More details are given in specification of GaParameters::Clone method.
bool GACALL GetDuplicates () const
 This method is not thread-safe.
void GACALL SetDuplicates (bool duplicates)
 SetDuplicates method sets acceptance of duplicates of chromosomes in selection result set.

Private Attributes

bool _duplicates
 Indicates if duplicates of same chromosome are allowed in selection result set.


Detailed Description

This class should be used (directly or by inheritance) by selection operations which can control duplicates of chromosome in result set.

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

Population::SelectionOperations::GaSelectDuplicatesParams::GaSelectDuplicatesParams ( bool  duplicates,
int  selectionSize 
) [inline]

This constructor initializes parameters with user defined values.

Parameters:
duplicates if this parameter is set to true, duplicates of same chromosome in result set are allowed. If it is set to false duplicates are not allowed.
selectionSize number of chromosomes which should be selected.

Population::SelectionOperations::GaSelectDuplicatesParams::GaSelectDuplicatesParams (  )  [inline]

This constructor initializes parameters with default values. Duplicates are not allowed, and selection size is 2.


Member Function Documentation

virtual GaParameters* GACALL Population::SelectionOperations::GaSelectDuplicatesParams::Clone (  )  const [inline, virtual]

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

This method is not thread-safe.

Reimplemented from Population::GaSelectionParams.

Reimplemented in Population::SelectionOperations::GaSelectRandomBestParams, and Population::SelectionOperations::GaSelectTournamentParams.

bool GACALL Population::SelectionOperations::GaSelectDuplicatesParams::GetDuplicates (  )  const [inline]

This method is not thread-safe.

Returns:
Method returns true if duplicates of same chromosome in result set are allowed, otherwise it returns false.

void GACALL Population::SelectionOperations::GaSelectDuplicatesParams::SetDuplicates ( bool  duplicates  )  [inline]

SetDuplicates method sets acceptance of duplicates of chromosomes in selection result set.

This method is not thread-safe.

Parameters:
duplicates if this parameter is set to true, duplicates of same chromosome in result set are allowed. If it is set to false duplicates are not allowed.


Member Data Documentation

Indicates if duplicates of same chromosome are allowed in selection result set.


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

Genetic Algorithm Library
Coolsoft Software Development