aima.core.probability.proposition.AbstractProposition Maven / Gradle / Ivy
package aima.core.probability.proposition;
import java.util.Collection;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import aima.core.probability.RandomVariable;
public abstract class AbstractProposition implements Proposition {
private LinkedHashSet scope = new LinkedHashSet();
private LinkedHashSet unboundScope = new LinkedHashSet();
public AbstractProposition() {
}
//
// START-Proposition
public Set getScope() {
return scope;
}
public Set getUnboundScope() {
return unboundScope;
}
public abstract boolean holds(Map possibleWorld);
// END-Proposition
//
//
// Protected Methods
//
protected void addScope(RandomVariable var) {
scope.add(var);
}
protected void addScope(Collection vars) {
scope.addAll(vars);
}
protected void addUnboundScope(RandomVariable var) {
unboundScope.add(var);
}
protected void addUnboundScope(Collection vars) {
unboundScope.addAll(vars);
}
}