sclass BestWorstAndAverage {
IBest best = new Best;
IBest worst = new Lowest;
new Average average;
selfType lowerIsBetter() {
best = new Lowest;
worst = new Best;
this;
}
bool put(A a, double score) {
average.add(score);
ret best.put(a, score) | worst.put(a, score);
}
toString {
ret renderVars(avg := average, +best, +worst);
}
}