// This version is good when the probabilities returned
// are monotonically decreasing. To look for the best results
// when probabilities tend to increase over time, use
// PSCollectMostProbable.
static IVF1 psCollect(IProbabilisticScheduler ps, Cl> out) {
ret a -> {
if (out != null)
out.add(withPreciseProbability(ps.currentProbability(), a));
};
}
svoid psCollect(ProbabilisticScheduler ps,
Cl> results_out,
int maxResults,
IVF1> action) {
action.get(psCollect(ps, results_out));
stepUntil(ps, () -> l(results_out) >= 10);
}
static L> psCollect(int maxResults, IVF2> action) {
new ProbabilisticScheduler ps;
new L> results;
psCollect(ps, results, maxResults, out -> action.get(ps, out));
ret results;
}