Warning: session_start(): open(/var/lib/php/sessions/sess_6v21js34b0cpma4ok073ccudhi, 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
srecord noeq probabilisticDistanceBasedLookup(
IProbabilisticScheduler scheduler,
NavigableMap map,
IVF1 action,
double key) {
swappable double distanceToProbability(double distance) {
ret genericDistanceToProbability(distance);
}
run {
Double closest = closestDoubleKey(map, key);
if (closest == null) ret;
double p = distanceToProbability(abs(closest-key));
scheduler.at(p, () -> action.get(closest));
scheduler.at(p, () -> walkLeft(closest));
scheduler.at(p, () -> walkRight(closest));
}
void walkLeft(double x) {
Double y = map.lowerKey(key);
if (y == null) ret;
double p = distanceToProbability(abs(y-key));
scheduler.at(p, () -> action.get(y));
scheduler.at(p, () -> walkLeft(y));
}
void walkLeft(double x) {
Double y = map.higherKey(key);
if (y == null) ret;
double p = distanceToProbability(abs(y-key));
scheduler.at(p, () -> action.get(y));
scheduler.at(p, () -> walkRight(y));
}
}