Replacement procedure which compares the individuals of the current population with the offspring individuals. For each individual i, the offspring and the parent at the ith position are compared and the fittest survives.
More...
#include <FirstImprove.h>
|
vector< S > | replace (vector< S > &vector1, vector< S > &vector2) override |
| First Improve replacement logic. Loops both vector of individuals doing pairwise comparisons for each ith individual in both vectors. The final population contains the best individuals at each ith position. More...
|
|
vector< S > | replace (vector< S > &vector1, const S &solution, const int &position) override |
| Not implemented for this replacement. More...
|
|
string | getName () const override |
|
template<class S>
class FirstImprove< S >
Replacement procedure which compares the individuals of the current population with the offspring individuals. For each individual i, the offspring and the parent at the ith position are compared and the fittest survives.
- Template Parameters
-
◆ replace() [1/2]
template<class S >
vector< S > FirstImprove< S >::replace |
( |
vector< S > & |
vector1, |
|
|
const S & |
solution, |
|
|
const int & |
position |
|
) |
| |
|
overridevirtual |
Not implemented for this replacement.
- Template Parameters
-
- Parameters
-
vector1 | |
solution | |
position | |
- Returns
- vector
Implements Replacement< S >.
◆ replace() [2/2]
template<class S >
vector< S > FirstImprove< S >::replace |
( |
vector< S > & |
population, |
|
|
vector< S > & |
offspring |
|
) |
| |
|
overridevirtual |
First Improve replacement logic. Loops both vector of individuals doing pairwise comparisons for each ith individual in both vectors. The final population contains the best individuals at each ith position.
- Template Parameters
-
- Parameters
-
- Returns
Implements Replacement< S >.
The documentation for this class was generated from the following file: