@@ -128,3 +128,22 @@ func (e *Engine) evaluateArticleCPUQuality(ctx context.Context, articleRunID str
|
||||
}
|
||||
return articleCPUQualityExecution{Result: result.Quality, Offloaded: true, AgentID: result.AgentID, ComputeMS: result.DurationMS}, nil
|
||||
}
|
||||
|
||||
func articleCPUQualityBetter(a, b articlequality.Result) bool {
|
||||
if a.Passed != b.Passed {
|
||||
return a.Passed
|
||||
}
|
||||
if len(a.HardFailures) != len(b.HardFailures) {
|
||||
return len(a.HardFailures) < len(b.HardFailures)
|
||||
}
|
||||
if math.Abs(a.Score-b.Score) > 0.000001 {
|
||||
return a.Score > b.Score
|
||||
}
|
||||
if a.WordCount != b.WordCount {
|
||||
return a.WordCount > b.WordCount
|
||||
}
|
||||
if a.SectionCount != b.SectionCount {
|
||||
return a.SectionCount > b.SectionCount
|
||||
}
|
||||
return a.SourceUtilization > b.SourceUtilization
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user