public boolean containsValue(RandomVariable rv) {
return varIdxs.get(rv) <= extendedIdx;
}
public double posteriorForParents(RandomVariable rv) {
Node n = bn.getNode(rv);
if (!(n instanceof FiniteNode)) {
throw new IllegalArgumentException(
"Enumeration-Ask only works with finite Nodes.");
}
FiniteNode fn = (FiniteNode) n;
Object[] vals = new Object[1 + fn.getParents().size()];
int idx = 0;
for (Node pn : n.getParents()) {
vals[idx] = extendedValues[varIdxs.get(pn.getRandomVariable())];
idx++;
}
vals[idx] = extendedValues[varIdxs.get(rv)];