GaSelectRandom selection is randomly selects defined number of chromosomes. This selection use GaSelectDuplicatesParams class for parameters.
More...
#include <source/SelectionOperations.h>
Inherits Population::GaSelectionOperation.
Inherited by Population::SelectionOperations::GaSelectRandomBest.
Public Member Functions | |
| virtual GAL_API void GACALL | operator() (const GaPopulation &population, const GaSelectionParams ¶meters, GaSelectionResultSet &result) const |
| More details are given in specification of GaSelectionOperation::operator () method. | |
| virtual GaParameters *GACALL | MakeParameters () const |
| More details are given in specification of GaOperation::MakeParameters method. | |
| virtual bool GACALL | CheckParameters (const GaParameters ¶meters) const |
| Valid parameters must have selection size grater then 0. | |
Protected Member Functions | |
| virtual GAL_API void GACALL | Select (GaSelectionResultSet &results, const GaPopulation &population, const GaSelectionParams ¶meters) const |
Select method randomly selects only one chromosome. | |
GaSelectRandom selection is randomly selects defined number of chromosomes. This selection use GaSelectDuplicatesParams class for parameters.
This class has no built-in synchronizator, so LOCK_OBJECT and LOCK_THIS_OBJECT macros cannot be used with instances of this class. Because this genetic operation is stateless all public method are thread-safe.
| void Population::SelectionOperations::GaSelectRandom::operator() | ( | const GaPopulation & | population, | |
| const GaSelectionParams & | parameters, | |||
| GaSelectionResultSet & | result | |||
| ) | const [virtual] |
More details are given in specification of GaSelectionOperation::operator () method.
This method is thread-safe.
Implements Population::GaSelectionOperation.
Reimplemented in Population::SelectionOperations::GaSelectRandomBest.
| virtual GaParameters* GACALL Population::SelectionOperations::GaSelectRandom::MakeParameters | ( | ) | const [inline, virtual] |
More details are given in specification of GaOperation::MakeParameters method.
This method is thread-safe.
Implements Common::GaOperation.
Reimplemented in Population::SelectionOperations::GaSelectRandomBest.
| virtual bool GACALL Population::SelectionOperations::GaSelectRandom::CheckParameters | ( | const GaParameters & | parameters | ) | const [inline, virtual] |
Valid parameters must have selection size grater then 0.
More details are given in specification of GaOperation::CheckParameters method.
This method is thread-safe.
Implements Common::GaOperation.
Reimplemented in Population::SelectionOperations::GaSelectRandomBest.
| void Population::SelectionOperations::GaSelectRandom::Select | ( | GaSelectionResultSet & | results, | |
| const GaPopulation & | population, | |||
| const GaSelectionParams & | parameters | |||
| ) | const [protected, virtual] |
Select method randomly selects only one chromosome.
This method is not thread-safe.
| results | reference to selection result set which is used to store selected chromosome. | |
| population | reference to population on which selection is performed. | |
| parameters | reference to parameters of population. |