ProgramEvolutionElite

Models & Types · AiDotNet.Evolution.Programs

One archived program from a finished run, with its score, its cell, and a bounded copy of its source.

For Beginners

When the search finishes it does not hand back one answer; it hands back a map of the best answer it found in each style or size of solution. This type is one square of that map: the program, how well it scored, and where it sat on the map. Reading several of them side by side is usually more informative than reading the single best one, because it shows you the trade-offs the search discovered.

How It Works

A MAP-Elites archive keeps the best program found for every distinct behaviour cell rather than a single winner, so the useful output of a run is a list of these, not one program. Cell holds the bin indices that placed this program in the grid and Descriptors holds the raw coordinate values behind them, which together explain why two elites with similar scores were both kept.

Source is a bounded copy: it is the program text truncated to the limit the result was built with, and IsSourceTruncated says whether anything was cut. That bound exists because a run’s summary is routinely logged or serialized, and program text is model-generated content of unbounded size. When the whole program is needed, read it from the archive entry the result was built from rather than from here.

Constructors

Constructor Summary
ProgramEvolutionElite(string genomeId, string source, bool isSourceTruncated, ProgramLanguage language, double? quality, IReadOnlyDictionary<string, double> descriptors, IReadOnlyList<int> cell, int island, long evaluationId, IReadOnlyDictionary<string, double> metrics) Initializes an elite summary.

Properties

Property Summary
IReadOnlyDictionary<string, double> Descriptors { get; } Gets the raw archive coordinates behind Cell; empty when none were recorded.
IReadOnlyDictionary<string, double> Metrics { get; } Gets every number the evaluation reported, keyed by metric name; empty when none were recorded.
IReadOnlyList<int> Cell { get; } Gets the bin indices that placed this program in the grid; empty when none were recorded.
ProgramLanguage Language { get; } Gets the program’s language.
bool IsSourceTruncated { get; } Gets whether Source was cut to fit that bound.
double? Quality { get; } Gets the fitness score, or null when the program was never scored.
int Island { get; } Gets the zero-based island the program was archived on.
long EvaluationId { get; } Gets the identifier of the evaluation that produced the score.
string GenomeId { get; } Gets the program’s canonical identity, the hash of its normalized source.
string Source { get; } Gets the program text, truncated to the bound the result was built with.

Methods

Method Summary
string ToString() Returns a description that never echoes the program text.