Last active
September 27, 2015 14:18
-
-
Save ConnorDoyle/1283295 to your computer and use it in GitHub Desktop.
POMDP Model Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.enmas.pomdp._ | |
import org.enmas.pomdp.State.Implicits._ | |
case class SimplePOMDP extends POMDP ( | |
name = "Example POMDP", | |
description = "Just a simple POMDP", | |
agentConstraints = List( | |
AgentConstraint('TeamA, 1, Int.MaxValue) | |
), | |
initialState = State("time" -> 0), | |
actionsFunction = (_) => Set( | |
Action("win"), | |
Action("lose") | |
), | |
transitionFunction = (state, actions) => { | |
val t = state.getAs[Int]("time") getOrElse 0 | |
State("time" -> (t + 1)) | |
}, | |
rewardFunction = (state, actions, statePrime) => (aNum, aType) => { | |
val allChoseWin = actions.foldLeft(true) { | |
(result, a) => result && a.action == Action("win") | |
} | |
if (allChoseWin) 1 | |
else 0 | |
}, | |
observationFunction = (state, actions, statePrime) => (aNum, aType) => state | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment