
aima.core.probability.proposition.AbstractProposition Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aima-core Show documentation
Show all versions of aima-core Show documentation
AIMA-Java Core Algorithms from the book Artificial Intelligence a Modern Approach 3rd Ed.
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);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy