Warning: session_start(): open(/var/lib/php/sessions/sess_6k1ppp3fd5pvp0hbl0ij0h0dac, 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
sclass AllOnAll_probabilistic_forTransformers implements Producer> {
replace A with F1.
replace B with O.
// We're grouping both a's and b's by the type accepted by the transformers.
// Of course things are never this easy because types have subtypes...
new MultiMap aList;
new MultiMap bList;
LPair, Cl> todo = new LinkedList; // this is still non-probabilistic
MultiSetMap> todo2 = multiSetMap_outerDescTreeMap_innerLinkedHashSet();
persistently swappable double probabilityForPair(A a, B b) { ret 1.0; }
void addA(A a) { newA(a); }
void addAIfNotNull(A a) { if (a != null) newA(a); }
synchronized void newA(A a) {
add(aList, a);
multiSetCombine(bList.get(classesForA(a));
IntRange rB = intRange(0, l(bList));
if (empty(rB)) ret;
addPair(todo, intRange_last(aList), rB);
}
synchronized void newAs(Iterable l) {
fOr (A a : l) newA(a);
}
void addB(B b) { newB(b); }
void addBIfNotNull(B b) { if (b != null) newB(b); }
synchronized void newB(B b) {
add(bList, b);
IntRange rA = intRange(0, l(aList));
if (empty(rA)) ret;
addPair(todo, rA, intRange_last(bList));
}
synchronized void newBs(Iterable l) {
fOr (B b : l) newB(b);
}
public synchronized Pair next() {
Pair p;
while ((p = popFirst(todo)) != null)
for (A a : subList(aList, p.a))
for (B b : subList(bList, p.b))
addAPair(a, b, probabilityForPair(a, b));
ret popFirstValueFromMultiSetMap(todo2);
}
private void addAPair(A a, B b, double probability) {
if (probability > 0)
todo2.put(probability, pair(a, b));
}
synchronized L cloneBList() {
ret clonedList(bList);
}
L getAs() { ret aList; }
L getBs() { ret bList; }
}