Utilities for generating gifs of POMDPs.jl models.
In the julia REPL:
using Pkg
Pkg.add("POMDPGifs")Currently, there are two utilities:
- A
GifSimulatorto be used with thesimulatefunction. - A
makegifconvenience function to (1) run a simulation and create a gif, or (2) create a gif from a model.
GifSimulator(kwargs...). Create a simulator for producing a gif output by calling POMDPTools.render at each step.
Keyword Arguments
filename::String=tempname()*".gif"fps::Int=2: frames per secondspec::Any: specification for which elements of a step to render (seePOMDPTools.eachstep)max_steps::Int=nothingrng::AbstractRNG=GLOBAL_RNGshow_progress::Boolextra_initial::Boolif set to true, the simulator adds an extra step at time 0 (before first transition)extra_final::Bollif set to true, the simulator adds an extra setp at the end (after the last transition)render_kwargs: keyword args to be fed toPOMDPTools.render
makegif(m; kwargs...)
makegif(m, policy; kwargs...)
makegif(m, policy, args...; kwargs...)Create a gif of a single simulation of a POMDP or MDP by calling POMDPTools.render at each step.
Arguments:
m::Union{POMDP,MDP}: the model to be simulated
All other positional arguments, for instance a policy, updater, initial state, etc. will be fed to the simulate function. See POMDPTools Simulators documentation for more info.
Keyword Arguments
All keyword arguments are fed to the GifSimulator constructor. See its documentation for more info.