ProgramMetricAggregationResult
Models & Types · AiDotNet.Evolution.Programs.Metrics
The scalar quality produced from a metrics dictionary, with the evidence behind it.
For Beginners
This is the answer to “how good was this program?”, plus the working. Read
Value for the score, check HasFiniteValue before using it, and if the score
surprises you read Issues - it will tell you, for example, that the measurement you cared about
arrived as text and so was left out of the average.
How It Works
Value is the number an evolution task reports as a candidate’s quality. Everything else on this
type exists so the number can be defended: Strategy names the rule that produced it,
UsedCombinedScore says whether a single preferred metric short-circuited the calculation,
ContributingMetrics lists exactly which metrics were combined, and Issues lists the
metrics that were not, with a reason for each. The reference OpenEvolve rule returns only the number.
HasFiniteValue is the check a caller must make before handing Value to
EvolutionTaskResult.Completed, which requires a finite quality. It is false in exactly the cases
upstream would have propagated a NaN or an infinity into the archive: a combined_score that is
itself not a number, or an infinite metric reaching a mean. A caller that sees false should report the
candidate as failed rather than let a non-comparable score into the archive.
Constructors
| Constructor | Summary |
|---|---|
ProgramMetricAggregationResult(double value, ProgramMetricAggregationStrategy strategy, bool usedCombinedScore, IEnumerable<string> contributingMetrics, IEnumerable<ProgramMetricIssue> issues) |
Initializes an aggregation result. |
Properties
| Property | Summary |
|---|---|
IReadOnlyList<ProgramMetricIssue> Issues { get; } |
Gets the metrics that were set aside, with a reason for each. |
IReadOnlyList<string> ContributingMetrics { get; } |
Gets the names of the metrics that were combined, in ordinal order. |
ProgramMetricAggregationStrategy Strategy { get; } |
Gets the rule that produced Value. |
bool HasFiniteValue { get; } |
Gets whether Value is a finite number and therefore usable as an archive quality. |
bool UsedCombinedScore { get; } |
Gets whether a preferred combined-score metric short-circuited the calculation. |
double Value { get; } |
Gets the scalar quality. |
Methods
| Method | Summary |
|---|---|
string ToString() |
Returns the value, the strategy, and how many metrics were used and set aside. |