Mark As Completed Discussion

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:

population[0:parents.shape0, :] = parents population[parents.shape0:, :] = offspring