Class Population
java.lang.Object
unifeat.featureSelection.wrapper.GABasedMethods.BasicPopulation<Individual>
unifeat.featureSelection.wrapper.GABasedMethods.SimpleGA.Population
This java class is used to implement a population of individuals in simple
genetic algorithm (Simple GA) method in which the type of individual is
extended from Individual class.
- Author:
- Sina Tabakhi
- See Also:
-
Field Summary
Fields inherited from class unifeat.featureSelection.wrapper.GABasedMethods.BasicPopulation
CROSS_OVER_RATE, CROSSOVER_TYPE, fitnessEvaluator, MUTATION_RATE, MUTATION_TYPE, population, POPULATION_SIZE, PROBLEM_DIMENSION, REPLACEMENT_TYPE, SELECTION_TYPE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
This method evaluates the fitness of each individual in the population by predefined fitness function.double[]
This method returns an array of fitness values of individuals in a populationThis method returns the fittest individual in the populationvoid
This method initializes each individual in the population.void
This method recombines (cross over) the parents to generate new offsprings.void
This method handles populations from one generation to the next generation.void
This method mutates new offsprings by changing the value of some genes in them.void
This method selects parents from the individuals of a population according to their fitness that will recombine for next generation.
-
Field Details
-
seedValue
private int seedValue -
rand
-
matingPool
-
-
Constructor Details
-
Population
public Population()Initializes the parameters
-
-
Method Details
-
initialization
public void initialization()This method initializes each individual in the population. Each individual is randomly initialized.- Specified by:
initialization
in classBasicPopulation<Individual>
-
evaluateFitness
public void evaluateFitness()This method evaluates the fitness of each individual in the population by predefined fitness function. K-fold cross validation on training set is used for evaluating the classification performance of selected feature subset by each individual.- Specified by:
evaluateFitness
in classBasicPopulation<Individual>
-
operateSelection
public void operateSelection()This method selects parents from the individuals of a population according to their fitness that will recombine for next generation.The selection type is selected based on selectionType by user.
- Specified by:
operateSelection
in classBasicPopulation<Individual>
-
operateCrossOver
public void operateCrossOver()This method recombines (cross over) the parents to generate new offsprings.The crossover type is selected based on crossoverType by user.
- Specified by:
operateCrossOver
in classBasicPopulation<Individual>
-
operateMutation
public void operateMutation()This method mutates new offsprings by changing the value of some genes in them.The mutation type is selected based on mutationType by user.
- Specified by:
operateMutation
in classBasicPopulation<Individual>
-
operateGenerationReplacement
public void operateGenerationReplacement()This method handles populations from one generation to the next generation.The replacement type is selected based on replacementType by user.
- Specified by:
operateGenerationReplacement
in classBasicPopulation<Individual>
-
getFittestIndividual
This method returns the fittest individual in the population- Specified by:
getFittestIndividual
in classBasicPopulation<Individual>
- Returns:
- the fittest individual in the population
-
getFitness
public double[] getFitness()This method returns an array of fitness values of individuals in a population- Specified by:
getFitness
in classBasicPopulation<Individual>
- Returns:
- an array of fitness values of individuals
-