Notebook helpers#

module:

navground.sim.notebook

Helpers to display simulations in Jupyter notebooks.

Displays a world in the notebook.

Parameters:

The actual configuration is computed by looking (in order) to

  1. the arguments of this function;

  2. the world-specific configuration navground.sim.World.render_kwargs;

  3. the default configuration navground.sim.ui.render_default_config.

Note

A notebook will display a world in a cell that evaluates a navground.sim.World, using its SVG representation navground.sim.World._repr_svg_, which has the same effect of calling this function with no optional arguments.

Display an empty world view in a jupyter notebook ready for a a navground.sim.ui.WebUI to keep it up-to-date.

Parameters:
Returns:

A HTML view

Perform a simulation and displays the recorded video in a notebook

Parameters:
  • world – The world to simulate

  • time_step – The time step

  • duration – The simulation duration

  • factor – The real-time factor

  • width – The size of the view

  • port – The websocket port

  • kwargs – Arguments forwarded to navground.sim.ui.html_for_world()