gaft.operators.selection

Roulette Wheel Selection implementation.

class gaft.operators.selection.roulette_wheel_selection.RouletteWheelSelection

Bases: gaft.plugin_interfaces.operators.selection.Selection

Selection operator with fitness proportionate selection(FPS) or so-called roulette-wheel selection implementation.

select(population, fitness)

Select a pair of parent using FPS algorithm.

Parameters:population (gaft.components.Population) – Population where the selection operation occurs.
Returns:Selected parents (a father and a mother)
Return type:list of gaft.components.IndividualBase
gaft.operators.selection.roulette_wheel_selection.random() → x in the interval [0, 1).

Tournament Selection implementation.

class gaft.operators.selection.tournament_selection.TournamentSelection(tournament_size=2)

Bases: gaft.plugin_interfaces.operators.selection.Selection

Selection operator using Tournament Strategy with tournament size equals to two by default.

Parameters:tournament_size (int) – Individual number in one tournament
select(population, fitness)

Select a pair of parent using Tournament strategy.

Parameters:population (gaft.components.Population) – Population where the selection operation occurs.
Returns:Selected parents (a father and a mother)
Return type:list of gaft.components.IndividualBase

Linear Ranking Selection implementation.

class gaft.operators.selection.linear_ranking_selection.LinearRankingSelection(pmin=0.1, pmax=0.9)

Bases: gaft.plugin_interfaces.operators.selection.Selection

Selection operator using Linear Ranking selection method.

Reference: Baker J E. Adaptive selection methods for genetic algorithms[C]//Proceedings of an International Conference on Genetic Algorithms and their applications. 1985: 101-111.

select(population, fitness)

Select a pair of parent individuals using linear ranking method.

Parameters:population (gaft.components.Population) – Population where the selection operation occurs.
Returns:Selected parents (a father and a mother)
Return type:list of gaft.components.IndividualBase
gaft.operators.selection.linear_ranking_selection.random() → x in the interval [0, 1).

Exponential Ranking Selection implemention.

class gaft.operators.selection.exponential_ranking_selection.ExponentialRankingSelection(base=0.5)

Bases: gaft.plugin_interfaces.operators.selection.Selection

Selection operator using Exponential Ranking selection method.

Parameters:base (float in range (0.0, 1.0)) – The base of exponent
select(population, fitness)

Select a pair of parent individuals using exponential ranking method.

Parameters:population (gaft.components.Population) – Population where the selection operation occurs.
Returns:Selected parents (a father and a mother)
Return type:list of gaft.components.IndividualBase
gaft.operators.selection.exponential_ranking_selection.random() → x in the interval [0, 1).