Warning: session_start(): open(/var/lib/php/sessions/sess_lr4m70k1o0fapcgfemqoplbaq6, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
// always keeps a dynamically updated list of the n most probable
// results
// not synchronized
srecord noeq PSCollectMostProbable(
int maxResults,
IVF1> action) implements IF0>> {
new ProbabilisticScheduler ps;
TreeSetWithDuplicates> results = new(reverseComparator());
*(int *maxResults, IVF2> action) {
this.action = out -> action.get(ps, out);
}
void add(WithProbability result) {
if (result == null) ret;
results.add(result);
truncateTreeSetWithDuplicates(results, maxResults);
}
selfType run() {
action.get(result -> add(WithProbability(ps.currentProbability(), result));
this;
}
// results sorted by probability. instant
public Set> results aka get() {
ret results;
}
}