Learn R Programming

pomdp (version 1.0.0)

plot_value_function: Plot the Value Function of a POMDP Solution

Description

Plots the value function of a POMDP solution as a line plot. The solution is projected on two states (i.e., the belief for the other states is held constant at zero).

Usage

plot_value_function(
  model,
  projection = 1:2,
  epoch = 1,
  ylim = NULL,
  legend = TRUE,
  col = NULL,
  lwd = 1,
  lty = 1,
  ...
)

Arguments

model

a solved POMDP.

projection

index or name of two states for the projection.

epoch

the value function of what epoch should be plotted? Ignored for infinite-horizon solutions.

ylim

the y limits of the plot.

legend

logical; add a legend?

col

potting colors.

lwd

line width.

lty

line type.

...

additional arguments are passed on to stats::line()`.

See Also

Other policy: optimal_action(), plot_policy_graph(), policy_graph(), policy(), reward(), solve_POMDP(), solve_SARSOP()

Examples

Run this code
# NOT RUN {
data("Tiger")
sol <- solve_POMDP(model = Tiger)
sol

plot_value_function(sol, ylim = c(0,20))

## finite-horizon
sol <- solve_POMDP(model = Tiger, horizon = 3, discount = 1,
  method = "enum")
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))
# }

Run the code above in your browser using DataLab