ProgramOutputComparison
Enums · AiDotNet.Enums
Selects how a candidate program’s captured output is compared with an expected output.
For Beginners
To decide whether a generated program is correct you run it on an example input and
check that what it printed matches what you expected. This enum is how strict that check should be. Use
Ordinal when every character matters, TrimmedOrdinal to forgive leading and trailing
blank space, and NormalizedWhitespace when only the words matter and any run of spaces, tabs, or
newlines is as good as a single space. Stricter settings give a cleaner signal; looser settings avoid punishing
a correct program for cosmetic differences.
How It Works
Execution-based scoring compares text, and text comparison is where most false failures come from: a trailing newline written by a print statement, Windows line endings from a container, or an extra space between columns will all sink an otherwise correct program. Choosing the comparison explicitly keeps the fitness signal honest, because the strictness is part of the evaluator’s version identity rather than an accident of the runner.
Fields
| Field | Summary |
|---|---|
ProgramOutputComparison NormalizedWhitespace |
Comparison after every run of white space collapses to a single space and the ends are trimmed. |
ProgramOutputComparison Ordinal |
Byte-for-byte comparison after line endings are normalized to line feeds. |
ProgramOutputComparison TrimmedOrdinal |
Ordinal comparison after leading and trailing white space is removed from the whole output. |
ProgramOutputComparison TrimmedOrdinalIgnoreCase |
Case-insensitive ordinal comparison after leading and trailing white space is removed. |
int value__ |