write_POMDP: Read and write a POMDP Model to a File in POMDP Format

View source: R/read_write_POMDP.R

write_POMDPR Documentation

Read and write a POMDP Model to a File in POMDP Format

Description

Reads and write a POMDP file suitable for the pomdp-solve program.

Usage

write_POMDP(x, file, digits = 7)

read_POMDP(file, parse = TRUE, normalize = TRUE)

Arguments

x

an object of class POMDP.

file

a file name. read_POMDP() also accepts connections including URLs.

digits

precision for writing numbers (digits after the decimal point).

parse

logical; try to parse the model matrices. Solvers still work with unparsed matrices, but helpers for simulation are not available.

normalize

logical; should the description be normalized for faster access (see normalize_POMDP())?

Details

POMDP objects read from a POMDP file have an extra element called problem which contains the original POMDP specification. The original specification is directly used by external solvers. In addition, the file is parsed using an experimental POMDP file parser. The parsed information can be used with auxiliary functions in this package that use fields like the transition matrix, the observation matrix and the reward structure.

Notes: The parser for POMDP files is experimental. Please report problems here: https://github.com/mhahsler/pomdp/issues.

Value

read_POMDP() returns a POMDP object.

Author(s)

Hossein Kamalzadeh, Michael Hahsler

References

POMDP solver website: https://www.pomdp.org

See Also

Other POMDP: POMDP_accessors, POMDP(), plot_belief_space(), projection(), regret(), sample_belief_space(), simulate_POMDP(), solve_POMDP(), solve_SARSOP(), transition_graph(), update_belief(), value_function()

Examples

data(Tiger)

## show the POMDP file that would be written.
write_POMDP(Tiger, file = stdout())

pomdp documentation built on Sept. 9, 2023, 1:07 a.m.