Class SelectionOperator
java.lang.Object
unifeat.featureSelection.wrapper.GABasedMethods.SelectionOperator
This java class is used to implement various selection operators for
selecting parents from the individuals of a population according to their
fitness that will recombine for next generation.
The methods in this class is contained brief description of the applications.
- Author:
- Sina Tabakhi
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int[]
fitnessProportionalSelection
(double[] fitnessValues, int matingPoolSize) Selects parents from the individuals of a population according to their fitness values using fitness proportional selection method in which roulette wheel algorithm is used for selecting each individual based on their probabilitiesstatic int[]
rankBasedSelection
(double[] fitnessValues, int matingPoolSize) Selects parents from the individuals of a population according to their fitness values using rank-based selection method in which roulette wheel algorithm is used for selecting each individual based on their ranksstatic int
rouletteWheel
(double[] probabilities) Selects an individual in a population according to their probabilities using roulette wheel algorithm
-
Constructor Details
-
SelectionOperator
public SelectionOperator()
-
-
Method Details
-
rouletteWheel
public static int rouletteWheel(double[] probabilities) Selects an individual in a population according to their probabilities using roulette wheel algorithm- Parameters:
probabilities
- the array of probabilities of selecting individuals- Returns:
- the index of selected individual
-
fitnessProportionalSelection
public static int[] fitnessProportionalSelection(double[] fitnessValues, int matingPoolSize) Selects parents from the individuals of a population according to their fitness values using fitness proportional selection method in which roulette wheel algorithm is used for selecting each individual based on their probabilities- Parameters:
fitnessValues
- the array of fitness values of individuals in a populationmatingPoolSize
- the size of the mating pool- Returns:
- an array of indices of the selected individuals
-
rankBasedSelection
public static int[] rankBasedSelection(double[] fitnessValues, int matingPoolSize) Selects parents from the individuals of a population according to their fitness values using rank-based selection method in which roulette wheel algorithm is used for selecting each individual based on their ranks- Parameters:
fitnessValues
- the array of fitness values of individuals in a populationmatingPoolSize
- the size of the mating pool- Returns:
- an array of indices of the selected individuals
-