devolve



template  topPar(uint num) if (num > 0)

Select the 'num' most fit individuals from the population by evaluating their fitnesses in parallel. The direction of the sorting may be set with 'comp'.


individual[]  topPar(alias fitness, alias comp = "a > b", individual, statRecord)(individual[] population, statRecord record);




template  top(uint num) if (num > 0)

The population is sorted by the fitness function and the 'num' most fit members are selected. The direction of the sort may be set with comp, default is highest fitness first.


individual[]  top(alias fitness, alias comp = "a > b", individual, statRecord)(individual[] population, statRecord record);




template  tournament(uint numberOfTournaments, uint tournamentSize, double probability) if (numberOfTournaments > 0 && tournamentSize > 0 && probability > 0 && probability <= 1.00000)

Select 'numberOfTournaments' individuals from the population by dividing it into 'numberOfTournament' pools of size 'tournamentSize'. The pools are then sorted by their fitness. The top-most member is selected with probability 'probability', the next with probability 'probability * (1 - probability)' the next with probability 'probability * (1 - probability)^2', etc. This process is preformed on each pool in parallel. If the individual has a 'clone' method it will be invoked when copying.


individual[]  tournament(alias fitness, alias comp = "a > b", individual, statRecord)(individual[] population, statRecord record);




template  roulette(uint num) if (num > 0)

Select 'num' individuals from the population by sorting by fitness and randomly choosing individuals with probability weighted by the individual's fitness. The evaluation of fitness is done in parallel. If 'individual' has a 'clone' method it will be invoked when copying.


individual[]  roulette(alias fitness, alias comp = "a > b", individual, statRecord)(individual[] population, statRecord record);