GPLIB++
Main Page
Modules
Namespaces
Classes
Files
File List
File Members
GAClasses
GeneralSelect.h
Go to the documentation of this file.
1
#ifndef CGENERALSELECT_H
2
#define CGENERALSELECT_H
3
#include "
gentypes.h
"
4
namespace
gplib
5
{
6
/** \addtogroup gainv Genetic algorithm optimization */
7
/* @{ */
8
9
//!GeneralSelect is the abstract base class for any selection mechanism in genetic algorithms
10
/*!GeneralSelect defines to abstract functions: Init and GetOne. Init has to be called once per iteration
11
* and sets all the necessary parameters depending on probabilities and crowding distance
12
* GetOne then returns the index of a selected population member and is called every time a population
13
* member has to be selected by a selection operator.
14
* There is no default implementation ! */
15
16
class
GeneralSelect
17
{
18
private
:
19
bool
initialized;
20
//! The abstract definition of the Init function, has to overriden
21
virtual
void
DoInit()= 0;
22
//! The abstract definition of GetOne, has to be overriden
23
virtual
size_t
DoGetOne()=0;
24
public
:
25
void
Init
()
26
{
27
DoInit();
28
initialized =
true
;
29
}
30
size_t
GetOne
();
31
GeneralSelect
();
32
virtual
~GeneralSelect
();
33
};
34
/* @} */
35
}
36
#endif // CGENERALSELECT_H
gplib::GeneralSelect
GeneralSelect is the abstract base class for any selection mechanism in genetic algorithms.
Definition:
GeneralSelect.h:16
gplib::GeneralSelect::~GeneralSelect
virtual ~GeneralSelect()
Definition:
GeneralSelect.cpp:11
gplib::GeneralSelect::GeneralSelect
GeneralSelect()
Definition:
GeneralSelect.cpp:6
gplib::GeneralSelect::Init
void Init()
Definition:
GeneralSelect.h:25
gplib::GeneralSelect::GetOne
size_t GetOne()
Definition:
GeneralSelect.cpp:15
gentypes.h
Generated on Wed May 25 2016 14:21:06 for GPLIB++ by
1.8.6