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
FieldsModifier and TypeFieldDescriptionprotected static doubleprotected static CrossOverTypestatic FitnessEvaluatorprotected static doubleprotected static MutationTypeprotected IndividualType[]protected static intstatic intprotected static ReplacementTypeprotected static SelectionType -
Constructor Summary
ConstructorsConstructorDescriptionBasicPopulation(Class<IndividualType> individual) Initializes the parameters -
Method Summary
Modifier and TypeMethodDescriptionabstract voidThis 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 IndividualTypeThis method returns the fittest individual in the populationabstract voidThis method initializes each individual in the population.abstract voidThis method recombines (cross over) the parents to generate new offsprings.abstract voidThis method handles populations from one generation to the next generation.abstract voidThis method mutates new offsprings by changing the value of some genes in them.abstract voidThis 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
-