svoid runProbabilisticForNSeconds(double seconds, IProbabilistic p) { if (p == null) ret; p.run(); runProbabilisticForNSeconds(seconds, p.scheduler()); } svoid runProbabilisticForNSeconds(double seconds, IProbabilisticScheduler ps) { if (ps == null) ret; Timeout timeout = new(seconds); long steps = 0; while (!timeout.reached()) { ++steps; if (!ps.step()) break; } print(nSteps(steps) + " in " + formatDouble(timeout.elapsedSeconds(), 1) + " s, reached probability " + ps.lastExecutedProbability()); }