#include <source/SelectionOperations.h>
Inherits Population::GaSelectionParams.
Inherited by Population::SelectionOperations::GaSelectRandomBestParams, and Population::SelectionOperations::GaSelectTournamentParams.
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. | |
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.
| Population::SelectionOperations::GaSelectDuplicatesParams::GaSelectDuplicatesParams | ( | bool | duplicates, | |
| int | selectionSize | |||
| ) | [inline] |
This constructor initializes parameters with user defined values.
| 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.
| 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.
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.
| 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. |
Indicates if duplicates of same chromosome are allowed in selection result set.