Main Content

遗传算法Terminology

Fitness Functions

Thefitness functionis the function you want to optimize. For standard optimization algorithms, this is known as the objective function. The toolbox software tries to find the minimum of the fitness function.

Write the fitness function as a file or anonymous function, and pass it as a function handle input argument to the main genetic algorithm function.

Individuals

Anindividualis any point to which you can apply the fitness function. The value of the fitness function for an individual is its score. For example, if the fitness function is

f ( x 1 , x 2 , x 3 ) = ( 2 x 1 + 1 ) 2 + ( 3 x 2 + 4 ) 2 + ( x 3 2 ) 2 ,

the vector (2, -3, 1), whose length is the number of variables in the problem, is an individual. The score of the individual (2, –3, 1) isf(2, –3, 1) = 51.

An individual is sometimes referred to as agenomeand the vector entries of an individual asgenes.

Populations and Generations

Apopulationis an array of individuals. For example, if the size of the population is 100 and the number of variables in the fitness function is 3, you represent the population by a 100-by-3 matrix. The same individual can appear more than once in the population. For example, the individual (2, -3, 1) can appear in more than one row of the array.

At each iteration, the genetic algorithm performs a series of computations on the current population to produce a new population. Each successive population is called a newgeneration.

Diversity

Diversityrefers to the average distance between individuals in a population. A population has high diversity if the average distance is large; otherwise it has low diversity. In the following figure, the population on the left has high diversity, while the population on the right has low diversity.

Diversity is essential to the genetic algorithm because it enables the algorithm to search a larger region of the space.

Fitness Values and Best Fitness Values

Thefitness valueof an individual is the value of the fitness function for that individual. Because the toolbox software finds the minimum of the fitness function, thebestfitness value for a population is the smallest fitness value for any individual in the population.

Parents and Children

To create the next generation, the genetic algorithm selects certain individuals in the current population, calledparents, and uses them to create individuals in the next generation, calledchildren. Typically, the algorithm is more likely to select parents that have better fitness values.

Related Topics