.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/demo_env/video_plot_pball.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_demo_env_video_plot_pball.py: =============================== A demo of PBALL2D environment =============================== Illustration of PBall2D environment .. video:: ../../video_plot_pball.mp4 :width: 600 .. GENERATED FROM PYTHON SOURCE LINES 11-51 .. code-block:: python3 import numpy as np from rlberry_research.envs.benchmarks.ball_exploration import PBall2D p = 5 A = np.array([[1.0, 0.1], [-0.1, 1.0]]) reward_amplitudes = np.array([1.0, 0.5, 0.5]) reward_smoothness = np.array([0.25, 0.25, 0.25]) reward_centers = [ np.array([0.75 * np.cos(np.pi / 2), 0.75 * np.sin(np.pi / 2)]), np.array([0.75 * np.cos(np.pi / 6), 0.75 * np.sin(np.pi / 6)]), np.array([0.75 * np.cos(5 * np.pi / 6), 0.75 * np.sin(5 * np.pi / 6)]), ] action_list = [ 0.1 * np.array([1, 0]), -0.1 * np.array([1, 0]), 0.1 * np.array([0, 1]), -0.1 * np.array([0, 1]), ] env = PBall2D( p=p, A=A, reward_amplitudes=reward_amplitudes, reward_centers=reward_centers, reward_smoothness=reward_smoothness, action_list=action_list, ) env.enable_rendering() for ii in range(5): env.step(1) env.step(3) env.render() video = env.save_video("_video/video_plot_pball.mp4") .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.000 seconds) .. _sphx_glr_download_auto_examples_demo_env_video_plot_pball.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: video_plot_pball.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: video_plot_pball.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_