Class BasicPopulation<IndividualType>
java.lang.Object
unifeat.featureSelection.wrapper.GABasedMethods.BasicPopulation<IndividualType>
- Type Parameters:
IndividualType
- the type of individual implemented in GA algorithm
- Direct Known Subclasses:
Population
,Population
The abstract class contains the main methods and fields that are used in all
GA-based feature selection methods. This class is used to implement a
population of individuals in GA algorithm.
- Author:
- Sina Tabakhi
-
Field Summary
Modifier and TypeFieldDescriptionprotected static double
protected static CrossOverType
static FitnessEvaluator
protected static double
protected static MutationType
protected IndividualType[]
protected static int
static int
protected static ReplacementType
protected static SelectionType
-
Constructor Summary
ConstructorDescriptionBasicPopulation
(Class<IndividualType> individual) Initializes the parameters -
Method Summary
Modifier and TypeMethodDescriptionabstract void
This method evaluates the fitness of each individual in the population by predefined fitness function.abstract double[]
This method returns an array of fitness values of individuals in a populationabstract IndividualType
This method returns the fittest individual in the populationabstract void
This method initializes each individual in the population.abstract void
This method recombines (cross over) the parents to generate new offsprings.abstract void
This method handles populations from one generation to the next generation.abstract void
This method mutates new offsprings by changing the value of some genes in them.abstract void
This method selects parents from the individuals of a population according to their fitness that will recombine for next generation.
-
Field Details
-
population
-
fitnessEvaluator
-
PROBLEM_DIMENSION
public static int PROBLEM_DIMENSION -
POPULATION_SIZE
protected static int POPULATION_SIZE -
CROSS_OVER_RATE
protected static double CROSS_OVER_RATE -
MUTATION_RATE
protected static double MUTATION_RATE -
SELECTION_TYPE
-
CROSSOVER_TYPE
-
MUTATION_TYPE
-
REPLACEMENT_TYPE
-
-
Constructor Details
-
BasicPopulation
Initializes the parameters- Parameters:
individual
- the type of individual implemented in GA algorithm
-
-
Method Details
-
initialization
public abstract void initialization()This method initializes each individual in the population. -
evaluateFitness
public abstract void evaluateFitness()This method evaluates the fitness of each individual in the population by predefined fitness function. -
operateSelection
public abstract void operateSelection()This method selects parents from the individuals of a population according to their fitness that will recombine for next generation. -
operateCrossOver
public abstract void operateCrossOver()This method recombines (cross over) the parents to generate new offsprings. -
operateMutation
public abstract void operateMutation()This method mutates new offsprings by changing the value of some genes in them. -
operateGenerationReplacement
public abstract void operateGenerationReplacement()This method handles populations from one generation to the next generation. -
getFittestIndividual
This method returns the fittest individual in the population- Returns:
- the fittest individual in the population
-
getFitness
public abstract double[] getFitness()This method returns an array of fitness values of individuals in a population- Returns:
- an array of fitness values of individuals
-