Warning: session_start(): open(/var/lib/php/sessions/sess_s28474t5qbvh16nnn2g8t9f7no, 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
// subclass must implement run {}
asclass Probabilistic implements IProbabilistic, Steppable {
IProbabilisticScheduler ps;
void initScheduler {
if (ps == null) ps = new ProbabilisticScheduler;
}
public void setScheduler(IProbabilisticScheduler ps) {
this.ps = ps;
}
void schedule aka at(double probability default 1.0, Runnable action) {
initScheduler();
ps.at(probability, action);
}
void scheduleRelative(double probability, Runnable action) {
initScheduler();
ps.atRelative(probability, action);
}
void scheduleAll(double probability, Iterable extends Runnable> actions) {
forEach(actions, a -> schedule(probability, a));
}
void scheduleAllRelative(double probability, Iterable extends Runnable> actions) {
forEach(actions, a -> scheduleRelative(probability, a));
}
// call run() before
void stepAll() {
main stepAll(ps);
}
// call run() before
public bool step() {
ret ps.step();
}
}