#include <D:/Temp/vs/gal/source/Population.h>
Public Member Functions | |
GaPopulationConfiguration () | |
This constructor initializes configuration by cloning default configuration. | |
GaPopulationConfiguration (const GaPopulationParameters &populationParams, const GaFitnessComparator *sortComparator, GaSelectionOperation *selectionOperation, GaSelectionParams *selectionParams, GaReplacementOperation *replacementOperation, GaReplacementParams *replacementParams, GaCouplingOperation *couplingOperation, GaCouplingParams *couplingParams, GaScalingOperation *scalingOperation, GaScalingParams *scalingParams) | |
This constructor initializes configuration with user defined operations and parameters. | |
GAL_API void GACALL | BindPopulation (GaPopulation *population, bool refresh) |
BindPopulation method binds population to this configuration. | |
void GACALL | UnbindPopulation (GaPopulation *population) |
UnbindPopulation method unbinds population from this configuration. | |
const GaPopulationParameters &GACALL | GetParameters () const |
This method is not thread-safe. | |
GAL_API void GACALL | SetParameters (const GaPopulationParameters ¶meters) |
const GaSelectionPair &GACALL | Selection () const |
This method is not thread-safe. | |
const GaReplacementPair &GACALL | Replacement () const |
This method is not thread-safe. | |
const GaScalingPair &GACALL | Scaling () const |
This method is not thread-safe. | |
const GaCouplingPair &GACALL | Coupling () const |
This method is not thread-safe. | |
void GACALL | SetOperation (GaSelectionOperation *operation, GaSelectionParams *parameters) |
This SetOperation method sets selection operation and its parameters which should be used by genetic algorithm. It makes copy of parameters object by using GaParameters::Clone method. The method also notifies all bound populations about the change. | |
void GACALL | SetOperation (GaReplacementOperation *operation, GaReplacementParams *parameters) |
This SetOperation method sets replacement operation and its parameters which should be used by genetic algorithm. It makes copy of parameters object by using GaParameters::Clone method. The method also notifies all bound populations about the change. | |
GAL_API void GACALL | SetOperation (GaScalingOperation *operation, GaScalingParams *parameters) |
This SetOperation method sets scaling operation and its parameters which should be used by genetic algorithm. It makes copy of parameters object by using GaParameters::Clone method. The method also notifies all bound populations about the change. | |
void GACALL | SetOperation (GaCouplingOperation *operation, GaCouplingParams *parameters) |
This SetOperation method sets coupling operation and its parameters which should be used by genetic algorithm. It makes copy of parameters object by using GaParameters::Clone method. The method also notifies all bound populations about the change. | |
void GACALL | SetOperationParams (GaSelectionParams *parameters) |
This SetOperationParams method sets parameters for selection operation. It makes copy of parameters object by using GaParameters::Clone method. The method also notifies all bound populations about the change. | |
void GACALL | SetOperationParams (GaReplacementParams *parameters) |
This SetOperationParams method sets parameters for replacement operation. It makes copy of parameters object by using GaParameters::Clone method. The method also notifies all bound populations about the change. | |
GAL_API void GACALL | SetOperationParams (GaScalingParams *parameters) |
This SetOperationParams method sets parameters for scaling operation. It makes copy of parameters object by using GaParameters::Clone method. The method also notifies all bound populations about the change. | |
void GACALL | SetOperationParams (GaCouplingParams *parameters) |
This SetOperationParams method sets parameters for coupling operation. It makes copy of parameters object by using GaParameters::Clone method. The method also notifies all bound populations about the change. | |
const GaFitnessComparator *GACALL | GetSortComparator () const |
This method is not thread-safe. | |
GAL_API void GACALL | SetSortComparator (const GaFitnessComparator *comparator) |
SetSortComaprator method sets fitness comparator which is used for sorting chromosomes. The method also notifies all bound populations about the change. | |
Static Public Member Functions | |
static GAL_API void GACALL | MakeDefault () |
MakeDefault method makes global instance of default configuration. | |
static void GACALL | FreeDefault () |
FreeDefault method frees global instance of default configuration. | |
static GaPopulationConfiguration & | GetDefault () |
This method is not thread-safe. | |
Private Attributes | |
GaSelectionPair | _selection |
Selection operation and its parameters. | |
GaReplacementPair | _replacement |
Replacement operation and its parameters. | |
GaScalingPair | _scaling |
Scaling operation and its parameters. | |
GaCouplingPair | _coupling |
Coupling operation and its parameters. | |
GaPopulationParameters | _parameters |
Population's parameters. | |
list< GaPopulation * > | _populations |
List of populations which use this configuration. | |
const GaFitnessComparator * | _sortingComparator |
Pointer to comparator used for sorting the chromosomes in population. | |
Static Private Attributes | |
static GaPopulationConfiguration * | _default = NULL |
Global instance of default configuration. |
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::GaPopulationConfiguration::GaPopulationConfiguration | ( | ) | [inline] |
This constructor initializes configuration by cloning default configuration.
Population::GaPopulationConfiguration::GaPopulationConfiguration | ( | const GaPopulationParameters & | populationParams, | |
const GaFitnessComparator * | sortComparator, | |||
GaSelectionOperation * | selectionOperation, | |||
GaSelectionParams * | selectionParams, | |||
GaReplacementOperation * | replacementOperation, | |||
GaReplacementParams * | replacementParams, | |||
GaCouplingOperation * | couplingOperation, | |||
GaCouplingParams * | couplingParams, | |||
GaScalingOperation * | scalingOperation, | |||
GaScalingParams * | scalingParams | |||
) | [inline] |
This constructor initializes configuration with user defined operations and parameters.
populationParams | reference to populations' parameters. It makes copy of parameters object by using GaParameters::Clone method. | |
sortComparator | ||
selectionOperation | pointer to selection operation. | |
selectionParams | pointer to parameters of selection operation. | |
replacementOperation | pointer to replacement operation. | |
replacementParams | pointer to parameters of replacement operation. | |
couplingOperation | pointer to coupling operation. | |
couplingParams | pointer to parameters of coupling operation. | |
scalingOperation | pointer to scaling operation. | |
scalingParams | pointer to parameters of scaling operation. |
void Population::GaPopulationConfiguration::MakeDefault | ( | ) | [static] |
MakeDefault
method makes global instance of default configuration.
This method is not thread-safe.
static void GACALL Population::GaPopulationConfiguration::FreeDefault | ( | ) | [inline, static] |
FreeDefault
method frees global instance of default configuration.
This method is not thread-safe.
static GaPopulationConfiguration& Population::GaPopulationConfiguration::GetDefault | ( | ) | [inline, static] |
This method is not thread-safe.
void Population::GaPopulationConfiguration::BindPopulation | ( | GaPopulation * | population, | |
bool | refresh | |||
) |
BindPopulation
method binds population to this configuration.
This method is not thread-safe.
population | pointer to population which should be bound. | |
refresh | this parameter should be set to true if population should be notified about change and refreshed according to new parameters. |
void GACALL Population::GaPopulationConfiguration::UnbindPopulation | ( | GaPopulation * | population | ) | [inline] |
UnbindPopulation
method unbinds population from this configuration.
This method is not thread-safe.
population | pointer to population which should be unbound. |
const GaPopulationParameters& GACALL Population::GaPopulationConfiguration::GetParameters | ( | ) | const [inline] |
This method is not thread-safe.
void Population::GaPopulationConfiguration::SetParameters | ( | const GaPopulationParameters & | parameters | ) |
parameters |
const GaSelectionPair& GACALL Population::GaPopulationConfiguration::Selection | ( | ) | const [inline] |
This method is not thread-safe.
const GaReplacementPair& GACALL Population::GaPopulationConfiguration::Replacement | ( | ) | const [inline] |
This method is not thread-safe.
const GaScalingPair& GACALL Population::GaPopulationConfiguration::Scaling | ( | ) | const [inline] |
This method is not thread-safe.
const GaCouplingPair& GACALL Population::GaPopulationConfiguration::Coupling | ( | ) | const [inline] |
This method is not thread-safe.
void GACALL Population::GaPopulationConfiguration::SetOperation | ( | GaSelectionOperation * | operation, | |
GaSelectionParams * | parameters | |||
) | [inline] |
This SetOperation
method sets selection operation and its parameters which should be used by genetic algorithm. It makes copy of parameters object by using GaParameters::Clone
method. The method also notifies all bound populations about the change.
This method is not thread safe.
operation | pointer to new selection operation. | |
parameters | pointer to parameters of selection operation. |
void GACALL Population::GaPopulationConfiguration::SetOperation | ( | GaReplacementOperation * | operation, | |
GaReplacementParams * | parameters | |||
) | [inline] |
This SetOperation
method sets replacement operation and its parameters which should be used by genetic algorithm. It makes copy of parameters object by using GaParameters::Clone
method. The method also notifies all bound populations about the change.
This method is not thread safe.
operation | pointer to new replacement operation. | |
parameters | pointer to parameters of replacement operation. |
void Population::GaPopulationConfiguration::SetOperation | ( | GaScalingOperation * | operation, | |
GaScalingParams * | parameters | |||
) |
This SetOperation
method sets scaling operation and its parameters which should be used by genetic algorithm. It makes copy of parameters object by using GaParameters::Clone
method. The method also notifies all bound populations about the change.
This method is not thread safe.
operation | pointer to new scaling operation. | |
parameters | pointer to parameters of scaling operation. |
void GACALL Population::GaPopulationConfiguration::SetOperation | ( | GaCouplingOperation * | operation, | |
GaCouplingParams * | parameters | |||
) | [inline] |
This SetOperation
method sets coupling operation and its parameters which should be used by genetic algorithm. It makes copy of parameters object by using GaParameters::Clone
method. The method also notifies all bound populations about the change.
This method is not thread safe.
operation | pointer to new coupling operation. | |
parameters | pointer to parameters of coupling operation. |
void GACALL Population::GaPopulationConfiguration::SetOperationParams | ( | GaSelectionParams * | parameters | ) | [inline] |
This SetOperationParams
method sets parameters for selection operation. It makes copy of parameters object by using GaParameters::Clone
method. The method also notifies all bound populations about the change.
This method is not thread safe.
parameters | pointer to parameters of selection operation. |
void GACALL Population::GaPopulationConfiguration::SetOperationParams | ( | GaReplacementParams * | parameters | ) | [inline] |
This SetOperationParams
method sets parameters for replacement operation. It makes copy of parameters object by using GaParameters::Clone
method. The method also notifies all bound populations about the change.
This method is not thread safe.
parameters | pointer to parameters of replacement operation. |
void Population::GaPopulationConfiguration::SetOperationParams | ( | GaScalingParams * | parameters | ) |
This SetOperationParams
method sets parameters for scaling operation. It makes copy of parameters object by using GaParameters::Clone
method. The method also notifies all bound populations about the change.
This method is not thread safe.
parameters | pointer to parameters of scaling operation. |
void GACALL Population::GaPopulationConfiguration::SetOperationParams | ( | GaCouplingParams * | parameters | ) | [inline] |
This SetOperationParams
method sets parameters for coupling operation. It makes copy of parameters object by using GaParameters::Clone
method. The method also notifies all bound populations about the change.
This method is not thread safe.
parameters | pointer to parameters of coupling operation. |
const GaFitnessComparator* GACALL Population::GaPopulationConfiguration::GetSortComparator | ( | ) | const [inline] |
This method is not thread-safe.
void Population::GaPopulationConfiguration::SetSortComparator | ( | const GaFitnessComparator * | comparator | ) |
SetSortComaprator
method sets fitness comparator which is used for sorting chromosomes. The method also notifies all bound populations about the change.
comparator | pointer to new fitness comparator. |
GaPopulationConfiguration * Population::GaPopulationConfiguration::_default = NULL [static, private] |
Global instance of default configuration.
Selection operation and its parameters.
Replacement operation and its parameters.
Scaling operation and its parameters.
Coupling operation and its parameters.
Population's parameters.
list<GaPopulation*> Population::GaPopulationConfiguration::_populations [private] |
List of populations which use this configuration.
Pointer to comparator used for sorting the chromosomes in population.