All Downloads are FREE. Search and download functionalities are using the official Maven repository.

aima.core.probability.proposition.AbstractProposition Maven / Gradle / Ivy

Go to download

AIMA-Java Core Algorithms from the book Artificial Intelligence a Modern Approach 3rd Ed.

The newest version!
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 - 2024 Weber Informatics LLC | Privacy Policy