Learn R Programming

pomdp (version 1.0.0)

sample_belief_space: Sample from the Belief Space

Description

Sample randomly (uniform) or regularly spaced points from the projected belief space.

Usage

sample_belief_space(model, projection = NULL, n = 1000, method = "random")

Arguments

model

a unsolved or solved POMDP.

projection

Sample in a projected belief space. All states not included in the projection are held at a belief of 0. NULL means no projection.

n

size of the sample.

method

character string specifying the sampling strategy. Available are "random", "regular", and "vertices".

Value

Returns a matrix. Each row is a sample from the belief space.

Details

Several sampling methods are implemented:

  • 'random' samples uniformly sample from the projected belief space using the method described by Luc Devroye (1986).

  • 'regular' samples points using a regularly spaced grid. This method is only available for projections on 2 or 3 states.

  • 'vertices' only samples from the vertices of the belief space.

References

Luc Devroye, Non-Uniform Random Variate Generation, Springer Verlag, 1986.

See Also

Other POMDP: POMDP(), plot_belief_space(), simulate_POMDP(), solve_POMDP(), solve_SARSOP(), transition_matrix(), update_belief(), write_POMDP()

Examples

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

sample_belief_space(Tiger, n = 5)
sample_belief_space(Tiger, n = 5, method = "regular")

# sample and calculate the reward for a solve POMDP
sol <- solve_POMDP(Tiger)
reward(sol, belief = sample_belief_space(sol, n = 5, method = "regular"))
# }

Run the code above in your browser using DataLab