package qualityimport ()// Score preserves the original TALA penalty and separate area tie-breaker.// Diagnostic geometry from Inspect is deliberately absent from this ordering.typeScorestruct{ Penalty, Area float64 }// Evaluate adapts the original evaluator for bounded refinement callers.func ( context.Context, *layoutgraph.Graph) (Score, error) { , , := EvaluateWithArea(, )returnScore{Penalty: , Area: }, }// Compare orders penalties exactly, then areas, with the same handling of// non-finite values as the original seed-result comparator.func ( Score) ( Score) int {if := compareNumber(.Penalty, .Penalty, false); != 0 {return }returncompareNumber(.Area, .Area, true)}func compareNumber(, float64, bool) int { := finite() && (! || >= 0) := finite() && (! || >= 0)if && ! {return -1 }if ! && {return1 }if ! {return0 }returncmp.Compare(, )}func finite( float64) bool { return !math.IsNaN() && !math.IsInf(, 0) }
The pages are generated with Goldsv0.8.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.