Population::GaSelectionResultSet Class Reference

This class is used as storage for selection operation (result set). It uses sorted group to store indices of selected chromosomes. More...

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

List of all members.

Public Member Functions

GAL_API GaSelectionResultSet (int selectionSize, const GaPopulation *population)
 This constructor initializes sorted group of result set which stores selected chromosomes.
 ~GaSelectionResultSet ()
 Destructor frees memory used by sorted group which stores selected chromosomes.
GaSortedGroup &GACALL SelectedGroup () const
 This method is not thread-safe.
GaChromosomePtr GACALL GetAt (int pos) const
 GetAt method returns smart pointer to chromosomes at given position in result set.
GaChromosomePtr GACALL operator[] (int pos) const
 operator [] returns smart pointer to chromosomes at given position in result set.

Protected Attributes

GaSortedGroup_selectedGroup
 Pointer to sorted group which contains indices of selected chromosomes.


Detailed Description

This class is used as storage for selection operation (result set). It uses sorted group to store indices of selected chromosomes.

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::GaSelectionResultSet::GaSelectionResultSet ( int  selectionSize,
const GaPopulation population 
)

This constructor initializes sorted group of result set which stores selected chromosomes.

Parameters:
selectionSize number of chromosomes which can be stored by sorted group.
population pointer to population on which selection is performed.

Population::GaSelectionResultSet::~GaSelectionResultSet (  )  [inline]

Destructor frees memory used by sorted group which stores selected chromosomes.


Member Function Documentation

GaSortedGroup& GACALL Population::GaSelectionResultSet::SelectedGroup (  )  const [inline]

This method is not thread-safe.

Returns:
Method returns reference to sorted group which stores selected chromosomes.

GaChromosomePtr GACALL Population::GaSelectionResultSet::GetAt ( int  pos  )  const [inline]

GetAt method returns smart pointer to chromosomes at given position in result set.

This method is not thread safe.

Parameters:
pos position of chromosomes in result set.
Returns:
Method returns smart pointer to chromosome at given position in set.

GaChromosomePtr GACALL Population::GaSelectionResultSet::operator[] ( int  pos  )  const [inline]

operator [] returns smart pointer to chromosomes at given position in result set.

This operator is not thread safe.

Parameters:
pos position of chromosomes in result set.
Returns:
Operator returns smart pointer to chromosome at given position in set.


Member Data Documentation

Pointer to sorted group which contains indices of selected chromosomes.


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

Genetic Algorithm Library
Coolsoft Software Development