liveBook · Manning

Generation

As explained in Classic Computer Science Problems in Swift: Essential techniques for practicing programmers

A generation is one evolutionary cycle in which a genetic algorithm evaluates and transforms a population of candidate solutions.

A generation is one cycle of a genetic algorithm: evaluate a population of candidate solutions, select parents, create replacement individuals, and apply possible mutations. section 5.3 section 5.1

A generic generation proceeds through these operations:

  • Measure each chromosome’s fitness and stop early when one reaches the target threshold. section 5.3
  • Select parents using roulette-wheel or tournament selection. section 5.3
  • Reproduce children through crossover, replace the population, and possibly mutate every individual. section 5.3

Tracking progress with SimpleEquation

A run seeking the maximum of 6x − x² + 4y − y² improved across generations and reached x = 3, y = 2, with fitness 13 after 18 generations. Each generation reported its best and average fitness. section 5.4

Figure 5.1. The general outline of a genetic algorithm

Use the outline to inspect how evaluation, selection, reproduction, and mutation form a repeating generation cycle. section 5.3

How Classic Computer Science Problems in Swift: Essential techniques for practicing programmers covers it

How deep it goes
Explains generation-level evaluation, selection, reproduction, mutation, thresholds, and progress reporting without formal evolutionary analysis.
Examples
Uses SimpleEquation progress logs and a SEND+MORE=MONEY run completed in 38 generations.
What it assumes
Assumes chromosomes provide fitness, copying, random creation, crossover, mutation, and printing operations.
What you can do after
Apply it via GeneticAlgorithm to monitor progress and solve maximization or constraint problems.
How it connects
Connects generations with populations, chromosomes, fitness functions, selection, crossover, mutation, and natural selection.

Also explained in

Compare how 3 books explain generation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Classic Computer Science Problems in Swift: Essential techniques for practicing programmers. The section links point to the parts of the book it draws on.