Skip to main content
Genetic Algorithm Optimizer

This optimizer is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them.


Source
evo-design/proto-language/proto_language/optimizer/genetic_algorithm_optimizer.py
View source
Optimizer contributors
Population-based genetic algorithm optimizer.

API Reference

ConfigGeneticAlgorithmOptimizerConfig Source
Configuration for a general genetic algorithm optimizer.
integer
required
Number of genetic algorithm generations.
integer
Number of top-scoring candidates to retain as final results. Overrides program count.
integer
default:"32"
Number of candidates maintained in the population.
integer
Number of children scored per generation. Defaults to population_size.
number
default:"0.1"
Fraction of the best parents copied into the next generation before selecting children.
number
default:"0.8"
Probability that an offspring recombines two parents instead of copying one parent.
enum
default:"single_point"
Crossover operator used for equal-length parent sequences.Options: single_point, two_point, uniform
enum
default:"tournament"
Parent selection strategy.Options: tournament, rank, roulette
enum
default:"independent"
Use independent parent draws or one shared tournament that returns the winner and runner-up.Options: independent, shared_tournament
integer
default:"3"
Number of candidates sampled for tournament parent selection.
number
default:"1.0"
Probability of accepting the current best tournament candidate before considering the next.
boolean
default:"False"
If true, resample parent pairs until they use different population indices.
enum
default:"single"
Single creates one child per parent pair; reciprocal creates two children with swapped parents.Options: single, reciprocal
enum
default:"elitist"
Elitist keeps the best parents and children; generational keeps elites plus top children.Options: elitist, generational
enum
default:"energy"
Select survivors by scalar energy or NSGA-II Pareto rank over scoring constraints.Options: energy, nsga2
object
Zero-based per-segment sequence positions eligible for crossover.
object
Zero-based per-segment sequence positions ineligible for crossover.
boolean
default:"False"
If true, two-point crossover may select identical cut points and swap no residues.
boolean
default:"False"
Keep parent structures on crossed-over children so downstream generators can use them.
integer
Random seed for reproducible optimization, generator, and constraint tool streams.
integer
default:"1"
Save history and log progress every N steps. Step 0 and final step always saved.
boolean
default:"False"
Save granular per-proposal results (accept/reject) in history snapshots.
boolean
default:"False"
Emit per-step debug information about proposals, scores, and acceptance through the logger.

Usage

python

Metadata