Skip to content

Latest commit

 

History

History
50 lines (33 loc) · 2.53 KB

interface_extensions.md

File metadata and controls

50 lines (33 loc) · 2.53 KB

Interface Extensions

POMDPModelTools contains several interface extensions that provide shortcuts and standardized ways of dealing with extra data.

Programmers should use these functions whenever possible in case optimized implementations are available, but all of the functions have default implementations based on the core POMDPs.jl interface. Thus, if the core interface is implemented, all of these functions will also be available.

Weighted Iteration

Many solution techniques, for example value iteration, require iteration through the support of a distribution and evaluating the probability mass for each value. In some cases, looking up the probability mass is expensive, so it is more efficient to iterate through value => probability pairs. weighted_iterator provides a standard interface for this.

weighted_iterator

Observation Weight

Sometimes, e.g. in particle filtering, the relative likelihood of an observation is required in addition to a generative model, and it is often tedious to implement a custom observation distribution type. For this case, the shortcut function obs_weight is provided.

obs_weight

Ordered Spaces

It is often useful to have a list of states, actions, or observations ordered consistently with the respective _index function from POMDPs.jl. Since the POMDPs.jl interface does not demand that spaces be ordered consistently with _index, the states, actions, and observations functions are not sufficient. Thus POMDPModelTools provides ordered_actions, ordered_states, and ordered_observations to provide this capability.

ordered_actions
ordered_states
ordered_observations

Info Interface

It is often the case that useful information besides the belief, state, action, etc is generated by a function in POMDPs.jl. This information can be useful for debugging or understanding the behavior of a solver, updater, or problem. The info interface provides a standard way for problems, policies, solvers or updaters to output this information. The recording simulators from POMDPSimulators.jl automatically record this information.

To specify info for a problem (in POMDPs v0.8 and above), one should modify the problem's DDN with the add_infonode function, then return the info in gen. There is an example of this pattern in the docstring below:

add_infonode

To specify info from policies, solvers, or updaters, implement the following functions:

action_info
solve_info
update_info