data("Tiger")
sol <- solve_POMDP(Tiger)
sol
# value function for the converged solution
value_function(sol)
plot_value_function(sol, ylim = c(0,20))
## finite-horizon problem
sol <- solve_POMDP(model = Tiger, horizon = 3, discount = 1,
method = "enum")
sol
# inspect the value function for all epochs
value_function(sol)
plot_value_function(sol, epoch = 1, ylim = c(-5, 25))
plot_value_function(sol, epoch = 2, ylim = c(-5, 25))
plot_value_function(sol, epoch = 3, ylim = c(-5, 25))
if (FALSE) {
# using ggplot2 to plot the value function for epoch 3
library(ggplot2)
pol <- policy(sol)
ggplot(pol[[3]]) +
geom_segment(aes(x = 0, y = `tiger-left`, xend = 1, yend = `tiger-right`, color = action)) +
coord_cartesian(ylim = c(-5, 15)) + ylab("Value") + xlab("Belief space")
}
Run the code above in your browser using DataLab