Population::GaPopulationConfiguration Class Reference

This class stores parameters and genetic operations of a population or a group of populations. All populations bound to the configuration, are updated and notified every time when configuration is changed. Note that each population copies parameters' of the population and use local copy. More...

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

List of all members.

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 &parameters)
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 GaPopulationConfigurationGetDefault ()
 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.


Detailed Description

This class stores parameters and genetic operations of a population or a group of populations. All populations bound to the configuration, are updated and notified every time when configuration is changed. Note that each population copies parameters' of the population and use local copy.

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::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.

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.


Member Function Documentation

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.

Returns:
Method returns reference to default configuration.

void Population::GaPopulationConfiguration::BindPopulation ( GaPopulation population,
bool  refresh 
)

BindPopulation method binds population to this configuration.

This method is not thread-safe.

Parameters:
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.

Parameters:
population pointer to population which should be unbound.

const GaPopulationParameters& GACALL Population::GaPopulationConfiguration::GetParameters (  )  const [inline]

This method is not thread-safe.

Returns:

void Population::GaPopulationConfiguration::SetParameters ( const GaPopulationParameters parameters  ) 

Parameters:
parameters 

const GaSelectionPair& GACALL Population::GaPopulationConfiguration::Selection (  )  const [inline]

This method is not thread-safe.

Returns:
Method returns reference to object that holds pointer to selection operation which should be executed by the algorithm and its parameters.

const GaReplacementPair& GACALL Population::GaPopulationConfiguration::Replacement (  )  const [inline]

This method is not thread-safe.

Returns:
Method returns reference to object that holds pointer to replacement operation which should be executed by the algorithm and its parameters.

const GaScalingPair& GACALL Population::GaPopulationConfiguration::Scaling (  )  const [inline]

This method is not thread-safe.

Returns:
Method returns reference to object that holds pointer to scaling operation which should be executed by the algorithm and its parameters.

const GaCouplingPair& GACALL Population::GaPopulationConfiguration::Coupling (  )  const [inline]

This method is not thread-safe.

Returns:
Method returns reference to object that holds pointer to coupling operation which should be executed by the algorithm and its parameters.

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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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:
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:
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:
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:
parameters pointer to parameters of coupling operation.

const GaFitnessComparator* GACALL Population::GaPopulationConfiguration::GetSortComparator (  )  const [inline]

This method is not thread-safe.

Returns:
Method returns pointer to fitness comparator which is used for sorting chromosomes in population.

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.

Parameters:
comparator pointer to new fitness comparator.


Member Data Documentation

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 of populations which use this configuration.

Pointer to comparator used for sorting the chromosomes in population.


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

Genetic Algorithm Library
Coolsoft Software Development