Learn R Programming

pomdp (version 1.0.0)

policy: Extract the Policy from a POMDP/MDP

Description

Extracts the policy from a solved POMDP/MDP.

Usage

policy(x)

Arguments

x

A solved POMDP object.

Value

A list with the policy for each epoch.

Details

A list (one entry per epoch) with the optimal policy. For converged, infinite-horizon problems solutions, a list with only the converged solution is produced. The policy is a data.frame consisting o:

  • Part 1: The value function with one column per state. (For MDPs this is just one column with the state).

  • Part 2: One column with the optimal action.

See Also

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

Examples

Run this code
# NOT RUN {
data("Tiger")

# Infinite horizon
sol <- solve_POMDP(model = Tiger)
sol

# policy with value function, optimal action and transitions for observations.
policy(sol)
plot_value_function(sol)

# Finite horizon (we use incremental pruning because grid does not converge)
sol <- solve_POMDP(model = Tiger, method = "incprune", horizon = 3, discount = 1)
sol

policy(sol)
# Note: We see that it is initially better to listen till we make a decision in the final epoch. 
# }

Run the code above in your browser using DataLab