Learn R Programming

pomdp (version 1.0.0)

optimal_action: Optimal action for a belief

Description

Determines the optimal action for a policy (solved POMDP) for a given belief at a given epoch.

Usage

optimal_action(model, belief, epoch = 1)

Arguments

model

a solved POMDP.

belief

The belief (probability distribution over the states) as a vector or a matrix with multiple belief states as rows.

epoch

what epoch of the policy should be used.

Value

The name of the optimal action.

See Also

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

Examples

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

sol <- solve_POMDP(model = Tiger)

# these are the states
sol$states

# belief that tiger is to the left
optimal_action(sol, c(1, 0))
optimal_action(sol, "tiger-left")

# belief that tiger is to the right
optimal_action(sol, c(0, 1))
optimal_action(sol, "tiger-right")

# belief is 50/50
optimal_action(sol, c(.5, .5))
optimal_action(sol, "uniform")

# the POMDP is converged, so all epoch give the same result.
optimal_action(sol, "tiger-right", epoch = 10)

# }

Run the code above in your browser using DataLab