mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-08-19 21:42:02 +00:00
1457 lines
87 KiB
HTML
1457 lines
87 KiB
HTML
![]() |
<!doctype html>
|
|||
|
<html class="no-js" lang="en" data-content_root="../../../">
|
|||
|
<head><meta charset="utf-8"/>
|
|||
|
<meta name="viewport" content="width=device-width,initial-scale=1"/>
|
|||
|
<meta name="color-scheme" content="light dark">
|
|||
|
<meta name="description" content="A standard API for reinforcement learning and a diverse set of reference environments (formerly Gym)">
|
|||
|
<meta property="og:title" content="Gymnasium Documentation" />
|
|||
|
<meta property="og:type" content="website" />
|
|||
|
<meta property="og:description" content="A standard API for reinforcement learning and a diverse set of reference environments (formerly Gym)" />
|
|||
|
<meta property="og:url" content="https://gymnasium.farama.org/environments/mujoco/ant.html" /><meta property="og:image" content="https://gymnasium.farama.org/_static/img/gymnasium-github.png" /><meta name="twitter:card" content="summary_large_image"><meta name="viewport" content="width=device-width, initial-scale=1" />
|
|||
|
<link rel="index" title="Index" href="../../../genindex/" /><link rel="search" title="Search" href="../../../search/" /><link rel="next" title="Half Cheetah" href="../half_cheetah/" /><link rel="prev" title="MuJoCo" href="../" />
|
|||
|
<link rel="canonical" href="https://gymnasium.farama.org/environments/mujoco/ant.html" />
|
|||
|
|
|||
|
<link rel="shortcut icon" href="../../../_static/favicon.png"/><!-- Generated with Sphinx 7.3.7 and Furo 2023.08.19.dev1 -->
|
|||
|
<title>Ant - Gymnasium Documentation</title>
|
|||
|
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=a746c00c" />
|
|||
|
<link rel="stylesheet" type="text/css" href="../../../_static/styles/furo.css?v=3e7f4c72" />
|
|||
|
<link rel="stylesheet" type="text/css" href="../../../_static/sg_gallery.css?v=61a4c737" />
|
|||
|
<link rel="stylesheet" type="text/css" href="../../../_static/sg_gallery-binder.css?v=f4aeca0c" />
|
|||
|
<link rel="stylesheet" type="text/css" href="../../../_static/sg_gallery-dataframe.css?v=2082cf3c" />
|
|||
|
<link rel="stylesheet" type="text/css" href="../../../_static/sg_gallery-rendered-html.css?v=1277b6f3" />
|
|||
|
<link rel="stylesheet" type="text/css" href="../../../_static/styles/furo-extensions.css?v=49cbaffd" />
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<style>
|
|||
|
body {
|
|||
|
--color-code-background: #f8f8f8;
|
|||
|
--color-code-foreground: black;
|
|||
|
|
|||
|
}
|
|||
|
@media not print {
|
|||
|
body[data-theme="dark"] {
|
|||
|
--color-code-background: #202020;
|
|||
|
--color-code-foreground: #d0d0d0;
|
|||
|
|
|||
|
}
|
|||
|
@media (prefers-color-scheme: dark) {
|
|||
|
body:not([data-theme="light"]) {
|
|||
|
--color-code-background: #202020;
|
|||
|
--color-code-foreground: #d0d0d0;
|
|||
|
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
</style></head>
|
|||
|
<body>
|
|||
|
<header class="farama-header" aria-label="Farama header">
|
|||
|
<div class="farama-header__container">
|
|||
|
<div class="farama-header__left--mobile">
|
|||
|
<label class="nav-overlay-icon" for="__navigation">
|
|||
|
<div class="visually-hidden">Toggle site navigation sidebar</div>
|
|||
|
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|||
|
<defs></defs>
|
|||
|
<line x1="0.5" y1="4" x2="23.5" y2="4"></line>
|
|||
|
<line x1="0.232" y1="12" x2="23.5" y2="12"></line>
|
|||
|
<line x1="0.232" y1="20" x2="23.5" y2="20"></line>
|
|||
|
</svg>
|
|||
|
</label>
|
|||
|
</div>
|
|||
|
<div class="farama-header__left farama-header__center--mobile">
|
|||
|
<a href="../../../">
|
|||
|
<img class="farama-header__logo only-light" src="../../../_static/img/gymnasium_black.svg" alt="Light Logo"/>
|
|||
|
<img class="farama-header__logo only-dark" src="../../../_static/img/gymnasium_white.svg" alt="Dark Logo"/>
|
|||
|
<span class="farama-header__title">Gymnasium Documentation</span>
|
|||
|
</a>
|
|||
|
</div>
|
|||
|
<div class="farama-header__right">
|
|||
|
<div class="farama-header-menu">
|
|||
|
<button class="farama-header-menu__btn" aria-label="Open Farama Menu" aria-expanded="false" aria-haspopup="true" aria-controls="farama-menu">
|
|||
|
<img class="farama-black-logo-invert" src="../../../_static/img/farama-logo-header.svg">
|
|||
|
<svg viewBox="0 0 24 24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|||
|
<polyline style="stroke-linecap: round; stroke-linejoin: round; fill: none; stroke-width: 2px;" points="1 7 12 18 23 7"></polyline>
|
|||
|
</svg>
|
|||
|
</button>
|
|||
|
<div class="farama-header-menu-container farama-hidden" aria-hidden="true" id="farama-menu">
|
|||
|
<div class="farama-header-menu__header">
|
|||
|
<a href="https://farama.org">
|
|||
|
<img class="farama-header-menu__logo farama-white-logo-invert" src="../../../_static/img/farama_solid_white.svg" alt="Farama Foundation logo">
|
|||
|
<span>Farama Foundation</span>
|
|||
|
</a>
|
|||
|
<div class="farama-header-menu-header__right">
|
|||
|
<button id="farama-close-menu">
|
|||
|
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor"
|
|||
|
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon-close">
|
|||
|
<line x1="3" y1="21" x2="21" y2="3"></line>
|
|||
|
<line x1="3" y1="3" x2="21" y2="21"></line>
|
|||
|
</svg>
|
|||
|
</button>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="farama-header-menu__body">
|
|||
|
<!-- Response from farama.org/api/projects.json -->
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</header>
|
|||
|
|
|||
|
|
|||
|
<script>
|
|||
|
document.body.dataset.theme = localStorage.getItem("theme") || "auto";
|
|||
|
</script>
|
|||
|
|
|||
|
|
|||
|
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
|
|||
|
<symbol id="svg-toc" viewBox="0 0 24 24">
|
|||
|
<title>Contents</title>
|
|||
|
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 1024 1024">
|
|||
|
<path d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 0 0 0 13.8z"/>
|
|||
|
</svg>
|
|||
|
</symbol>
|
|||
|
<symbol id="svg-menu" viewBox="0 0 24 24">
|
|||
|
<title>Menu</title>
|
|||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|||
|
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-menu">
|
|||
|
<line x1="3" y1="12" x2="21" y2="12"></line>
|
|||
|
<line x1="3" y1="6" x2="21" y2="6"></line>
|
|||
|
<line x1="3" y1="18" x2="21" y2="18"></line>
|
|||
|
</svg>
|
|||
|
</symbol>
|
|||
|
<symbol id="svg-arrow-right" viewBox="0 0 24 24">
|
|||
|
<title>Expand</title>
|
|||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|||
|
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-chevron-right">
|
|||
|
<polyline points="9 18 15 12 9 6"></polyline>
|
|||
|
</svg>
|
|||
|
</symbol>
|
|||
|
<symbol id="svg-sun" viewBox="0 0 24 24">
|
|||
|
<title>Light mode</title>
|
|||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|||
|
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather-sun">
|
|||
|
<circle cx="12" cy="12" r="5"></circle>
|
|||
|
<line x1="12" y1="1" x2="12" y2="3"></line>
|
|||
|
<line x1="12" y1="21" x2="12" y2="23"></line>
|
|||
|
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
|
|||
|
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
|
|||
|
<line x1="1" y1="12" x2="3" y2="12"></line>
|
|||
|
<line x1="21" y1="12" x2="23" y2="12"></line>
|
|||
|
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
|
|||
|
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
|
|||
|
</svg>
|
|||
|
</symbol>
|
|||
|
<symbol id="svg-moon" viewBox="0 0 24 24">
|
|||
|
<title>Dark mode</title>
|
|||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|||
|
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-moon">
|
|||
|
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
|||
|
<path d="M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z" />
|
|||
|
</svg>
|
|||
|
</symbol>
|
|||
|
<symbol id="svg-sun-half" viewBox="0 0 24 24">
|
|||
|
<title>Auto light/dark mode</title>
|
|||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|||
|
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-shadow">
|
|||
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
|||
|
<circle cx="12" cy="12" r="9" />
|
|||
|
<path d="M13 12h5" />
|
|||
|
<path d="M13 15h4" />
|
|||
|
<path d="M13 18h1" />
|
|||
|
<path d="M13 9h4" />
|
|||
|
<path d="M13 6h1" />
|
|||
|
</svg>
|
|||
|
</symbol>
|
|||
|
</svg>
|
|||
|
|
|||
|
<input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation">
|
|||
|
<input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc">
|
|||
|
<label class="overlay sidebar-overlay" for="__navigation">
|
|||
|
<div class="visually-hidden">Hide navigation sidebar</div>
|
|||
|
</label>
|
|||
|
<label class="overlay toc-overlay" for="__toc">
|
|||
|
<div class="visually-hidden">Hide table of contents sidebar</div>
|
|||
|
</label>
|
|||
|
|
|||
|
<div class="page">
|
|||
|
<!--<header class="mobile-header">
|
|||
|
<div class="header-left">
|
|||
|
<label class="nav-overlay-icon" for="__navigation">
|
|||
|
<div class="visually-hidden">Toggle site navigation sidebar</div>
|
|||
|
<i class="icon"><svg><use href="#svg-menu"></use></svg></i>
|
|||
|
</label>
|
|||
|
</div>
|
|||
|
<div class="header-center">
|
|||
|
<a href="../../../"><div class="brand">Gymnasium Documentation</div></a>
|
|||
|
</div>
|
|||
|
<div class="header-right">
|
|||
|
<div class="theme-toggle-container theme-toggle-header">
|
|||
|
<button class="theme-toggle">
|
|||
|
<div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
|
|||
|
<svg class="theme-icon-when-auto"><use href="#svg-sun-half"></use></svg>
|
|||
|
<svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
|
|||
|
<svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
|
|||
|
</button>
|
|||
|
</div>
|
|||
|
<label class="toc-overlay-icon toc-header-icon" for="__toc">
|
|||
|
<div class="visually-hidden">Toggle table of contents sidebar</div>
|
|||
|
<i class="icon"><svg><use href="#svg-toc"></use></svg></i>
|
|||
|
</label>
|
|||
|
</div>
|
|||
|
</header>-->
|
|||
|
<aside class="sidebar-drawer">
|
|||
|
<div class="sidebar-container">
|
|||
|
|
|||
|
<div class="sidebar-sticky"><a class="farama-sidebar__title" href="../../../">
|
|||
|
<img class="farama-header__logo only-light" src="../../../_static/img/gymnasium_black.svg" alt="Light Logo"/>
|
|||
|
<img class="farama-header__logo only-dark" src="../../../_static/img/gymnasium_white.svg" alt="Dark Logo"/>
|
|||
|
<span class="farama-header__title">Gymnasium Documentation</span>
|
|||
|
</a><form class="sidebar-search-container" method="get" action="../../../search/" role="search">
|
|||
|
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
|
|||
|
<input type="hidden" name="check_keywords" value="yes">
|
|||
|
<input type="hidden" name="area" value="default">
|
|||
|
</form>
|
|||
|
<div id="searchbox"></div><div class="sidebar-scroll"><div class="sidebar-tree">
|
|||
|
<p class="caption" role="heading"><span class="caption-text">Introduction</span></p>
|
|||
|
<ul>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="../../../introduction/basic_usage/">Basic Usage</a></li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="../../../introduction/train_agent/">Training an Agent</a></li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="../../../introduction/create_custom_env/">Create a Custom Environment</a></li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="../../../introduction/record_agent/">Recording Agents</a></li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="../../../introduction/speed_up_env/">Speeding Up Training</a></li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="../../../introduction/gym_compatibility/">Compatibility with Gym</a></li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="../../../introduction/migration_guide/">Migration Guide - v0.21 to v1.0.0</a></li>
|
|||
|
</ul>
|
|||
|
<p class="caption" role="heading"><span class="caption-text">API</span></p>
|
|||
|
<ul>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="../../../api/env/">Env</a></li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="../../../api/registry/">Make and register</a></li>
|
|||
|
<li class="toctree-l1 has-children"><a class="reference internal" href="../../../api/spaces/">Spaces</a><input class="toctree-checkbox" id="toctree-checkbox-1" name="toctree-checkbox-1" role="switch" type="checkbox"/><label for="toctree-checkbox-1"><div class="visually-hidden">Toggle navigation of Spaces</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../../api/spaces/fundamental/">Fundamental Spaces</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../../api/spaces/composite/">Composite Spaces</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../../api/spaces/utils/">Spaces Utils</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li class="toctree-l1 has-children"><a class="reference internal" href="../../../api/wrappers/">Wrappers</a><input class="toctree-checkbox" id="toctree-checkbox-2" name="toctree-checkbox-2" role="switch" type="checkbox"/><label for="toctree-checkbox-2"><div class="visually-hidden">Toggle navigation of Wrappers</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../../api/wrappers/table/">List of Wrappers</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../../api/wrappers/misc_wrappers/">Misc Wrappers</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../../api/wrappers/action_wrappers/">Action Wrappers</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../../api/wrappers/observation_wrappers/">Observation Wrappers</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../../api/wrappers/reward_wrappers/">Reward Wrappers</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li class="toctree-l1 has-children"><a class="reference internal" href="../../../api/vector/">Vectorize</a><input class="toctree-checkbox" id="toctree-checkbox-3" name="toctree-checkbox-3" role="switch" type="checkbox"/><label for="toctree-checkbox-3"><div class="visually-hidden">Toggle navigation of Vectorize</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../../api/vector/wrappers/">Wrappers</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../../api/vector/async_vector_env/">AsyncVectorEnv</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../../api/vector/sync_vector_env/">SyncVectorEnv</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../../api/vector/utils/">Utility functions</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="../../../api/utils/">Utility functions</a></li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="../../../api/functional/">Functional Env</a></li>
|
|||
|
</ul>
|
|||
|
<p class="caption" role="heading"><span class="caption-text">Environments</span></p>
|
|||
|
<ul class="current">
|
|||
|
<li class="toctree-l1 has-children"><a class="reference internal" href="../../classic_control/">Classic Control</a><input class="toctree-checkbox" id="toctree-checkbox-4" name="toctree-checkbox-4" role="switch" type="checkbox"/><label for="toctree-checkbox-4"><div class="visually-hidden">Toggle navigation of Classic Control</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../classic_control/acrobot/">Acrobot</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../classic_control/cart_pole/">Cart Pole</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../classic_control/mountain_car_continuous/">Mountain Car Continuous</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../classic_control/mountain_car/">Mountain Car</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../classic_control/pendulum/">Pendulum</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li class="toctree-l1 has-children"><a class="reference internal" href="../../box2d/">Box2D</a><input class="toctree-checkbox" id="toctree-checkbox-5" name="toctree-checkbox-5" role="switch" type="checkbox"/><label for="toctree-checkbox-5"><div class="visually-hidden">Toggle navigation of Box2D</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../box2d/bipedal_walker/">Bipedal Walker</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../box2d/car_racing/">Car Racing</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../box2d/lunar_lander/">Lunar Lander</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li class="toctree-l1 has-children"><a class="reference internal" href="../../toy_text/">Toy Text</a><input class="toctree-checkbox" id="toctree-checkbox-6" name="toctree-checkbox-6" role="switch" type="checkbox"/><label for="toctree-checkbox-6"><div class="visually-hidden">Toggle navigation of Toy Text</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../toy_text/blackjack/">Blackjack</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../toy_text/taxi/">Taxi</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../toy_text/cliff_walking/">Cliff Walking</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../toy_text/frozen_lake/">Frozen Lake</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li class="toctree-l1 current has-children"><a class="reference internal" href="../">MuJoCo</a><input checked="" class="toctree-checkbox" id="toctree-checkbox-7" name="toctree-checkbox-7" role="switch" type="checkbox"/><label for="toctree-checkbox-7"><div class="visually-hidden">Toggle navigation of MuJoCo</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul class="current">
|
|||
|
<li class="toctree-l2 current current-page"><a class="current reference internal" href="#">Ant</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../half_cheetah/">Half Cheetah</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../hopper/">Hopper</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../humanoid/">Humanoid</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../humanoid_standup/">Humanoid Standup</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../inverted_double_pendulum/">Inverted Double Pendulum</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../inverted_pendulum/">Inverted Pendulum</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../pusher/">Pusher</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../reacher/">Reacher</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../swimmer/">Swimmer</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../walker2d/">Walker2D</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li class="toctree-l1 has-children"><a class="reference internal" href="../../atari/">Atari</a><input class="toctree-checkbox" id="toctree-checkbox-8" name="toctree-checkbox-8" role="switch" type="checkbox"/><label for="toctree-checkbox-8"><div class="visually-hidden">Toggle navigation of Atari</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/adventure/">Adventure</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/air_raid/">AirRaid</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/alien/">Alien</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/amidar/">Amidar</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/assault/">Assault</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/asterix/">Asterix</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/asteroids/">Asteroids</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/atlantis/">Atlantis</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/atlantis2/">Atlantis2</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/backgammon/">Backgammon</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/bank_heist/">BankHeist</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/basic_math/">BasicMath</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/battle_zone/">BattleZone</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/beam_rider/">BeamRider</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/berzerk/">Berzerk</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/blackjack/">Blackjack</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/bowling/">Bowling</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/boxing/">Boxing</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/breakout/">Breakout</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/carnival/">Carnival</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/casino/">Casino</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/centipede/">Centipede</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/chopper_command/">ChopperCommand</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/crazy_climber/">CrazyClimber</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/crossbow/">Crossbow</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/darkchambers/">Darkchambers</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/defender/">Defender</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/demon_attack/">DemonAttack</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/donkey_kong/">DonkeyKong</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/double_dunk/">DoubleDunk</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/earthworld/">Earthworld</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/elevator_action/">ElevatorAction</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/enduro/">Enduro</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/entombed/">Entombed</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/et/">Et</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/fishing_derby/">FishingDerby</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/flag_capture/">FlagCapture</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/freeway/">Freeway</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/frogger/">Frogger</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/frostbite/">Frostbite</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/galaxian/">Galaxian</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/gopher/">Gopher</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/gravitar/">Gravitar</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/hangman/">Hangman</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/haunted_house/">HauntedHouse</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/hero/">Hero</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/human_cannonball/">HumanCannonball</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/ice_hockey/">IceHockey</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/jamesbond/">Jamesbond</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/journey_escape/">JourneyEscape</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/kaboom/">Kaboom</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/kangaroo/">Kangaroo</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/keystone_kapers/">KeystoneKapers</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/king_kong/">KingKong</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/klax/">Klax</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/koolaid/">Koolaid</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/krull/">Krull</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/kung_fu_master/">KungFuMaster</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/laser_gates/">LaserGates</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/lost_luggage/">LostLuggage</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/mario_bros/">MarioBros</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/miniature_golf/">MiniatureGolf</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/montezuma_revenge/">MontezumaRevenge</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/mr_do/">MrDo</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/ms_pacman/">MsPacman</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/name_this_game/">NameThisGame</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/othello/">Othello</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/pacman/">Pacman</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/phoenix/">Phoenix</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/pitfall/">Pitfall</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/pitfall2/">Pitfall2</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/pong/">Pong</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/pooyan/">Pooyan</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/private_eye/">PrivateEye</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/qbert/">Qbert</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/riverraid/">Riverraid</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/road_runner/">RoadRunner</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/robotank/">Robotank</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/seaquest/">Seaquest</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/sir_lancelot/">SirLancelot</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/skiing/">Skiing</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/solaris/">Solaris</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/space_invaders/">SpaceInvaders</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/space_war/">SpaceWar</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/star_gunner/">StarGunner</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/superman/">Superman</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/surround/">Surround</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/tennis/">Tennis</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/tetris/">Tetris</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/tic_tac_toe_3d/">TicTacToe3D</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/time_pilot/">TimePilot</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/trondead/">Trondead</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/turmoil/">Turmoil</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/tutankham/">Tutankham</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/up_n_down/">UpNDown</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/venture/">Venture</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/video_checkers/">VideoCheckers</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/video_chess/">VideoChess</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/video_cube/">VideoCube</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/video_pinball/">VideoPinball</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/wizard_of_wor/">WizardOfWor</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/word_zapper/">WordZapper</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/yars_revenge/">YarsRevenge</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../atari/zaxxon/">Zaxxon</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="../../third_party_environments/">External Environments</a></li>
|
|||
|
</ul>
|
|||
|
<p class="caption" role="heading"><span class="caption-text">Tutorials</span></p>
|
|||
|
<ul>
|
|||
|
<li class="toctree-l1 has-children"><a class="reference internal" href="../../../tutorials/gymnasium_basics/">Gymnasium Basics</a><input class="toctree-checkbox" id="toctree-checkbox-9" name="toctree-checkbox-9" role="switch" type="checkbox"/><label for="toctree-checkbox-9"><div class="visually-hidden">Toggle navigation of Gymnasium Basics</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../../tutorials/gymnasium_basics/load_quadruped_model/">Load custom quadruped robot environments</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../../tutorials/gymnasium_basics/handling_time_limits/">Handling Time Limits</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../../tutorials/gymnasium_basics/implementing_custom_wrappers/">Implementing Custom Wrappers</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../../tutorials/gymnasium_basics/environment_creation/">Make your own custom environment</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../../tutorials/gymnasium_basics/vector_envs_tutorial/">Training A2C with Vector Envs and Domain Randomization</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li class="toctree-l1 has-children"><a class="reference internal" href="../../../tutorials/training_agents/">Training Agents</a><input class="toctree-checkbox" id="toctree-checkbox-10" name="toctree-checkbox-10" role="switch" type="checkbox"/><label for="toctree-checkbox-10"><div class="visually-hidden">Toggle navigation of Training Agents</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../../tutorials/training_agents/reinforce_invpend_gym_v26/">Training using REINFORCE for Mujoco</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../../tutorials/training_agents/blackjack_tutorial/">Solving Blackjack with Q-Learning</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../../tutorials/training_agents/FrozenLake_tuto/">Frozenlake benchmark</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="../../../tutorials/third-party-tutorials/">Third-Party Tutorials</a></li>
|
|||
|
<li class="toctree-l1"><a class="reference external" href="https://www.comet.com/docs/v2/integrations/ml-frameworks/gymnasium/?utm_source=gymnasium&utm_medium=partner&utm_campaign=partner_gymnasium_2023&utm_content=docs_gymnasium">Comet Tutorial</a></li>
|
|||
|
</ul>
|
|||
|
<p class="caption" role="heading"><span class="caption-text">Development</span></p>
|
|||
|
<ul>
|
|||
|
<li class="toctree-l1"><a class="reference external" href="https://github.com/Farama-Foundation/Gymnasium">Github</a></li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="../../../gymnasium_release_notes/">Gymnasium Release Notes</a></li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="../../../gym_release_notes/">Gym Release Notes</a></li>
|
|||
|
<li class="toctree-l1"><a class="reference external" href="https://github.com/Farama-Foundation/Gymnasium/blob/main/docs/README.md">Contribute to the Docs</a></li>
|
|||
|
</ul>
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
</div>
|
|||
|
</aside>
|
|||
|
<div class="main-container">
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<div class="main">
|
|||
|
<div class="content">
|
|||
|
<div class="article-container">
|
|||
|
<a href="#" class="back-to-top muted-link">
|
|||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|||
|
<path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12z"></path>
|
|||
|
</svg>
|
|||
|
<span>Back to top</span>
|
|||
|
</a>
|
|||
|
<div class="content-icon-container"><div class="theme-toggle-container theme-toggle-content">
|
|||
|
<button class="theme-toggle" title="Toggle color theme">
|
|||
|
<div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
|
|||
|
<svg class="theme-icon-when-auto">
|
|||
|
<use href="#svg-sun-half"></use>
|
|||
|
</svg>
|
|||
|
<svg class="theme-icon-when-dark">
|
|||
|
<use href="#svg-moon"></use>
|
|||
|
</svg>
|
|||
|
<svg class="theme-icon-when-light">
|
|||
|
<use href="#svg-sun"></use>
|
|||
|
</svg>
|
|||
|
</button>
|
|||
|
</div>
|
|||
|
<label class="toc-overlay-icon toc-content-icon" for="__toc">
|
|||
|
<div class="visually-hidden">Toggle table of contents sidebar</div>
|
|||
|
<i class="icon"><svg>
|
|||
|
<use href="#svg-toc"></use>
|
|||
|
</svg></i>
|
|||
|
</label>
|
|||
|
</div>
|
|||
|
<article role="main">
|
|||
|
|
|||
|
<section class="tex2jax_ignore mathjax_ignore" id="ant">
|
|||
|
<h1>Ant<a class="headerlink" href="#ant" title="Link to this heading">¶</a></h1>
|
|||
|
<figure class="align-default" id="id1">
|
|||
|
<a class="reference internal image-reference" href="../../../_images/ant.gif"><img alt="../../../_images/ant.gif" src="../../../_images/ant.gif" style="width: 200px;" />
|
|||
|
</a>
|
|||
|
</figure>
|
|||
|
<p>This environment is part of the Mujoco environments which contains general information about the environment.</p>
|
|||
|
<div class="table-wrapper colwidths-auto docutils container">
|
|||
|
<table class="docutils align-default">
|
|||
|
<thead>
|
|||
|
<tr class="row-odd"><th class="head"><p></p></th>
|
|||
|
<th class="head"><p></p></th>
|
|||
|
</tr>
|
|||
|
</thead>
|
|||
|
<tbody>
|
|||
|
<tr class="row-even"><td><p>Action Space</p></td>
|
|||
|
<td><p><code class="docutils literal notranslate"><span class="pre">Box(-1.0,</span> <span class="pre">1.0,</span> <span class="pre">(8,),</span> <span class="pre">float32)</span></code></p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p>Observation Space</p></td>
|
|||
|
<td><p><code class="docutils literal notranslate"><span class="pre">Box(-inf,</span> <span class="pre">inf,</span> <span class="pre">(105,),</span> <span class="pre">float64)</span></code></p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><p>import</p></td>
|
|||
|
<td><p><code class="docutils literal notranslate"><span class="pre">gymnasium.make("Ant-v5")</span></code></p></td>
|
|||
|
</tr>
|
|||
|
</tbody>
|
|||
|
</table>
|
|||
|
</div>
|
|||
|
<section id="description">
|
|||
|
<h2>Description<a class="headerlink" href="#description" title="Link to this heading">¶</a></h2>
|
|||
|
<p>This environment is based on the one introduced by Schulman, Moritz, Levine, Jordan, and Abbeel in <a class="reference external" href="https://arxiv.org/abs/1506.02438">“High-Dimensional Continuous Control Using Generalized Advantage Estimation”</a>.
|
|||
|
The ant is a 3D quadruped robot consisting of a torso (free rotational body) with four legs attached to it, where each leg has two body parts.
|
|||
|
The goal is to coordinate the four legs to move in the forward (right) direction by applying torque to the eight hinges connecting the two body parts of each leg and the torso (nine body parts and eight hinges).</p>
|
|||
|
<p>Note: Although the robot is called “Ant”, it is actually 75cm tall and weighs 910.88g, with the torso being 327.25g and each leg being 145.91g.</p>
|
|||
|
</section>
|
|||
|
<section id="action-space">
|
|||
|
<h2>Action Space<a class="headerlink" href="#action-space" title="Link to this heading">¶</a></h2>
|
|||
|
<figure class="align-default" id="id2">
|
|||
|
<img alt="../../../_images/ant.png" src="../../../_images/ant.png" />
|
|||
|
</figure>
|
|||
|
<p>The action space is a <code class="docutils literal notranslate"><span class="pre">Box(-1,</span> <span class="pre">1,</span> <span class="pre">(8,),</span> <span class="pre">float32)</span></code>. An action represents the torques applied at the hinge joints.</p>
|
|||
|
<div class="table-wrapper colwidths-auto docutils container">
|
|||
|
<table class="docutils align-default">
|
|||
|
<thead>
|
|||
|
<tr class="row-odd"><th class="head"><p>Num</p></th>
|
|||
|
<th class="head"><p>Action</p></th>
|
|||
|
<th class="head"><p>Control Min</p></th>
|
|||
|
<th class="head"><p>Control Max</p></th>
|
|||
|
<th class="head"><p>Name (in corresponding XML file)</p></th>
|
|||
|
<th class="head"><p>Joint</p></th>
|
|||
|
<th class="head"><p>Type (Unit)</p></th>
|
|||
|
</tr>
|
|||
|
</thead>
|
|||
|
<tbody>
|
|||
|
<tr class="row-even"><td><p>0</p></td>
|
|||
|
<td><p>Torque applied on the rotor between the torso and back right hip</p></td>
|
|||
|
<td><p>-1</p></td>
|
|||
|
<td><p>1</p></td>
|
|||
|
<td><p>hip_4 (right_back_leg)</p></td>
|
|||
|
<td><p>hinge</p></td>
|
|||
|
<td><p>torque (N m)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p>1</p></td>
|
|||
|
<td><p>Torque applied on the rotor between the back right two links</p></td>
|
|||
|
<td><p>-1</p></td>
|
|||
|
<td><p>1</p></td>
|
|||
|
<td><p>angle_4 (right_back_leg)</p></td>
|
|||
|
<td><p>hinge</p></td>
|
|||
|
<td><p>torque (N m)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><p>2</p></td>
|
|||
|
<td><p>Torque applied on the rotor between the torso and front left hip</p></td>
|
|||
|
<td><p>-1</p></td>
|
|||
|
<td><p>1</p></td>
|
|||
|
<td><p>hip_1 (front_left_leg)</p></td>
|
|||
|
<td><p>hinge</p></td>
|
|||
|
<td><p>torque (N m)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p>3</p></td>
|
|||
|
<td><p>Torque applied on the rotor between the front left two links</p></td>
|
|||
|
<td><p>-1</p></td>
|
|||
|
<td><p>1</p></td>
|
|||
|
<td><p>angle_1 (front_left_leg)</p></td>
|
|||
|
<td><p>hinge</p></td>
|
|||
|
<td><p>torque (N m)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><p>4</p></td>
|
|||
|
<td><p>Torque applied on the rotor between the torso and front right hip</p></td>
|
|||
|
<td><p>-1</p></td>
|
|||
|
<td><p>1</p></td>
|
|||
|
<td><p>hip_2 (front_right_leg)</p></td>
|
|||
|
<td><p>hinge</p></td>
|
|||
|
<td><p>torque (N m)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p>5</p></td>
|
|||
|
<td><p>Torque applied on the rotor between the front right two links</p></td>
|
|||
|
<td><p>-1</p></td>
|
|||
|
<td><p>1</p></td>
|
|||
|
<td><p>angle_2 (front_right_leg)</p></td>
|
|||
|
<td><p>hinge</p></td>
|
|||
|
<td><p>torque (N m)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><p>6</p></td>
|
|||
|
<td><p>Torque applied on the rotor between the torso and back left hip</p></td>
|
|||
|
<td><p>-1</p></td>
|
|||
|
<td><p>1</p></td>
|
|||
|
<td><p>hip_3 (back_leg)</p></td>
|
|||
|
<td><p>hinge</p></td>
|
|||
|
<td><p>torque (N m)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p>7</p></td>
|
|||
|
<td><p>Torque applied on the rotor between the back left two links</p></td>
|
|||
|
<td><p>-1</p></td>
|
|||
|
<td><p>1</p></td>
|
|||
|
<td><p>angle_3 (back_leg)</p></td>
|
|||
|
<td><p>hinge</p></td>
|
|||
|
<td><p>torque (N m)</p></td>
|
|||
|
</tr>
|
|||
|
</tbody>
|
|||
|
</table>
|
|||
|
</div>
|
|||
|
</section>
|
|||
|
<section id="observation-space">
|
|||
|
<h2>Observation Space<a class="headerlink" href="#observation-space" title="Link to this heading">¶</a></h2>
|
|||
|
<p>The observation space consists of the following parts (in order):</p>
|
|||
|
<ul class="simple">
|
|||
|
<li><p><em>qpos (13 elements by default):</em> Position values of the robot’s body parts.</p></li>
|
|||
|
<li><p><em>qvel (14 elements):</em> The velocities of these individual body parts (their derivatives).</p></li>
|
|||
|
<li><p><em>cfrc_ext (78 elements):</em> This is the center of mass based external forces on the body parts.
|
|||
|
It has shape 13 * 6 (<em>nbody * 6</em>) and hence adds another 78 elements to the state space.
|
|||
|
(external forces - force x, y, z and torque x, y, z)</p></li>
|
|||
|
</ul>
|
|||
|
<p>By default, the observation does not include the x- and y-coordinates of the torso.
|
|||
|
These can be included by passing <code class="docutils literal notranslate"><span class="pre">exclude_current_positions_from_observation=False</span></code> during construction.
|
|||
|
In this case, the observation space will be a <code class="docutils literal notranslate"><span class="pre">Box(-Inf,</span> <span class="pre">Inf,</span> <span class="pre">(107,),</span> <span class="pre">float64)</span></code>, where the first two observations are the x- and y-coordinates of the torso.
|
|||
|
Regardless of whether <code class="docutils literal notranslate"><span class="pre">exclude_current_positions_from_observation</span></code> is set to <code class="docutils literal notranslate"><span class="pre">True</span></code> or <code class="docutils literal notranslate"><span class="pre">False</span></code>, the x- and y-coordinates are returned in <code class="docutils literal notranslate"><span class="pre">info</span></code> with the keys <code class="docutils literal notranslate"><span class="pre">"x_position"</span></code> and <code class="docutils literal notranslate"><span class="pre">"y_position"</span></code>, respectively.</p>
|
|||
|
<p>By default, however, the observation space is a <code class="docutils literal notranslate"><span class="pre">Box(-Inf,</span> <span class="pre">Inf,</span> <span class="pre">(105,),</span> <span class="pre">float64)</span></code>, where the position and velocity elements are as follows:</p>
|
|||
|
<div class="table-wrapper colwidths-auto docutils container">
|
|||
|
<table class="docutils align-default">
|
|||
|
<thead>
|
|||
|
<tr class="row-odd"><th class="head"><p>Num</p></th>
|
|||
|
<th class="head"><p>Observation</p></th>
|
|||
|
<th class="head"><p>Min</p></th>
|
|||
|
<th class="head"><p>Max</p></th>
|
|||
|
<th class="head"><p>Name (in corresponding XML file)</p></th>
|
|||
|
<th class="head"><p>Joint</p></th>
|
|||
|
<th class="head"><p>Type (Unit)</p></th>
|
|||
|
</tr>
|
|||
|
</thead>
|
|||
|
<tbody>
|
|||
|
<tr class="row-even"><td><p>0</p></td>
|
|||
|
<td><p>z-coordinate of the torso (centre)</p></td>
|
|||
|
<td><p>-Inf</p></td>
|
|||
|
<td><p>Inf</p></td>
|
|||
|
<td><p>root</p></td>
|
|||
|
<td><p>free</p></td>
|
|||
|
<td><p>position (m)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p>1</p></td>
|
|||
|
<td><p>x-orientation of the torso (centre)</p></td>
|
|||
|
<td><p>-Inf</p></td>
|
|||
|
<td><p>Inf</p></td>
|
|||
|
<td><p>root</p></td>
|
|||
|
<td><p>free</p></td>
|
|||
|
<td><p>angle (rad)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><p>2</p></td>
|
|||
|
<td><p>y-orientation of the torso (centre)</p></td>
|
|||
|
<td><p>-Inf</p></td>
|
|||
|
<td><p>Inf</p></td>
|
|||
|
<td><p>root</p></td>
|
|||
|
<td><p>free</p></td>
|
|||
|
<td><p>angle (rad)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p>3</p></td>
|
|||
|
<td><p>z-orientation of the torso (centre)</p></td>
|
|||
|
<td><p>-Inf</p></td>
|
|||
|
<td><p>Inf</p></td>
|
|||
|
<td><p>root</p></td>
|
|||
|
<td><p>free</p></td>
|
|||
|
<td><p>angle (rad)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><p>4</p></td>
|
|||
|
<td><p>w-orientation of the torso (centre)</p></td>
|
|||
|
<td><p>-Inf</p></td>
|
|||
|
<td><p>Inf</p></td>
|
|||
|
<td><p>root</p></td>
|
|||
|
<td><p>free</p></td>
|
|||
|
<td><p>angle (rad)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p>5</p></td>
|
|||
|
<td><p>angle between torso and first link on front left</p></td>
|
|||
|
<td><p>-Inf</p></td>
|
|||
|
<td><p>Inf</p></td>
|
|||
|
<td><p>hip_1 (front_left_leg)</p></td>
|
|||
|
<td><p>hinge</p></td>
|
|||
|
<td><p>angle (rad)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><p>6</p></td>
|
|||
|
<td><p>angle between the two links on the front left</p></td>
|
|||
|
<td><p>-Inf</p></td>
|
|||
|
<td><p>Inf</p></td>
|
|||
|
<td><p>ankle_1 (front_left_leg)</p></td>
|
|||
|
<td><p>hinge</p></td>
|
|||
|
<td><p>angle (rad)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p>7</p></td>
|
|||
|
<td><p>angle between torso and first link on front right</p></td>
|
|||
|
<td><p>-Inf</p></td>
|
|||
|
<td><p>Inf</p></td>
|
|||
|
<td><p>hip_2 (front_right_leg)</p></td>
|
|||
|
<td><p>hinge</p></td>
|
|||
|
<td><p>angle (rad)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><p>8</p></td>
|
|||
|
<td><p>angle between the two links on the front right</p></td>
|
|||
|
<td><p>-Inf</p></td>
|
|||
|
<td><p>Inf</p></td>
|
|||
|
<td><p>ankle_2 (front_right_leg)</p></td>
|
|||
|
<td><p>hinge</p></td>
|
|||
|
<td><p>angle (rad)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p>9</p></td>
|
|||
|
<td><p>angle between torso and first link on back left</p></td>
|
|||
|
<td><p>-Inf</p></td>
|
|||
|
<td><p>Inf</p></td>
|
|||
|
<td><p>hip_3 (back_leg)</p></td>
|
|||
|
<td><p>hinge</p></td>
|
|||
|
<td><p>angle (rad)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><p>10</p></td>
|
|||
|
<td><p>angle between the two links on the back left</p></td>
|
|||
|
<td><p>-Inf</p></td>
|
|||
|
<td><p>Inf</p></td>
|
|||
|
<td><p>ankle_3 (back_leg)</p></td>
|
|||
|
<td><p>hinge</p></td>
|
|||
|
<td><p>angle (rad)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p>11</p></td>
|
|||
|
<td><p>angle between torso and first link on back right</p></td>
|
|||
|
<td><p>-Inf</p></td>
|
|||
|
<td><p>Inf</p></td>
|
|||
|
<td><p>hip_4 (right_back_leg)</p></td>
|
|||
|
<td><p>hinge</p></td>
|
|||
|
<td><p>angle (rad)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><p>12</p></td>
|
|||
|
<td><p>angle between the two links on the back right</p></td>
|
|||
|
<td><p>-Inf</p></td>
|
|||
|
<td><p>Inf</p></td>
|
|||
|
<td><p>ankle_4 (right_back_leg)</p></td>
|
|||
|
<td><p>hinge</p></td>
|
|||
|
<td><p>angle (rad)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p>13</p></td>
|
|||
|
<td><p>x-coordinate velocity of the torso</p></td>
|
|||
|
<td><p>-Inf</p></td>
|
|||
|
<td><p>Inf</p></td>
|
|||
|
<td><p>root</p></td>
|
|||
|
<td><p>free</p></td>
|
|||
|
<td><p>velocity (m/s)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><p>14</p></td>
|
|||
|
<td><p>y-coordinate velocity of the torso</p></td>
|
|||
|
<td><p>-Inf</p></td>
|
|||
|
<td><p>Inf</p></td>
|
|||
|
<td><p>root</p></td>
|
|||
|
<td><p>free</p></td>
|
|||
|
<td><p>velocity (m/s)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p>15</p></td>
|
|||
|
<td><p>z-coordinate velocity of the torso</p></td>
|
|||
|
<td><p>-Inf</p></td>
|
|||
|
<td><p>Inf</p></td>
|
|||
|
<td><p>root</p></td>
|
|||
|
<td><p>free</p></td>
|
|||
|
<td><p>velocity (m/s)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><p>16</p></td>
|
|||
|
<td><p>x-coordinate angular velocity of the torso</p></td>
|
|||
|
<td><p>-Inf</p></td>
|
|||
|
<td><p>Inf</p></td>
|
|||
|
<td><p>root</p></td>
|
|||
|
<td><p>free</p></td>
|
|||
|
<td><p>angular velocity (rad/s)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p>17</p></td>
|
|||
|
<td><p>y-coordinate angular velocity of the torso</p></td>
|
|||
|
<td><p>-Inf</p></td>
|
|||
|
<td><p>Inf</p></td>
|
|||
|
<td><p>root</p></td>
|
|||
|
<td><p>free</p></td>
|
|||
|
<td><p>angular velocity (rad/s)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><p>18</p></td>
|
|||
|
<td><p>z-coordinate angular velocity of the torso</p></td>
|
|||
|
<td><p>-Inf</p></td>
|
|||
|
<td><p>Inf</p></td>
|
|||
|
<td><p>root</p></td>
|
|||
|
<td><p>free</p></td>
|
|||
|
<td><p>angular velocity (rad/s)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p>19</p></td>
|
|||
|
<td><p>angular velocity of angle between torso and front left link</p></td>
|
|||
|
<td><p>-Inf</p></td>
|
|||
|
<td><p>Inf</p></td>
|
|||
|
<td><p>hip_1 (front_left_leg)</p></td>
|
|||
|
<td><p>hinge</p></td>
|
|||
|
<td><p>angle (rad)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><p>20</p></td>
|
|||
|
<td><p>angular velocity of the angle between front left links</p></td>
|
|||
|
<td><p>-Inf</p></td>
|
|||
|
<td><p>Inf</p></td>
|
|||
|
<td><p>ankle_1 (front_left_leg)</p></td>
|
|||
|
<td><p>hinge</p></td>
|
|||
|
<td><p>angle (rad)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p>21</p></td>
|
|||
|
<td><p>angular velocity of angle between torso and front right link</p></td>
|
|||
|
<td><p>-Inf</p></td>
|
|||
|
<td><p>Inf</p></td>
|
|||
|
<td><p>hip_2 (front_right_leg)</p></td>
|
|||
|
<td><p>hinge</p></td>
|
|||
|
<td><p>angle (rad)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><p>22</p></td>
|
|||
|
<td><p>angular velocity of the angle between front right links</p></td>
|
|||
|
<td><p>-Inf</p></td>
|
|||
|
<td><p>Inf</p></td>
|
|||
|
<td><p>ankle_2 (front_right_leg)</p></td>
|
|||
|
<td><p>hinge</p></td>
|
|||
|
<td><p>angle (rad)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p>23</p></td>
|
|||
|
<td><p>angular velocity of angle between torso and back left link</p></td>
|
|||
|
<td><p>-Inf</p></td>
|
|||
|
<td><p>Inf</p></td>
|
|||
|
<td><p>hip_3 (back_leg)</p></td>
|
|||
|
<td><p>hinge</p></td>
|
|||
|
<td><p>angle (rad)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><p>24</p></td>
|
|||
|
<td><p>angular velocity of the angle between back left links</p></td>
|
|||
|
<td><p>-Inf</p></td>
|
|||
|
<td><p>Inf</p></td>
|
|||
|
<td><p>ankle_3 (back_leg)</p></td>
|
|||
|
<td><p>hinge</p></td>
|
|||
|
<td><p>angle (rad)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p>25</p></td>
|
|||
|
<td><p>angular velocity of angle between torso and back right link</p></td>
|
|||
|
<td><p>-Inf</p></td>
|
|||
|
<td><p>Inf</p></td>
|
|||
|
<td><p>hip_4 (right_back_leg)</p></td>
|
|||
|
<td><p>hinge</p></td>
|
|||
|
<td><p>angle (rad)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><p>26</p></td>
|
|||
|
<td><p>angular velocity of the angle between back right links</p></td>
|
|||
|
<td><p>-Inf</p></td>
|
|||
|
<td><p>Inf</p></td>
|
|||
|
<td><p>ankle_4 (right_back_leg)</p></td>
|
|||
|
<td><p>hinge</p></td>
|
|||
|
<td><p>angle (rad)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p>excluded</p></td>
|
|||
|
<td><p>x-coordinate of the torso (centre)</p></td>
|
|||
|
<td><p>-Inf</p></td>
|
|||
|
<td><p>Inf</p></td>
|
|||
|
<td><p>root</p></td>
|
|||
|
<td><p>free</p></td>
|
|||
|
<td><p>position (m)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><p>excluded</p></td>
|
|||
|
<td><p>y-coordinate of the torso (centre)</p></td>
|
|||
|
<td><p>-Inf</p></td>
|
|||
|
<td><p>Inf</p></td>
|
|||
|
<td><p>root</p></td>
|
|||
|
<td><p>free</p></td>
|
|||
|
<td><p>position (m)</p></td>
|
|||
|
</tr>
|
|||
|
</tbody>
|
|||
|
</table>
|
|||
|
</div>
|
|||
|
<p>The body parts are:</p>
|
|||
|
<div class="table-wrapper colwidths-auto docutils container">
|
|||
|
<table class="docutils align-default">
|
|||
|
<thead>
|
|||
|
<tr class="row-odd"><th class="head"><p>body part</p></th>
|
|||
|
<th class="head"><p>id (for <code class="docutils literal notranslate"><span class="pre">v2</span></code>, <code class="docutils literal notranslate"><span class="pre">v3</span></code>, <code class="docutils literal notranslate"><span class="pre">v4)</span></code></p></th>
|
|||
|
<th class="head"><p>id (for <code class="docutils literal notranslate"><span class="pre">v5</span></code>)</p></th>
|
|||
|
</tr>
|
|||
|
</thead>
|
|||
|
<tbody>
|
|||
|
<tr class="row-even"><td><p>worldbody (note: all values are constant 0)</p></td>
|
|||
|
<td><p>0</p></td>
|
|||
|
<td><p>excluded</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p>torso</p></td>
|
|||
|
<td><p>1</p></td>
|
|||
|
<td><p>0</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><p>front_left_leg</p></td>
|
|||
|
<td><p>2</p></td>
|
|||
|
<td><p>1</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p>aux_1 (front left leg)</p></td>
|
|||
|
<td><p>3</p></td>
|
|||
|
<td><p>2</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><p>ankle_1 (front left leg)</p></td>
|
|||
|
<td><p>4</p></td>
|
|||
|
<td><p>3</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p>front_right_leg</p></td>
|
|||
|
<td><p>5</p></td>
|
|||
|
<td><p>4</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><p>aux_2 (front right leg)</p></td>
|
|||
|
<td><p>6</p></td>
|
|||
|
<td><p>5</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p>ankle_2 (front right leg)</p></td>
|
|||
|
<td><p>7</p></td>
|
|||
|
<td><p>6</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><p>back_leg (back left leg)</p></td>
|
|||
|
<td><p>8</p></td>
|
|||
|
<td><p>7</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p>aux_3 (back left leg)</p></td>
|
|||
|
<td><p>9</p></td>
|
|||
|
<td><p>8</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><p>ankle_3 (back left leg)</p></td>
|
|||
|
<td><p>10</p></td>
|
|||
|
<td><p>9</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p>right_back_leg</p></td>
|
|||
|
<td><p>11</p></td>
|
|||
|
<td><p>10</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><p>aux_4 (back right leg)</p></td>
|
|||
|
<td><p>12</p></td>
|
|||
|
<td><p>11</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p>ankle_4 (back right leg)</p></td>
|
|||
|
<td><p>13</p></td>
|
|||
|
<td><p>12</p></td>
|
|||
|
</tr>
|
|||
|
</tbody>
|
|||
|
</table>
|
|||
|
</div>
|
|||
|
<p>The (x,y,z) coordinates are translational DOFs, while the orientations are rotational DOFs expressed as quaternions.
|
|||
|
One can read more about free joints in the <a class="reference external" href="https://mujoco.readthedocs.io/en/latest/XMLreference.html">MuJoCo documentation</a>.</p>
|
|||
|
<p><strong>Note:</strong>
|
|||
|
When using Ant-v3 or earlier versions, problems have been reported when using a <code class="docutils literal notranslate"><span class="pre">mujoco-py</span></code> version > 2.0, resulting in contact forces always being 0.
|
|||
|
Therefore, it is recommended to use a <code class="docutils literal notranslate"><span class="pre">mujoco-py</span></code> version < 2.0 when using the Ant environment if you want to report results with contact forces (if contact forces are not used in your experiments, you can use version > 2.0).</p>
|
|||
|
</section>
|
|||
|
<section id="rewards">
|
|||
|
<h2>Rewards<a class="headerlink" href="#rewards" title="Link to this heading">¶</a></h2>
|
|||
|
<p>The total reward is <em><strong>reward</strong></em> <em>=</em> <em>healthy_reward + forward_reward - ctrl_cost - contact_cost</em>.</p>
|
|||
|
<ul class="simple">
|
|||
|
<li><p><em>healthy_reward</em>:
|
|||
|
Every timestep that the Ant is healthy (see definition in section “Episode End”),
|
|||
|
it gets a reward of fixed value <code class="docutils literal notranslate"><span class="pre">healthy_reward</span></code> (default is <span class="math notranslate nohighlight">\(1\)</span>).</p></li>
|
|||
|
<li><p><em>forward_reward</em>:
|
|||
|
A reward for moving forward,
|
|||
|
this reward would be positive if the Ant moves forward (in the positive <span class="math notranslate nohighlight">\(x\)</span> direction / in the right direction).
|
|||
|
<span class="math notranslate nohighlight">\(w_{forward} \times \frac{dx}{dt}\)</span>, where
|
|||
|
<span class="math notranslate nohighlight">\(dx\)</span> is the displacement of the <code class="docutils literal notranslate"><span class="pre">main_body</span></code> (<span class="math notranslate nohighlight">\(x_{after-action} - x_{before-action}\)</span>),
|
|||
|
<span class="math notranslate nohighlight">\(dt\)</span> is the time between actions, which depends on the <code class="docutils literal notranslate"><span class="pre">frame_skip</span></code> parameter (default is <span class="math notranslate nohighlight">\(5\)</span>),
|
|||
|
and <code class="docutils literal notranslate"><span class="pre">frametime</span></code>, which is <span class="math notranslate nohighlight">\(0.01\)</span> - so the default is <span class="math notranslate nohighlight">\(dt = 5 \times 0.01 = 0.05\)</span>,
|
|||
|
<span class="math notranslate nohighlight">\(w_{forward}\)</span> is the <code class="docutils literal notranslate"><span class="pre">forward_reward_weight</span></code> (default is <span class="math notranslate nohighlight">\(1\)</span>).</p></li>
|
|||
|
<li><p><em>ctrl_cost</em>:
|
|||
|
A negative reward to penalize the Ant for taking actions that are too large.
|
|||
|
<span class="math notranslate nohighlight">\(w_{control} \times \|action\|_2^2\)</span>,
|
|||
|
where <span class="math notranslate nohighlight">\(w_{control}\)</span> is <code class="docutils literal notranslate"><span class="pre">ctrl_cost_weight</span></code> (default is <span class="math notranslate nohighlight">\(0.5\)</span>).</p></li>
|
|||
|
<li><p><em>contact_cost</em>:
|
|||
|
A negative reward to penalize the Ant if the external contact forces are too large.
|
|||
|
<span class="math notranslate nohighlight">\(w_{contact} \times \|F_{contact}\|_2^2\)</span>, where
|
|||
|
<span class="math notranslate nohighlight">\(w_{contact}\)</span> is <code class="docutils literal notranslate"><span class="pre">contact_cost_weight</span></code> (default is <span class="math notranslate nohighlight">\(5\times10^{-4}\)</span>),
|
|||
|
<span class="math notranslate nohighlight">\(F_{contact}\)</span> are the external contact forces clipped by <code class="docutils literal notranslate"><span class="pre">contact_force_range</span></code> (see <code class="docutils literal notranslate"><span class="pre">cfrc_ext</span></code> section on Observation Space).</p></li>
|
|||
|
</ul>
|
|||
|
<p><code class="docutils literal notranslate"><span class="pre">info</span></code> contains the individual reward terms.</p>
|
|||
|
<p>But if <code class="docutils literal notranslate"><span class="pre">use_contact_forces=False</span></code> on <code class="docutils literal notranslate"><span class="pre">v4</span></code>
|
|||
|
The total reward returned is <em><strong>reward</strong></em> <em>=</em> <em>healthy_reward + forward_reward - ctrl_cost</em>.</p>
|
|||
|
</section>
|
|||
|
<section id="starting-state">
|
|||
|
<h2>Starting State<a class="headerlink" href="#starting-state" title="Link to this heading">¶</a></h2>
|
|||
|
<p>The initial position state is <span class="math notranslate nohighlight">\([0.0, 0.0, 0.75, 1.0, 0.0, ... 0.0] + \mathcal{U}_{[-reset\_noise\_scale \times I_{15}, reset\_noise\_scale \times I_{15}]}\)</span>.
|
|||
|
The initial velocity state is <span class="math notranslate nohighlight">\(\mathcal{N}(0_{14}, reset\_noise\_scale^2 \times I_{14})\)</span>.</p>
|
|||
|
<p>where <span class="math notranslate nohighlight">\(\mathcal{N}\)</span> is the multivariate normal distribution and <span class="math notranslate nohighlight">\(\mathcal{U}\)</span> is the multivariate uniform continuous distribution.</p>
|
|||
|
<p>Note that the z- and x-coordinates are non-zero so that the ant can immediately stand up and face forward (x-axis).</p>
|
|||
|
</section>
|
|||
|
<section id="episode-end">
|
|||
|
<h2>Episode End<a class="headerlink" href="#episode-end" title="Link to this heading">¶</a></h2>
|
|||
|
<section id="termination">
|
|||
|
<h3>Termination<a class="headerlink" href="#termination" title="Link to this heading">¶</a></h3>
|
|||
|
<p>If <code class="docutils literal notranslate"><span class="pre">terminate_when_unhealthy</span> <span class="pre">is</span> <span class="pre">True</span></code> (the default), the environment terminates when the Ant is unhealthy.
|
|||
|
the Ant is unhealthy if any of the following happens:</p>
|
|||
|
<ol class="arabic simple">
|
|||
|
<li><p>Any of the state space values is no longer finite.</p></li>
|
|||
|
<li><p>The z-coordinate of the torso (the height) is <strong>not</strong> in the closed interval given by the <code class="docutils literal notranslate"><span class="pre">healthy_z_range</span></code> argument (default is <span class="math notranslate nohighlight">\([0.2, 1.0]\)</span>).</p></li>
|
|||
|
</ol>
|
|||
|
</section>
|
|||
|
<section id="truncation">
|
|||
|
<h3>Truncation<a class="headerlink" href="#truncation" title="Link to this heading">¶</a></h3>
|
|||
|
<p>The default duration of an episode is 1000 timesteps.</p>
|
|||
|
</section>
|
|||
|
</section>
|
|||
|
<section id="arguments">
|
|||
|
<h2>Arguments<a class="headerlink" href="#arguments" title="Link to this heading">¶</a></h2>
|
|||
|
<p>Ant provides a range of parameters to modify the observation space, reward function, initial state, and termination condition.
|
|||
|
These parameters can be applied during <code class="docutils literal notranslate"><span class="pre">gymnasium.make</span></code> in the following way:</p>
|
|||
|
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">gymnasium</span> <span class="k">as</span> <span class="nn">gym</span>
|
|||
|
<span class="n">env</span> <span class="o">=</span> <span class="n">gym</span><span class="o">.</span><span class="n">make</span><span class="p">(</span><span class="s1">'Ant-v5'</span><span class="p">,</span> <span class="n">ctrl_cost_weight</span><span class="o">=</span><span class="mf">0.5</span><span class="p">,</span> <span class="o">...</span><span class="p">)</span>
|
|||
|
</pre></div>
|
|||
|
</div>
|
|||
|
<div class="table-wrapper colwidths-auto docutils container">
|
|||
|
<table class="docutils align-default">
|
|||
|
<thead>
|
|||
|
<tr class="row-odd"><th class="head"><p>Parameter</p></th>
|
|||
|
<th class="head"><p>Type</p></th>
|
|||
|
<th class="head"><p>Default</p></th>
|
|||
|
<th class="head"><p>Description</p></th>
|
|||
|
</tr>
|
|||
|
</thead>
|
|||
|
<tbody>
|
|||
|
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">xml_file</span></code></p></td>
|
|||
|
<td><p><strong>str</strong></p></td>
|
|||
|
<td><p><code class="docutils literal notranslate"><span class="pre">"ant.xml"</span></code></p></td>
|
|||
|
<td><p>Path to a MuJoCo model</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">forward_reward_weight</span></code></p></td>
|
|||
|
<td><p><strong>float</strong></p></td>
|
|||
|
<td><p><code class="docutils literal notranslate"><span class="pre">1</span></code></p></td>
|
|||
|
<td><p>Weight for <em>forward_reward</em> term (see <code class="docutils literal notranslate"><span class="pre">Rewards</span></code> section)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">ctrl_cost_weight</span></code></p></td>
|
|||
|
<td><p><strong>float</strong></p></td>
|
|||
|
<td><p><code class="docutils literal notranslate"><span class="pre">0.5</span></code></p></td>
|
|||
|
<td><p>Weight for <em>ctrl_cost</em> term (see <code class="docutils literal notranslate"><span class="pre">Rewards</span></code> section)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">contact_cost_weight</span></code></p></td>
|
|||
|
<td><p><strong>float</strong></p></td>
|
|||
|
<td><p><code class="docutils literal notranslate"><span class="pre">5e-4</span></code></p></td>
|
|||
|
<td><p>Weight for <em>contact_cost</em> term (see <code class="docutils literal notranslate"><span class="pre">Rewards</span></code> section)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">healthy_reward</span></code></p></td>
|
|||
|
<td><p><strong>float</strong></p></td>
|
|||
|
<td><p><code class="docutils literal notranslate"><span class="pre">1</span></code></p></td>
|
|||
|
<td><p>Weight for <em>healthy_reward</em> term (see <code class="docutils literal notranslate"><span class="pre">Rewards</span></code> section)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">main_body</span></code></p></td>
|
|||
|
<td><p><strong>str|int</strong></p></td>
|
|||
|
<td><p><code class="docutils literal notranslate"><span class="pre">1</span></code>(“torso”)</p></td>
|
|||
|
<td><p>Name or ID of the body, whose displacement is used to calculate the <em>dx</em>/<em>forward_reward</em> (useful for custom MuJoCo models) (see <code class="docutils literal notranslate"><span class="pre">Rewards</span></code> section)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">terminate_when_unhealthy</span></code></p></td>
|
|||
|
<td><p><strong>bool</strong></p></td>
|
|||
|
<td><p><code class="docutils literal notranslate"><span class="pre">True</span></code></p></td>
|
|||
|
<td><p>If <code class="docutils literal notranslate"><span class="pre">True</span></code>, issue a <code class="docutils literal notranslate"><span class="pre">terminated</span></code> signal is unhealthy (see <code class="docutils literal notranslate"><span class="pre">Episode</span> <span class="pre">End</span></code> section)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">healthy_z_range</span></code></p></td>
|
|||
|
<td><p><strong>tuple</strong></p></td>
|
|||
|
<td><p><code class="docutils literal notranslate"><span class="pre">(0.2,</span> <span class="pre">1)</span></code></p></td>
|
|||
|
<td><p>The ant is considered healthy if the z-coordinate of the torso is in this range (see <code class="docutils literal notranslate"><span class="pre">Episode</span> <span class="pre">End</span></code> section)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">contact_force_range</span></code></p></td>
|
|||
|
<td><p><strong>tuple</strong></p></td>
|
|||
|
<td><p><code class="docutils literal notranslate"><span class="pre">(-1,</span> <span class="pre">1)</span></code></p></td>
|
|||
|
<td><p>Contact forces are clipped to this range in the computation of <em>contact_cost</em> (see <code class="docutils literal notranslate"><span class="pre">Rewards</span></code> section)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">reset_noise_scale</span></code></p></td>
|
|||
|
<td><p><strong>float</strong></p></td>
|
|||
|
<td><p><code class="docutils literal notranslate"><span class="pre">0.1</span></code></p></td>
|
|||
|
<td><p>Scale of random perturbations of initial position and velocity (see <code class="docutils literal notranslate"><span class="pre">Starting</span> <span class="pre">State</span></code> section)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">exclude_current_positions_from_observation</span></code></p></td>
|
|||
|
<td><p><strong>bool</strong></p></td>
|
|||
|
<td><p><code class="docutils literal notranslate"><span class="pre">True</span></code></p></td>
|
|||
|
<td><p>Whether or not to omit the x- and y-coordinates from observations. Excluding the position can serve as an inductive bias to induce position-agnostic behavior in policies (see <code class="docutils literal notranslate"><span class="pre">Observation</span> <span class="pre">State</span></code> section)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">include_cfrc_ext_in_observation</span></code></p></td>
|
|||
|
<td><p><strong>bool</strong></p></td>
|
|||
|
<td><p><code class="docutils literal notranslate"><span class="pre">True</span></code></p></td>
|
|||
|
<td><p>Whether to include <em>cfrc_ext</em> elements in the observations (see <code class="docutils literal notranslate"><span class="pre">Observation</span> <span class="pre">State</span></code> section)</p></td>
|
|||
|
</tr>
|
|||
|
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">use_contact_forces</span></code> (<code class="docutils literal notranslate"><span class="pre">v4</span></code> only)</p></td>
|
|||
|
<td><p><strong>bool</strong></p></td>
|
|||
|
<td><p><code class="docutils literal notranslate"><span class="pre">False</span></code></p></td>
|
|||
|
<td><p>If <code class="docutils literal notranslate"><span class="pre">True</span></code>, it extends the observation space by adding contact forces (see <code class="docutils literal notranslate"><span class="pre">Observation</span> <span class="pre">Space</span></code> section) and includes contact_cost to the reward function (see <code class="docutils literal notranslate"><span class="pre">Rewards</span></code> section)</p></td>
|
|||
|
</tr>
|
|||
|
</tbody>
|
|||
|
</table>
|
|||
|
</div>
|
|||
|
</section>
|
|||
|
<section id="version-history">
|
|||
|
<h2>Version History<a class="headerlink" href="#version-history" title="Link to this heading">¶</a></h2>
|
|||
|
<ul class="simple">
|
|||
|
<li><p>v5:</p>
|
|||
|
<ul>
|
|||
|
<li><p>Minimum <code class="docutils literal notranslate"><span class="pre">mujoco</span></code> version is now 2.3.3.</p></li>
|
|||
|
<li><p>Added support for fully custom/third party <code class="docutils literal notranslate"><span class="pre">mujoco</span></code> models using the <code class="docutils literal notranslate"><span class="pre">xml_file</span></code> argument (previously only a few changes could be made to the existing models).</p></li>
|
|||
|
<li><p>Added <code class="docutils literal notranslate"><span class="pre">default_camera_config</span></code> argument, a dictionary for setting the <code class="docutils literal notranslate"><span class="pre">mj_camera</span></code> properties, mainly useful for custom environments.</p></li>
|
|||
|
<li><p>Added <code class="docutils literal notranslate"><span class="pre">env.observation_structure</span></code>, a dictionary for specifying the observation space compose (e.g. <code class="docutils literal notranslate"><span class="pre">qpos</span></code>, <code class="docutils literal notranslate"><span class="pre">qvel</span></code>), useful for building tooling and wrappers for the MuJoCo environments.</p></li>
|
|||
|
<li><p>Return a non-empty <code class="docutils literal notranslate"><span class="pre">info</span></code> with <code class="docutils literal notranslate"><span class="pre">reset()</span></code>, previously an empty dictionary was returned, the new keys are the same state information as <code class="docutils literal notranslate"><span class="pre">step()</span></code>.</p></li>
|
|||
|
<li><p>Added <code class="docutils literal notranslate"><span class="pre">frame_skip</span></code> argument, used to configure the <code class="docutils literal notranslate"><span class="pre">dt</span></code> (duration of <code class="docutils literal notranslate"><span class="pre">step()</span></code>), default varies by environment check environment documentation pages.</p></li>
|
|||
|
<li><p>Fixed bug: <code class="docutils literal notranslate"><span class="pre">healthy_reward</span></code> was given on every step (even if the Ant is unhealthy), now it is only given when the Ant is healthy. The <code class="docutils literal notranslate"><span class="pre">info["reward_survive"]</span></code> is updated with this change (related <a class="reference external" href="https://github.com/Farama-Foundation/Gymnasium/issues/526">GitHub issue</a>).</p></li>
|
|||
|
<li><p>The reward function now always includes <code class="docutils literal notranslate"><span class="pre">contact_cost</span></code>, before it was only included if <code class="docutils literal notranslate"><span class="pre">use_contact_forces=True</span></code> (can be set to <code class="docutils literal notranslate"><span class="pre">0</span></code> with <code class="docutils literal notranslate"><span class="pre">contact_cost_weight=0</span></code>).</p></li>
|
|||
|
<li><p>Excluded the <code class="docutils literal notranslate"><span class="pre">cfrc_ext</span></code> of <code class="docutils literal notranslate"><span class="pre">worldbody</span></code> from the observation space, as it was always 0 and thus provided no useful information to the agent, resulting in slightly faster training (related <a class="reference external" href="https://github.com/Farama-Foundation/Gymnasium/issues/204">GitHub issue</a>).</p></li>
|
|||
|
<li><p>Added the <code class="docutils literal notranslate"><span class="pre">main_body</span></code> argument, which specifies the body used to compute the forward reward (mainly useful for custom MuJoCo models).</p></li>
|
|||
|
<li><p>Added the <code class="docutils literal notranslate"><span class="pre">forward_reward_weight</span></code> argument, which defaults to <code class="docutils literal notranslate"><span class="pre">1</span></code> (effectively the same behavior as in <code class="docutils literal notranslate"><span class="pre">v4</span></code>).</p></li>
|
|||
|
<li><p>Added the <code class="docutils literal notranslate"><span class="pre">include_cfrc_ext_in_observation</span></code> argument, previously in <code class="docutils literal notranslate"><span class="pre">v4</span></code> the inclusion of <code class="docutils literal notranslate"><span class="pre">cfrc_ext</span></code> observations was controlled by <code class="docutils literal notranslate"><span class="pre">use_contact_forces</span></code> which defaulted to <code class="docutils literal notranslate"><span class="pre">False</span></code>, while <code class="docutils literal notranslate"><span class="pre">include_cfrc_ext_in_observation</span></code> defaults to <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p></li>
|
|||
|
<li><p>Removed the <code class="docutils literal notranslate"><span class="pre">use_contact_forces</span></code> argument (note: its functionality has been replaced by <code class="docutils literal notranslate"><span class="pre">include_cfrc_ext_in_observation</span></code> and <code class="docutils literal notranslate"><span class="pre">contact_cost_weight</span></code>) (related <a class="reference external" href="https://github.com/Farama-Foundation/Gymnasium/issues/214">GitHub issue</a>).</p></li>
|
|||
|
<li><p>Fixed <code class="docutils literal notranslate"><span class="pre">info["reward_ctrl"]</span></code> sometimes containing <code class="docutils literal notranslate"><span class="pre">contact_cost</span></code> instead of <code class="docutils literal notranslate"><span class="pre">ctrl_cost</span></code>.</p></li>
|
|||
|
<li><p>Fixed <code class="docutils literal notranslate"><span class="pre">info["x_position"]</span></code> & <code class="docutils literal notranslate"><span class="pre">info["y_position"]</span></code> & <code class="docutils literal notranslate"><span class="pre">info["distance_from_origin"]</span></code> giving <code class="docutils literal notranslate"><span class="pre">xpos</span></code> instead of <code class="docutils literal notranslate"><span class="pre">qpos</span></code> observations (<code class="docutils literal notranslate"><span class="pre">xpos</span></code> observations are behind 1 <code class="docutils literal notranslate"><span class="pre">mj_step()</span></code> more <a class="reference external" href="https://github.com/deepmind/mujoco/issues/889#issuecomment-1568896388">here</a>) (related <a class="reference external" href="https://github.com/Farama-Foundation/Gymnasium/issues/521">GitHub issue #1</a> & <a class="reference external" href="https://github.com/Farama-Foundation/Gymnasium/issues/539">GitHub issue #2</a>).</p></li>
|
|||
|
<li><p>Removed <code class="docutils literal notranslate"><span class="pre">info["forward_reward"]</span></code> as it is equivalent to <code class="docutils literal notranslate"><span class="pre">info["reward_forward"]</span></code>.</p></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li><p>v4: All MuJoCo environments now use the MuJoCo bindings in mujoco >= 2.1.3, also removed contact forces from the default observation space (new variable <code class="docutils literal notranslate"><span class="pre">use_contact_forces=True</span></code> can restore them).</p></li>
|
|||
|
<li><p>v3: Support for <code class="docutils literal notranslate"><span class="pre">gymnasium.make</span></code> kwargs such as <code class="docutils literal notranslate"><span class="pre">xml_file</span></code>, <code class="docutils literal notranslate"><span class="pre">ctrl_cost_weight</span></code>, <code class="docutils literal notranslate"><span class="pre">reset_noise_scale</span></code>, etc. rgb rendering comes from tracking camera (so agent does not run away from screen).</p></li>
|
|||
|
<li><p>v2: All continuous control environments now use mujoco-py >= 1.50.</p></li>
|
|||
|
<li><p>v1: max_time_steps raised to 1000 for robot based tasks. Added reward_threshold to environments.</p></li>
|
|||
|
<li><p>v0: Initial versions release</p></li>
|
|||
|
</ul>
|
|||
|
</section>
|
|||
|
</section>
|
|||
|
|
|||
|
</article>
|
|||
|
</div>
|
|||
|
<footer>
|
|||
|
|
|||
|
<div class="related-pages">
|
|||
|
<a class="next-page" href="../half_cheetah/">
|
|||
|
<div class="page-info">
|
|||
|
<div class="context">
|
|||
|
<span>Next</span>
|
|||
|
</div>
|
|||
|
<div class="title">Half Cheetah</div>
|
|||
|
</div>
|
|||
|
<svg class="furo-related-icon">
|
|||
|
<use href="#svg-arrow-right"></use>
|
|||
|
</svg>
|
|||
|
</a>
|
|||
|
|
|||
|
</div>
|
|||
|
<div class="bottom-of-page">
|
|||
|
<div class="left-details">
|
|||
|
<div class="copyright">
|
|||
|
Copyright © 2023 Farama Foundation
|
|||
|
</div>
|
|||
|
<!--
|
|||
|
Made with <a href="https://www.sphinx-doc.org/">Sphinx</a> and <a class="muted-link" href="https://pradyunsg.me">@pradyunsg</a>'s
|
|||
|
|
|||
|
<a href="https://github.com/pradyunsg/furo">Furo</a>
|
|||
|
-->
|
|||
|
</div>
|
|||
|
<div class="right-details">
|
|||
|
<div class="icons">
|
|||
|
<a class="muted-link" href="https://github.com/Farama-Foundation/Gymnasium/"
|
|||
|
aria-label="On GitHub">
|
|||
|
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16">
|
|||
|
<path fill-rule="evenodd"
|
|||
|
d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z">
|
|||
|
</path>
|
|||
|
</svg>
|
|||
|
</a>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
</footer>
|
|||
|
</div>
|
|||
|
<aside class="toc-drawer">
|
|||
|
|
|||
|
|
|||
|
<div class="toc-sticky toc-scroll">
|
|||
|
<div class="toc-title-container">
|
|||
|
<span class="toc-title">
|
|||
|
On this page
|
|||
|
</span>
|
|||
|
</div>
|
|||
|
<div class="toc-tree-container">
|
|||
|
<div class="toc-tree">
|
|||
|
<ul>
|
|||
|
<li><a class="reference internal" href="#">Ant</a><ul>
|
|||
|
<li><a class="reference internal" href="#description">Description</a></li>
|
|||
|
<li><a class="reference internal" href="#action-space">Action Space</a></li>
|
|||
|
<li><a class="reference internal" href="#observation-space">Observation Space</a></li>
|
|||
|
<li><a class="reference internal" href="#rewards">Rewards</a></li>
|
|||
|
<li><a class="reference internal" href="#starting-state">Starting State</a></li>
|
|||
|
<li><a class="reference internal" href="#episode-end">Episode End</a><ul>
|
|||
|
<li><a class="reference internal" href="#termination">Termination</a></li>
|
|||
|
<li><a class="reference internal" href="#truncation">Truncation</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li><a class="reference internal" href="#arguments">Arguments</a></li>
|
|||
|
<li><a class="reference internal" href="#version-history">Version History</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
</aside>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<script>
|
|||
|
const toggleMenu = () => {
|
|||
|
const menuBtn = document.querySelector(".farama-header-menu__btn");
|
|||
|
const menuContainer = document.querySelector(".farama-header-menu-container");
|
|||
|
if (document.querySelector(".farama-header-menu").classList.contains("active")) {
|
|||
|
menuBtn.setAttribute("aria-expanded", "false");
|
|||
|
menuContainer.setAttribute("aria-hidden", "true");
|
|||
|
} else {
|
|||
|
menuBtn.setAttribute("aria-expanded", "true");
|
|||
|
menuContainer.setAttribute("aria-hidden", "false");
|
|||
|
}
|
|||
|
document.querySelector(".farama-header-menu").classList.toggle("active");
|
|||
|
}
|
|||
|
|
|||
|
document.querySelector(".farama-header-menu__btn").addEventListener("click", toggleMenu);
|
|||
|
document.getElementById("farama-close-menu").addEventListener("click", toggleMenu);
|
|||
|
</script>
|
|||
|
|
|||
|
|
|||
|
<script async src="https://www.googletagmanager.com/gtag/js?id=G-6H9C8TWXZ8"></script>
|
|||
|
<script>
|
|||
|
const enableGtag = () => {
|
|||
|
window.dataLayer = window.dataLayer || [];
|
|||
|
function gtag(){dataLayer.push(arguments);}
|
|||
|
gtag('js', new Date());
|
|||
|
gtag('config', 'G-6H9C8TWXZ8');
|
|||
|
}
|
|||
|
(() => {
|
|||
|
if (!localStorage.getItem("acceptedCookieAlert")) {
|
|||
|
const boxElem = document.createElement("div");
|
|||
|
boxElem.classList.add("cookie-alert");
|
|||
|
const containerElem = document.createElement("div");
|
|||
|
containerElem.classList.add("cookie-alert__container");
|
|||
|
const textElem = document.createElement("p");
|
|||
|
textElem.innerHTML = `This page uses <a href="https://analytics.google.com/">
|
|||
|
Google Analytics</a> to collect statistics.`;
|
|||
|
containerElem.appendChild(textElem);
|
|||
|
|
|||
|
const declineBtn = Object.assign(document.createElement("button"),
|
|||
|
{
|
|||
|
innerText: "Deny",
|
|||
|
className: "farama-btn cookie-alert__button",
|
|||
|
id: "cookie-alert__decline",
|
|||
|
}
|
|||
|
);
|
|||
|
declineBtn.addEventListener("click", () => {
|
|||
|
localStorage.setItem("acceptedCookieAlert", false);
|
|||
|
boxElem.remove();
|
|||
|
});
|
|||
|
|
|||
|
const acceptBtn = Object.assign(document.createElement("button"),
|
|||
|
{
|
|||
|
innerText: "Allow",
|
|||
|
className: "farama-btn cookie-alert__button",
|
|||
|
id: "cookie-alert__accept",
|
|||
|
}
|
|||
|
);
|
|||
|
acceptBtn.addEventListener("click", () => {
|
|||
|
localStorage.setItem("acceptedCookieAlert", true);
|
|||
|
boxElem.remove();
|
|||
|
enableGtag();
|
|||
|
});
|
|||
|
|
|||
|
containerElem.appendChild(declineBtn);
|
|||
|
containerElem.appendChild(acceptBtn);
|
|||
|
boxElem.appendChild(containerElem);
|
|||
|
document.body.appendChild(boxElem);
|
|||
|
} else if (localStorage.getItem("acceptedCookieAlert") === "true") {
|
|||
|
enableGtag();
|
|||
|
}
|
|||
|
})()
|
|||
|
</script>
|
|||
|
|
|||
|
<script src="../../../_static/documentation_options.js?v=ed34540e"></script>
|
|||
|
<script src="../../../_static/doctools.js?v=9a2dae69"></script>
|
|||
|
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
|
|||
|
<script src="../../../_static/scripts/furo.js?v=7660844c"></script>
|
|||
|
<script>window.MathJax = {"options": {"processHtmlClass": "tex2jax_process|mathjax_process|math|output_area"}}</script>
|
|||
|
<script defer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
|
|||
|
|
|||
|
<script>
|
|||
|
|
|||
|
const createProjectsList = (projects, displayImages) => {
|
|||
|
const ulElem = Object.assign(document.createElement('ul'),
|
|||
|
{
|
|||
|
className:'farama-header-menu-list',
|
|||
|
}
|
|||
|
)
|
|||
|
for (let project of projects) {
|
|||
|
const liElem = document.createElement("li");
|
|||
|
const aElem = Object.assign(document.createElement("a"),
|
|||
|
{
|
|||
|
href: project.link
|
|||
|
}
|
|||
|
);
|
|||
|
liElem.appendChild(aElem);
|
|||
|
if (displayImages) {
|
|||
|
const imgElem = Object.assign(document.createElement("img"),
|
|||
|
{
|
|||
|
src: project.image ? imagesBasepath + project.image : imagesBasepath + "/farama_black.svg",
|
|||
|
alt: `${project.name} logo`,
|
|||
|
className: "farama-black-logo-invert"
|
|||
|
}
|
|||
|
);
|
|||
|
aElem.appendChild(imgElem);
|
|||
|
}
|
|||
|
aElem.appendChild(document.createTextNode(project.name));
|
|||
|
ulElem.appendChild(liElem);
|
|||
|
}
|
|||
|
return ulElem;
|
|||
|
}
|
|||
|
|
|||
|
// Create menu with Farama projects by using the API at farama.org/api/projects.json
|
|||
|
const createCORSRequest = (method, url) => {
|
|||
|
let xhr = new XMLHttpRequest();
|
|||
|
xhr.responseType = 'json';
|
|||
|
|
|||
|
if ("withCredentials" in xhr) {
|
|||
|
xhr.open(method, url, true);
|
|||
|
} else if (typeof XDomainRequest != "undefined") {
|
|||
|
// IE8 & IE9
|
|||
|
xhr = new XDomainRequest();
|
|||
|
xhr.open(method, url);
|
|||
|
} else {
|
|||
|
// CORS not supported.
|
|||
|
xhr = null;
|
|||
|
}
|
|||
|
return xhr;
|
|||
|
};
|
|||
|
|
|||
|
const url = 'https://farama.org/api/projects.json';
|
|||
|
const imagesBasepath = "https://farama.org/assets/images"
|
|||
|
const method = 'GET';
|
|||
|
let xhr = createCORSRequest(method, url);
|
|||
|
|
|||
|
xhr.onload = () => {
|
|||
|
const jsonResponse = xhr.response;
|
|||
|
const sections = {
|
|||
|
"Core Projects": [],
|
|||
|
"Mature Projects": {
|
|||
|
"Documentation": [],
|
|||
|
"Repositories": [],
|
|||
|
},
|
|||
|
"Incubating Projects": {
|
|||
|
"Documentation": [],
|
|||
|
"Repositories": [],
|
|||
|
},
|
|||
|
"Foundation": [
|
|||
|
{
|
|||
|
name: "About",
|
|||
|
link: "https://farama.org/about"
|
|||
|
},
|
|||
|
{
|
|||
|
name: "Standards",
|
|||
|
link: "https://farama.org/project_standards",
|
|||
|
},
|
|||
|
{
|
|||
|
name: "Donate",
|
|||
|
link: "https://farama.org/donations"
|
|||
|
}
|
|||
|
]
|
|||
|
}
|
|||
|
|
|||
|
// Categorize projects
|
|||
|
Object.keys(jsonResponse).forEach(key => {
|
|||
|
projectJson = jsonResponse[key];
|
|||
|
if (projectJson.website !== null) {
|
|||
|
projectJson.link = projectJson.website;
|
|||
|
} else {
|
|||
|
projectJson.link = projectJson.github;
|
|||
|
}
|
|||
|
if (projectJson.type === "core") {
|
|||
|
sections["Core Projects"].push(projectJson)
|
|||
|
} else if (projectJson.type == "mature") {
|
|||
|
if (projectJson.website !== null) {
|
|||
|
sections["Mature Projects"]["Documentation"].push(projectJson)
|
|||
|
} else {
|
|||
|
sections["Mature Projects"]["Repositories"].push(projectJson)
|
|||
|
}
|
|||
|
} else {
|
|||
|
if (projectJson.website !== null) {
|
|||
|
sections["Incubating Projects"]["Documentation"].push(projectJson)
|
|||
|
} else {
|
|||
|
sections["Incubating Projects"]["Repositories"].push(projectJson)
|
|||
|
}
|
|||
|
}
|
|||
|
})
|
|||
|
|
|||
|
const menuContainer = document.querySelector(".farama-header-menu__body");
|
|||
|
|
|||
|
Object.keys(sections).forEach((key, i) => {
|
|||
|
const sectionElem = Object.assign(
|
|||
|
document.createElement('div'), {
|
|||
|
className:'farama-header-menu__section',
|
|||
|
}
|
|||
|
)
|
|||
|
sectionElem.appendChild(Object.assign(document.createElement('span'),
|
|||
|
{
|
|||
|
className:'farama-header-menu__section-title' ,
|
|||
|
innerText: key
|
|||
|
}
|
|||
|
))
|
|||
|
// is not a list
|
|||
|
if (sections[key].constructor !== Array) {
|
|||
|
const subSections = sections[key];
|
|||
|
const subSectionContainerElem = Object.assign(
|
|||
|
document.createElement('div'), {
|
|||
|
className:'farama-header-menu__subsections-container',
|
|||
|
style: 'display: flex'
|
|||
|
}
|
|||
|
)
|
|||
|
Object.keys(subSections).forEach((subKey, i) => {
|
|||
|
const subSectionElem = Object.assign(
|
|||
|
document.createElement('div'), {
|
|||
|
className:'farama-header-menu__subsection',
|
|||
|
}
|
|||
|
)
|
|||
|
subSectionElem.appendChild(Object.assign(document.createElement('span'),
|
|||
|
{
|
|||
|
className:'farama-header-menu__subsection-title' ,
|
|||
|
innerText: subKey
|
|||
|
}
|
|||
|
))
|
|||
|
const ulElem = createProjectsList(subSections[subKey], key !== 'Foundation');
|
|||
|
subSectionElem.appendChild(ulElem);
|
|||
|
subSectionContainerElem.appendChild(subSectionElem);
|
|||
|
})
|
|||
|
sectionElem.appendChild(subSectionContainerElem);
|
|||
|
} else {
|
|||
|
const projects = sections[key];
|
|||
|
const ulElem = createProjectsList(projects, true);
|
|||
|
sectionElem.appendChild(ulElem);
|
|||
|
}
|
|||
|
menuContainer.appendChild(sectionElem)
|
|||
|
});
|
|||
|
}
|
|||
|
|
|||
|
xhr.onerror = function() {
|
|||
|
console.error("Unable to load projects");
|
|||
|
};
|
|||
|
|
|||
|
xhr.send();
|
|||
|
</script>
|
|||
|
|
|||
|
|
|||
|
<script>
|
|||
|
const versioningConfig = {
|
|||
|
githubUser: 'Farama-Foundation',
|
|||
|
githubRepo: 'Gymnasium',
|
|||
|
};
|
|||
|
fetch('/main/_static/versioning/versioning_menu.html').then(response => {
|
|||
|
if (response.status === 200) {
|
|||
|
response.text().then(text => {
|
|||
|
const container = document.createElement("div");
|
|||
|
container.innerHTML = text;
|
|||
|
document.querySelector("body").appendChild(container);
|
|||
|
// innerHtml doenst evaluate scripts, we need to add them dynamically
|
|||
|
Array.from(container.querySelectorAll("script")).forEach(oldScript => {
|
|||
|
const newScript = document.createElement("script");
|
|||
|
Array.from(oldScript.attributes).forEach(attr => newScript.setAttribute(attr.name, attr.value));
|
|||
|
newScript.appendChild(document.createTextNode(oldScript.innerHTML));
|
|||
|
oldScript.parentNode.replaceChild(newScript, oldScript);
|
|||
|
});
|
|||
|
});
|
|||
|
} else {
|
|||
|
console.warn("Unable to load versioning menu", response);
|
|||
|
}
|
|||
|
});
|
|||
|
</script>
|
|||
|
|
|||
|
</body>
|
|||
|
</html>
|