IBM ILOG Solver User's Manual > Evolutionary Algorithms > Introduction and Basic Concepts > Features of the library > Solution Replacement

The final step of a genetic algorithm generation is to combine the intermediate offspring with the current population to form a new population. For convenience, a "steady-state" model is often used, where the size of the population does not change from generation to generation. This is not imposed by the EA framework, but does simplify discussion and genetic algorithm design. In such a steady-state system, we refer to the above combination process as "solution replacement." That is, we replace some of the members of the population with offspring.

Replacement processors, like selectors, but unlike operators, are basically raw pool processors. Normally, they receive the offspring as input, and the current population as a parameter. They then modify the population as desired, typically keeping its size fixed, and generate as output the solutions which are to be discarded. The pool processor IloReplaceSolutions can be used to show how this procedure functions:

IloComparator<IloSolution> compareWorst = IloWorstSolutionComparator(env);
IloSolutionPoolSelector deadSelector = 
IloTournamentSelector<IloSolution,IloSolutionPool>(env, 3, compareWorst);
IloPoolProc replace = IloReplaceSolutions(env, population, deadSelector);
IloPoolProc combine = offspring >> replace >> IloDestroyAll(env);

Above, a tournament selector deadSelector is created which tends to select poorer solutions (via use of the comparator IloWorstSolutionComparator). This selector is passed to the pool processor IloReplaceSolutions which works as follows. First, the population passed as parameter is fed as input to deadSelector. Next, the selector is asked to select as many solutions from the population as there are solutions in the input pool (i.e. the number of offspring). Finally, the selected solutions are removed from the population and placed on the output pool, after which the solutions in the input pool (the offspring) are added to the population.

In the EA framework, destruction of solutions which have been permanently removed from the population is explicit. The processor IloDestroyAll calls the end method on all solutions in its input pool. This destruction phase completes the combination operation.