burlap.mdp.singleagent.model.statemodel.FullStateModel Java Examples

The following examples show how to use burlap.mdp.singleagent.model.statemodel.FullStateModel. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FactoredModel.java    From burlap with Apache License 2.0 6 votes vote down vote up
@Override
public List<TransitionProb> transitions(State s, Action a) {

	if(!(this.stateModel instanceof FullStateModel)){
		throw new RuntimeException("Factored Model cannot enumerate transition distribution, because the state model does not implement FullStateModel");
	}

	List<StateTransitionProb> stps = ((FullStateModel)this.stateModel).stateTransitions(s, a);
	List<TransitionProb> tps = new ArrayList<TransitionProb>(stps.size());
	for(StateTransitionProb stp : stps){
		double r = this.rf.reward(s, a, stp.s);
		boolean t = this.tf.isTerminal(stp.s);
		TransitionProb tp = new TransitionProb(stp.p, new EnvironmentOutcome(s, a, stp.s, r, t));
		tps.add(tp);
	}

	return tps;
}
 
Example #2
Source File: IPModel.java    From burlap with Apache License 2.0 5 votes vote down vote up
@Override
public List<StateTransitionProb> stateTransitions(State s, Action a) {
	if(this.physParams.actionNoise == 0.){
		return FullStateModel.Helper.deterministicTransition(this, s, a);
	}
	throw new RuntimeException("Transition Probabilities for the Inverted Pendulum with continuous action noise cannot be enumerated.");
}
 
Example #3
Source File: MinecraftModel.java    From burlapcraft with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public List<StateTransitionProb> stateTransitions(State s, Action a) {
	return FullStateModel.Helper.deterministicTransition(this, s, a);
}
 
Example #4
Source File: BWModel.java    From burlap with Apache License 2.0 4 votes vote down vote up
@Override
public List<StateTransitionProb> stateTransitions(State s, Action a) {
	return FullStateModel.Helper.deterministicTransition(this, s, a);
}
 
Example #5
Source File: BlockDudeModel.java    From burlap with Apache License 2.0 4 votes vote down vote up
@Override
public List<StateTransitionProb> stateTransitions(State s, Action a) {
	return FullStateModel.Helper.deterministicTransition(this, s, a);
}
 
Example #6
Source File: MountainCar.java    From burlap with Apache License 2.0 4 votes vote down vote up
@Override
public List<StateTransitionProb> stateTransitions(State s, Action a) {
	return FullStateModel.Helper.deterministicTransition(this, s, a);
}
 
Example #7
Source File: LunarLanderModel.java    From burlap with Apache License 2.0 4 votes vote down vote up
@Override
public List<StateTransitionProb> stateTransitions(State s, Action a) {
	return FullStateModel.Helper.deterministicTransition(this, s, a);
}
 
Example #8
Source File: FrostbiteModel.java    From burlap with Apache License 2.0 4 votes vote down vote up
@Override
public List<StateTransitionProb> stateTransitions(State s, Action a) {
	return FullStateModel.Helper.deterministicTransition(this, s, a);
}
 
Example #9
Source File: CPCorrectModel.java    From burlap with Apache License 2.0 4 votes vote down vote up
@Override
public List<StateTransitionProb> stateTransitions(State s, Action a) {
	return FullStateModel.Helper.deterministicTransition(this, s, a);
}
 
Example #10
Source File: CPClassicModel.java    From burlap with Apache License 2.0 4 votes vote down vote up
@Override
public List<StateTransitionProb> stateTransitions(State s, Action a) {
	return FullStateModel.Helper.deterministicTransition(this, s, a);
}
 
Example #11
Source File: CartPoleDomain.java    From burlap with Apache License 2.0 3 votes vote down vote up
@Override
public SADomain generateDomain() {
	
	SADomain domain = new SADomain();

	CPPhysicsParams cphys = this.physParams.copy();

	RewardFunction rf = this.rf;
	TerminalFunction tf = this.tf;

	if(rf == null){
		rf = new CartPoleRewardFunction();
	}
	if(tf == null){
		tf = new CartPoleTerminalFunction();
	}

	FullStateModel smodel = cphys.useCorrectModel ? new CPClassicModel(cphys) : new CPClassicModel(cphys);

	FactoredModel model = new FactoredModel(smodel, rf, tf);
	domain.setModel(model);


	domain.addActionType(new UniversalActionType(ACTION_LEFT))
			.addActionType(new UniversalActionType(ACTION_RIGHT));


	return domain;
}