PDDLViz.AnimationType
Animation

Displayable animation which wraps a VideoStream object. Can be displayed with show(io, MIME"text/html"(), anim), or saved with save(path, anim).

PDDLViz.BasicGraphicType
BasicGraphic(shape; attributes...)

Basic graphic type, containing a primitive shape and a dictionary of attributes.

PDDLViz.CanvasType
Canvas

A Canvas is a mutable container for renderable outputs produced by a Renderer, consisting of a reference to the figure and grid layout on which the output is rendered, the PDDL State that the output is based on, and a dictionary of additional Observables.

PDDLViz.ControllerType
Controller

Abstract supertype for all controllers. When attached to a canvas, a controller interprets user input as PDDL actions and updates the canvas accordingly.

Can be attached to a canvas using add_controller!, and removed using remove_controller.

PDDLViz.GraphworldRendererType
GraphworldRenderer(; options...)

Customizable renderer for domains with fixed locations connected in a graph.

Options

  • graph_layout::Union{Function, NetworkLayout.AbstractLayout}: Function or AbstractLayout that maps a graph to node locations.

  • is_directed::Bool: Whether the graph edges are directed.

  • location_types::Vector{Symbol}: PDDL object types that correspond to fixed locations.

  • movable_types::Vector{Symbol}: PDDL object types that correspond to movable objects.

  • edge_fn::Function: Function (dom, state, a, b) -> Bool that checks if (a, b) is present.

  • edge_label_fn::Function: Function (dom, state, a, b) -> String that returns a label for (a, b).

  • at_loc_fn::Function: Function (dom, state, x, loc) -> Bool that returns if x is at loc.

  • loc_renderers::Dict{Symbol, Function}: Per-type location renderers, of the form (domain, state, loc) -> Graphic.

  • obj_renderers::Dict{Symbol, Function}: Per-type object renderers, of the form (domain, state, obj) -> Graphic.

  • state_options::Dict{Symbol, Any}: Default options for state rendering.

  • graph_options::Dict{Symbol, Any}: Default options for graph rendering, passed to the graphplot recipe.

PDDLViz.GridworldRendererType
GridworldRenderer(; options...)

Customizable renderer for 2D gridworld domains.

Options

  • grid_fluents::Vector{Julog.Term}: PDDL fluents that represent the grid layers (walls, etc).

  • grid_colors::Vector: Colors for each grid layer.

  • has_agent::Bool: Whether the domain has an agent not associated with a PDDL object.

  • get_agent_x::Function: Function that returns the PDDL fluent for the agent's x position.

  • get_agent_y::Function: Function that returns the PDDL fluent for the agent's y position.

  • get_obj_x::Function: Takes an object constant and returns the PDDL fluent for its x position.

  • get_obj_y::Function: Takes an object constant and returns the PDDL fluent for its y position.

  • agent_renderer::Function: Agent renderer, of the form (domain, state) -> Graphic.

  • obj_renderers::Dict{Symbol, Function}: Per-type object renderers, of the form (domain, state, obj) -> Graphic.

  • obj_type_z_order::Vector{Symbol}: Z-order for object types, from bottom to top.

  • locations::Vector{Tuple}: List of (x, y, label, color) tuples to label locations on the grid.

  • show_inventory::Bool: Whether to show an object inventory for each function in inventory_fns.

  • inventory_fns::Vector{Function}: Inventory indicator functions of the form (domain, state, obj) -> Bool.

  • inventory_types::Vector{Symbol}: Types of objects that can be each inventory.

  • inventory_labels::Vector{String}: Axis titles / labels for each inventory.

  • state_options::Dict{Symbol, Any}: Default options for state rendering.

  • trajectory_options::Dict{Symbol, Any}: Default options for trajectory rendering.

PDDLViz.KeyboardControllerType
KeyboardController(options...)
KeyboardController(
    key1 => act1, key2 => act2, ...,
    extra_key1, extra_key2, ...;
    exclusive=true, callback=nothing
)

A controller that maps keyboard input to PDDL actions.

Options

  • keymap: A dictionary mapping keyboard keys to PDDL actions.

  • extrakeys: Keys mapped to remaining available actions (default: number keys).

  • extraprocess: Function (state, acts) -> acts that filters/processes remaining actions.

  • restart_key: Restart button if an initial state is specified.

  • exclusive: Whether an action is executed only if no other keys are pressed.

  • callback: Post-action callback f(canvas, domain, state, act, next_state).

  • obsfunc

PDDLViz.MarkerGraphicType
MarkerGraphic(marker, x, y, [w=1.0, h=w]; attributes...)

A marker graphic with a given position and size, rendered using scatter with the corresponding marker type.

PDDLViz.MultiGraphicType
MultiGraphic(graphics; attributes...)

Composite graphic type, containing a tuple of graphics in depth-order and a dictionary of attributes.

PDDLViz.RendererType
Renderer

A Renderer defines how a PDDL State for a specific Domain should be rendered. A concrete sub-type of Renderer should be implemented for a PDDL domain (or family of PDDL domains, e.g. 2D gridworlds) for users who wish to visualize that domain.

(r::Renderer)(domain::Domain, args...; options...)
(r::Renderer)(canvas::Canvas, domain::Domain, args...; options...)

Once a Renderer has been constructed, it can be used to render PDDL states and other entities by calling it with the appropriate arguments.

PDDLViz.TextGraphicType
TextGraphic(str, x, y, [fontsize]; attributes...)

A text graphic with a given position and [fontsize], rendered using the text plotting command.

PDDLViz.GemGraphicFunction

Gem prefab graphic, consisting of a N-gon and a smaller N-gon inside it.

PDDLViz.KeyGraphicFunction

Key prefab graphic, consisting of a key with a handle and two teeth.

PDDLViz.NgonShapeMethod

Construct a n-sided regular polygon centered at x and y with radius 1.

PDDLViz.RectShapeMethod

Construct a rectangle centered at x and y with width w and height h.

PDDLViz.TrapezoidShapeFunction

Construct a trapezoid at x and y with top and bottom width a, bottom width b, and height h. The top can be shifted by an offset (zero by default).

PDDLViz.add_controller!Function
add_controller!(canvas, controller, domain, [init_state];
                show_controls::Bool=false)

Adds a controller to a canvas for a given PDDL domain. An initial state init_state can be specified to enable restart functionality.

PDDLViz.anim_plan!Function
anim_plan([path], renderer, domain, state, actions;
          format="mp4", framerate=5, show=false, options...)
          
anim_plan!([path], canvas, renderer, domain, state, actions;
           format="mp4", framerate=5, show=is_displayed(canvas), options...)

Uses renderer to animate a series of actions in a PDDL domain starting from state (updating the canvas if one is provided). If a path is specified, the animation is saved to that file, and the path is returned. Otherwise, a Animation object is returned, which can be saved or displayed.

PDDLViz.anim_planMethod
anim_plan([path], renderer, domain, state, actions;
          format="mp4", framerate=5, show=false, options...)
          
anim_plan!([path], canvas, renderer, domain, state, actions;
           format="mp4", framerate=5, show=is_displayed(canvas), options...)

Uses renderer to animate a series of actions in a PDDL domain starting from state (updating the canvas if one is provided). If a path is specified, the animation is saved to that file, and the path is returned. Otherwise, a Animation object is returned, which can be saved or displayed.

PDDLViz.anim_trajectory!Function
anim_trajectory([path], renderer, domain, trajectory;
                format="mp4", framerate=5, show=false, options...)
                
anim_trajectory!([path], canvas, renderer, domain, trajectory;
                 format="mp4", framerate=5, show=is_displayed(canvas),
                 options...)

Uses renderer to animate a trajectory in a PDDL domain (updating the canvas if one is provided). If a path is specified, the animation is saved to that file, and the path is returned. Otherwise, a Animation object is returned, which can be saved or displayed.

PDDLViz.anim_trajectoryMethod
anim_trajectory([path], renderer, domain, trajectory;
                format="mp4", framerate=5, show=false, options...)
                
anim_trajectory!([path], canvas, renderer, domain, trajectory;
                 format="mp4", framerate=5, show=is_displayed(canvas),
                 options...)

Uses renderer to animate a trajectory in a PDDL domain (updating the canvas if one is provided). If a path is specified, the animation is saved to that file, and the path is returned. Otherwise, a Animation object is returned, which can be saved or displayed.

PDDLViz.new_canvasMethod
new_canvas(renderer::Renderer)
new_canvas(renderer::Renderer, figure::Figure)
new_canvas(renderer::Renderer, axis::Axis)
new_canvas(renderer::Renderer, gridpos::GridPosition)

Creates a new Canvas to be used by renderer. An existing figure, axis, or gridpos can be specified to use as the base for the new canvas.

PDDLViz.render_controls!Method
render_controls!(canvas, controller, domain)

Renders controls for a controller to a canvas.

PDDLViz.render_plan!Method
render_plan!(canvas, renderer, domain, state, actions)

Uses renderer to render a series of actions in a PDDL domain starting from state. Renders to a canvas on top of any existing content.

PDDLViz.render_planMethod
render_plan(renderer, domain, state, actions; options...)

Uses renderer to render a series of actions in a PDDL domain starting from state. Constructs and returns a new Canvas.

PDDLViz.render_sol!Method
render_sol!(canvas::Canvas, renderer::Renderer,
            domain::Domain, state::State, sol::Solution)

Uses renderer to render a planning solution sol starting from a state in a PDDL domain. Renders to a canvas on top of any existing content.

PDDLViz.render_solMethod
render_sol(renderer::Renderer,
           domain::Domain, state::State, sol::Solution)

Uses renderer to render a planning solution sol starting from a state in a PDDL domain. Constructs and returns a new Canvas.

PDDLViz.render_state!Method
render_state!(canvas, renderer, domain, state; options...)

Uses renderer to render a state of a PDDL domain to an existing canvas, rendering over any existing content.

PDDLViz.render_stateMethod
render_state(renderer, domain, state)

Uses renderer to render a state of a PDDL domain. Constructs and returns a new Canvas.

PDDLViz.render_trajectory!Method
render_trajectory!(canvas::Canvas, renderer::Renderer,
                   domain::Domain, trajectory::AbstractVector{<:State})

Uses renderer to render a trajectory of PDDL domain states. Renders to a canvas on top of any existing content.

PDDLViz.render_trajectoryMethod
render_trajectory(renderer::Renderer,
                  domain::Domain, trajectory::AbstractVector{<:State})

Uses renderer to render a trajectory of PDDL domain states. Constructs and returns a new Canvas.

PDDLViz.rotateFunction

Rotate a graphic by θ radians around a point c.

PDDLViz.scaleFunction

Scale by a horizontal factor x and vertical factor y around a point c.