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

main.java.burlap.domain.singleagent.frostbite.FrostbiteTF Maven / Gradle / Ivy

Go to download

The Brown-UMBC Reinforcement Learning and Planning (BURLAP) Java code library is for the use and development of single or multi-agent planning and learning algorithms and domains to accompany them. The library uses a highly flexible state/observation representation where you define states with your own Java classes, enabling support for domains that discrete, continuous, relational, or anything else. Planning and learning algorithms range from classic forward search planning to value-function-based stochastic planning and learning algorithms.

The newest version!
package burlap.domain.singleagent.frostbite;

import burlap.mdp.core.TerminalFunction;
import burlap.mdp.core.oo.OODomain;
import burlap.mdp.core.oo.propositional.PropositionalFunction;
import burlap.mdp.core.oo.state.OOState;
import burlap.mdp.core.state.State;

/**
 * @author Phillipe Morere
 */
public class FrostbiteTF implements TerminalFunction{

	private PropositionalFunction onIce;
	private PropositionalFunction inWater;
	private PropositionalFunction iglooBuilt;

	public FrostbiteTF(OODomain domain) {
		this.inWater = domain.propFunction(FrostbiteDomain.PF_IN_WATER);
		this.onIce = domain.propFunction(FrostbiteDomain.PF_ON_ICE);
		this.iglooBuilt = domain.propFunction(FrostbiteDomain.PF_IGLOO_BUILT);
	}

	@Override
	public boolean isTerminal(State s) {
		if (inWater.someGroundingIsTrue((OOState)s))
			return true;
		return iglooBuilt.someGroundingIsTrue((OOState)s) && onIce.someGroundingIsTrue((OOState)s);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy