Warning: session_start(): open(/var/lib/php/sessions/sess_iaf8hjn1macvvgl57c97hmno0i, 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
// as long as you don't access the by-numeral-index functions,
// you can add and remove elements quickly.
// upon accessing the list, it is updated once to fit the new data
sclass ProbabilisticList extends AbstractRandomAccessList> {
// these are the 2 main data structures we update
Map probabilities = hashMap();
MultiSetMap byProbability = multiSetMap_outerDescTreeMap_innerLinkedHashSet();
L> renderedAsList; // this is only updated when requested
public WithProbability get(int idx) {
if (idx < 0 || idx >= size()) null;
makeListUpToIndex(idx);
ret renderedAsList.get(idx);
}
public int size() { ret l(probabilities); }
void makeListUpToIndex(int idx) {
if (idx < l(renderedAsList)) ret;
if (nempty(renderedAsList)) {
A last = last(renderedAsList);
double probability = probabilites.get(last);
Set<> = byProbability.get(probability)
while ( <= idx)
byProbability.get(
}
}