.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/demo_agents/video_plot_rsucbvi.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_agents_video_plot_rsucbvi.py: ================================================== A demo of RSUCBVI algorithm in MountainCar environment ================================================== Illustration of how to set up an RSUCBVI algorithm in rlberry. The environment chosen here is MountainCar environment. .. video:: ../../video_plot_rsucbvi.mp4 :width: 600 .. GENERATED FROM PYTHON SOURCE LINES 12-30 .. code-block:: python3 from rlberry_research.agents import RSUCBVIAgent from rlberry_research.envs.classic_control import MountainCar env = MountainCar() horizon = 170 print("Running RS-UCBVI on %s" % env.name) agent = RSUCBVIAgent(env, gamma=0.99, horizon=horizon, bonus_scale_factor=0.1) agent.fit(budget=500) env.enable_rendering() observation, info = env.reset() for tt in range(200): action = agent.policy(observation) observation, reward, terminated, truncated, info = env.step(action) done = terminated or truncated video = env.save_video("_video/video_plot_rsucbvi.mp4") .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.000 seconds) .. _sphx_glr_download_auto_examples_demo_agents_video_plot_rsucbvi.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_rsucbvi.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: video_plot_rsucbvi.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_