Skip to main content

Module programmer

Module programmer 

Source
Expand description

An evolutionary programmer after Lou, Ding and Wu (2022): a meta-GA evolves bit strings that encode complete path-planning GAs (operators and their parameters, drawn from an operator library), scored by how well the decoded planner solves a set of training instances within a fixed evaluation budget.

The genome has 18 bits (the paper’s has 64 over a larger library):

BitsGeneValues
0–1selection operatortournament, truncation, roulette, linear ranking with SUS
2–3selection parametersize 2/3/4/6; fraction 0.2/0.3/0.5/0.7; pressure 1.2/1.4/1.7/2
4–5elitism0, 1, 2, 4
6–7crossover rate0, 0.4, 0.7, 0.95
8–9mutation rate0.2, 0.5, 0.8, 1
10–12population size10, 16, 24, 32, 48, 64, 96, 128
13–14reroute expansions8, 32, 128, 512
15schemegenerational, steady state
16–17steady-state replacementalways (codes 0, 1), only if better (codes 2, 3)

The meta-GA uses linear ranking with selective pressure 1.2, the paper’s scores from 0.8 (worst) to 1.2 (best).

use evolutionary_planning::graph_path::Grid;
use evolutionary_planning::programmer::{Instance, MetaConfig, Programmer};
use evolutionary_planning::SplitMix64;

let mut grid = Grid::open(8, 8, false);
for y in 0..6 {
    grid.block(4, y);
}
let instances = vec![Instance::new(&grid, grid.node(0, 0), grid.node(7, 0))];
let mut programmer = Programmer::new(instances, 400);
let (planner, score) = programmer.evolve(&MetaConfig { population_size: 10, evaluations: 60 }, &mut SplitMix64::new(1));
assert!(score.is_finite() && planner.population_size >= 10);

Structs§

Instance
A training instance: a graph, a start, a goal and the optimal length (from Dijkstra).
MetaConfig
Parameters of the meta-GA.
PlannerConfig
A decoded path-planning GA.
Programmer
The planner-programming objective: the mean relative excess cost / optimum - 1 of the decoded planner over the training instances (a failed run counts 10), each run with a fixed seed so a genome’s score is deterministic.

Enums§

SelectionChoice
A selection operator chosen by the genome.

Constants§

GENOME_BITS
The number of bits of a planner genome.