Algorithm::GaMultithreadingAlgorithmParams Class Reference

This class should be used (directly or by inheritance) by genetic algorithms which use multiple threads for parallel execution of work. More...

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

Inherits Algorithm::GaAlgorithmParams.

Inherited by Algorithm::SimpleAlgorithms::GaSimpleAlgorithmParams.

List of all members.

Public Member Functions

 GaMultithreadingAlgorithmParams (int numberOfWorkers)
 This constructor initializes parameters for user-defined number of working threads.
 GaMultithreadingAlgorithmParams ()
 Default number of working threads is 1.
virtual GaParameters *GACALL Clone () const
 More details are given in specification of GaParameters::Clone method.
int GACALL GetNumberOfWorkers () const
 This method is not thread-safe.
void GACALL SetNumberOfWorkers (int workers)
 SetNumberOfWorkers method sets number of working threads which should be used by genetic algorithm.

Private Attributes

int _numberOfWorkers
 Number of working threads which should be used by genetic algorithm.


Detailed Description

This class should be used (directly or by inheritance) by genetic algorithms which use multiple threads for parallel execution of work.

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

Algorithm::GaMultithreadingAlgorithmParams::GaMultithreadingAlgorithmParams ( int  numberOfWorkers  )  [inline]

This constructor initializes parameters for user-defined number of working threads.

Parameters:
numberOfWorkers number of working threads.

Algorithm::GaMultithreadingAlgorithmParams::GaMultithreadingAlgorithmParams (  )  [inline]

Default number of working threads is 1.


Member Function Documentation

virtual GaParameters* GACALL Algorithm::GaMultithreadingAlgorithmParams::Clone (  )  const [inline, virtual]

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

This method is not thread-safe.

Implements Common::GaParameters.

Reimplemented in Algorithm::SimpleAlgorithms::GaSimpleAlgorithmParams.

int GACALL Algorithm::GaMultithreadingAlgorithmParams::GetNumberOfWorkers (  )  const [inline]

This method is not thread-safe.

Returns:
Method returns number of working threads should be used by algorithm.

void GACALL Algorithm::GaMultithreadingAlgorithmParams::SetNumberOfWorkers ( int  workers  )  [inline]

SetNumberOfWorkers method sets number of working threads which should be used by genetic algorithm.

This method is not thread-safe.

Parameters:
workers number of working threads.


Member Data Documentation

Number of working threads which should be used by genetic algorithm.


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

Genetic Algorithm Library
Coolsoft Software Development