The Reproduce method takes the two Parents and "mates" them to create the new Children. The Child parameters must exist but all of their information will be overwritten by the Parents. Child1 is copied from the first parent and Child2 is copied from the second parent, and then Crossover, Mutate, and Invert are called according to the Operations property and the respective probability of the operation. Finally, an OnReproduction event occurs.
The Evolve method calls the Reproduce methods.
Namespace: RSGeneticBase
Delphi |
public |
Parameters
Parent1
Type: TRSIndividual
Parent2
Type: TRSIndividual
Child1
Type: TRSIndividual
Child2
Type: TRSIndividual
Type: Boolean
This example goes through the population, which is current a copy of the PreviousGeneration, selects parents and reproduces them:
|
Reference
|