Environmental selection
In this example, the parents and newly generated offspring will collectively make the next generation. In other words, weak chromosomes in the previous generation will be replaced with new offspring. It is implemented as follows: