Function PGAPairwiseBestReplacement
Defined in File pop.c
Function Documentation
-
void PGAPairwiseBestReplacement(PGAContext *ctx)
Perform pairwise best replacement.
Description
Compare individuals with same index in
PGA_OLDPOP
andPGA_NEWPOP
and select the one with better evalutation. Note that we may not use the fitness here: Fitness from two different populations are uncompareable! This replacement strategy is used in evolutionary algorithms that modify a single individual and replace the parent if the offspring is better. A popular example is Differential Evolution (DE). After this populations are swapped (exchange ofPGA_NEWPOP
andPGA_OLDPOP
) for further processing.Example
PGAContext *ctx; ... PGAPairwiseBestReplacement (ctx);
- Parameters:
ctx – context variable
- Returns:
None