index.html 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784
  1. <!doctype html>
  2. <html class="no-js" lang="en">
  3. <head><meta charset="utf-8"/>
  4. <meta name="viewport" content="width=device-width,initial-scale=1"/>
  5. <meta name="color-scheme" content="light dark">
  6. <meta name="description" content="Minigrid contains simple and easily configurable grid world environments to conduct Reinforcement Learning research. This library was previously known as gym-minigrid.">
  7. <meta property="og:title" content="MiniGrid Documentation" />
  8. <meta property="og:type" content="website" />
  9. <meta property="og:description" content="Minigrid contains simple and easily configurable grid world environments to conduct Reinforcement Learning research. This library was previously known as gym-minigrid." />
  10. <meta property="og:url" content="https://minigrid.farama.org/environments/minigrid/CrossingEnv.html" /><meta property="og:image" content="https://minigrid.farama.org//_static/img/minigrid-github.png" /><meta name="twitter:card" content="summary_large_image"><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
  11. <link rel="index" title="Index" href="../../../genindex/" /><link rel="search" title="Search" href="../../../search/" /><link rel="next" title="Dist Shift" href="../DistShiftEnv/" /><link rel="prev" title="Blocked Unlock Pickup" href="../BlockedUnlockPickupEnv/" />
  12. <link rel="canonical" href="https://minigrid.farama.org/environments/minigrid/CrossingEnv.html" />
  13. <link rel="shortcut icon" href="../../../_static/minigrid-favicon.png"/><!-- Generated with Sphinx 5.2.3 and Furo 2022.12.07.dev1 -->
  14. <title>Crossing - MiniGrid Documentation</title>
  15. <link rel="stylesheet" type="text/css" href="../../../_static/pygments.css" />
  16. <link rel="stylesheet" type="text/css" href="../../../_static/styles/furo.css?digest=cfd2cc3354364f303ef4a892d279bfffada5835d" />
  17. <link rel="stylesheet" type="text/css" href="../../../_static/styles/furo-extensions.css?digest=6342a809aabeb35cfac296000cfa245808bc1d78" />
  18. <style>
  19. body {
  20. --color-code-background: #f8f8f8;
  21. --color-code-foreground: black;
  22. }
  23. @media not print {
  24. body[data-theme="dark"] {
  25. --color-code-background: #202020;
  26. --color-code-foreground: #d0d0d0;
  27. }
  28. @media (prefers-color-scheme: dark) {
  29. body:not([data-theme="light"]) {
  30. --color-code-background: #202020;
  31. --color-code-foreground: #d0d0d0;
  32. }
  33. }
  34. }
  35. </style></head>
  36. <body>
  37. <header class="farama-header" aria-label="Farama header">
  38. <div class="farama-header__container">
  39. <div class="farama-header__left--mobile">
  40. <label class="nav-overlay-icon" for="__navigation">
  41. <div class="visually-hidden">Toggle site navigation sidebar</div>
  42. <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
  43. <defs></defs>
  44. <line x1="0.5" y1="4" x2="23.5" y2="4"></line>
  45. <line x1="0.232" y1="12" x2="23.5" y2="12"></line>
  46. <line x1="0.232" y1="20" x2="23.5" y2="20"></line>
  47. </svg>
  48. <!-- <svg viewBox="0 0 24 24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
  49. <line x1="0.5" y1="4.5" x2="23.5" y2="4.5" style="fill: none; "></line>
  50. <line x1="0.5" y1="12" x2="14" y2="12" ></line>
  51. <line x1="0.5" y1="19.5" x2="23.5" y2="19.5"></line>
  52. <polyline style="stroke-width: 0px;" points="17 7 22 12 17 17"></polyline>
  53. </svg> -->
  54. <!-- <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" style="width:20px">
  55. <defs></defs>
  56. <rect y="1" width="22" height="22" rx="2" ry="2" style="fill: none;" x="1"></rect>
  57. <line x1="8" y1="1" x2="8" y2="23"></line>
  58. <polyline style="stroke-linecap: round; fill: none; stroke-linejoin: round;" points="13 7 17 12 13 17"></polyline>
  59. </svg> -->
  60. </label>
  61. </div>
  62. <div class="farama-header__left farama-header__center--mobile">
  63. <a href="../../../">
  64. <img class="farama-header__logo only-light" src="../../../_static/img/minigrid.svg" alt="Light Logo"/>
  65. <img class="farama-header__logo only-dark" src="../../../_static/img/minigrid-white.svg" alt="Dark Logo"/>
  66. <span class="farama-header__title">MiniGrid Documentation</span>
  67. </a>
  68. </div>
  69. <div class="farama-header__right">
  70. <div class="farama-header-menu">
  71. <button class="farama-header-menu__btn" aria-label="Open Farama Menu" aria-expanded="false" aria-haspopup="true" aria-controls="farama-menu">
  72. <img class="farama-black-logo-invert" src="../../../_static/img/farama-logo-header.svg">
  73. <svg viewBox="0 0 24 24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
  74. <polyline style="stroke-linecap: round; stroke-linejoin: round; fill: none; stroke-width: 2px;" points="1 7 12 18 23 7"></polyline>
  75. </svg>
  76. </button>
  77. <div class="farama-header-menu-container farama-hidden" aria-hidden="true" id="farama-menu">
  78. <div class="farama-header-menu__header">
  79. <a href="https://farama.org">
  80. <img class="farama-header-menu__logo farama-white-logo-invert" src="../../../_static/img/farama_solid_white.svg" alt="Farama Foundation logo">
  81. <span>Farama Foundation</span>
  82. </a>
  83. <div class="farama-header-menu-header__right">
  84. <button id="farama-close-menu">
  85. <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor"
  86. stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon-close">
  87. <line x1="3" y1="21" x2="21" y2="3"></line>
  88. <line x1="3" y1="3" x2="21" y2="21"></line>
  89. </svg>
  90. </button>
  91. </div>
  92. </div>
  93. <div class="farama-header-menu__body">
  94. <!-- Response from farama.org/api/projects.json -->
  95. </div>
  96. </div>
  97. </div>
  98. </div>
  99. </div>
  100. </header>
  101. <script>
  102. document.body.dataset.theme = localStorage.getItem("theme") || "auto";
  103. </script>
  104. <svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
  105. <symbol id="svg-toc" viewBox="0 0 24 24">
  106. <title>Contents</title>
  107. <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 1024 1024">
  108. <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"/>
  109. </svg>
  110. </symbol>
  111. <symbol id="svg-menu" viewBox="0 0 24 24">
  112. <title>Menu</title>
  113. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
  114. stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-menu">
  115. <line x1="3" y1="12" x2="21" y2="12"></line>
  116. <line x1="3" y1="6" x2="21" y2="6"></line>
  117. <line x1="3" y1="18" x2="21" y2="18"></line>
  118. </svg>
  119. </symbol>
  120. <symbol id="svg-arrow-right" viewBox="0 0 24 24">
  121. <title>Expand</title>
  122. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
  123. stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-chevron-right">
  124. <polyline points="9 18 15 12 9 6"></polyline>
  125. </svg>
  126. </symbol>
  127. <symbol id="svg-sun" viewBox="0 0 24 24">
  128. <title>Light mode</title>
  129. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
  130. stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather-sun">
  131. <circle cx="12" cy="12" r="5"></circle>
  132. <line x1="12" y1="1" x2="12" y2="3"></line>
  133. <line x1="12" y1="21" x2="12" y2="23"></line>
  134. <line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
  135. <line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
  136. <line x1="1" y1="12" x2="3" y2="12"></line>
  137. <line x1="21" y1="12" x2="23" y2="12"></line>
  138. <line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
  139. <line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
  140. </svg>
  141. </symbol>
  142. <symbol id="svg-moon" viewBox="0 0 24 24">
  143. <title>Dark mode</title>
  144. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
  145. stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-moon">
  146. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  147. <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" />
  148. </svg>
  149. </symbol>
  150. <symbol id="svg-sun-half" viewBox="0 0 24 24">
  151. <title>Auto light/dark mode</title>
  152. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
  153. stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-shadow">
  154. <path stroke="none" d="M0 0h24v24H0z" fill="none"/>
  155. <circle cx="12" cy="12" r="9" />
  156. <path d="M13 12h5" />
  157. <path d="M13 15h4" />
  158. <path d="M13 18h1" />
  159. <path d="M13 9h4" />
  160. <path d="M13 6h1" />
  161. </svg>
  162. </symbol>
  163. </svg>
  164. <input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation">
  165. <input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc">
  166. <label class="overlay sidebar-overlay" for="__navigation">
  167. <div class="visually-hidden">Hide navigation sidebar</div>
  168. </label>
  169. <label class="overlay toc-overlay" for="__toc">
  170. <div class="visually-hidden">Hide table of contents sidebar</div>
  171. </label>
  172. <div class="page">
  173. <!--<header class="mobile-header">
  174. <div class="header-left">
  175. <label class="nav-overlay-icon" for="__navigation">
  176. <div class="visually-hidden">Toggle site navigation sidebar</div>
  177. <i class="icon"><svg><use href="#svg-menu"></use></svg></i>
  178. </label>
  179. </div>
  180. <div class="header-center">
  181. <a href="../../../"><div class="brand">MiniGrid Documentation</div></a>
  182. </div>
  183. <div class="header-right">
  184. <div class="theme-toggle-container theme-toggle-header">
  185. <button class="theme-toggle">
  186. <div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
  187. <svg class="theme-icon-when-auto"><use href="#svg-sun-half"></use></svg>
  188. <svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
  189. <svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
  190. </button>
  191. </div>
  192. <label class="toc-overlay-icon toc-header-icon" for="__toc">
  193. <div class="visually-hidden">Toggle table of contents sidebar</div>
  194. <i class="icon"><svg><use href="#svg-toc"></use></svg></i>
  195. </label>
  196. </div>
  197. </header>-->
  198. <aside class="sidebar-drawer">
  199. <div class="sidebar-container">
  200. <div class="sidebar-sticky"><a class="farama-sidebar__title" href="../../../">
  201. <img class="farama-header__logo only-light" src="../../../_static/img/minigrid.svg" alt="Light Logo"/>
  202. <img class="farama-header__logo only-dark" src="../../../_static/img/minigrid-white.svg" alt="Dark Logo"/>
  203. <span class="farama-header__title">MiniGrid Documentation</span>
  204. </a><form class="sidebar-search-container" method="get" action="../../../search/" role="search">
  205. <input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
  206. <input type="hidden" name="check_keywords" value="yes">
  207. <input type="hidden" name="area" value="default">
  208. </form>
  209. <div id="searchbox"></div><div class="sidebar-scroll"><div class="sidebar-tree">
  210. <p class="caption" role="heading"><span class="caption-text">Introduction</span></p>
  211. <ul>
  212. <li class="toctree-l1"><a class="reference internal" href="../../../content/basic_usage/">Basic Usage</a></li>
  213. <li class="toctree-l1"><a class="reference internal" href="../../../content/basic_usage/#training-an-agent">Training an Agent</a></li>
  214. <li class="toctree-l1"><a class="reference internal" href="../../../content/publications/">List of Publications</a></li>
  215. <li class="toctree-l1"><a class="reference internal" href="../../../content/create_env_tutorial/">Tutorial on Creating Environments</a></li>
  216. </ul>
  217. <p class="caption" role="heading"><span class="caption-text">Wrappers</span></p>
  218. <ul>
  219. <li class="toctree-l1 has-children"><a class="reference internal" href="../../../api/wrapper/">Wrapper</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 child pages in navigation</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
  220. <li class="toctree-l2"><a class="reference internal" href="../../../api/wrappers/">Action Bonus</a></li>
  221. <li class="toctree-l2"><a class="reference internal" href="../../../api/wrappers/#dict-observation-space">Dict Observation Space</a></li>
  222. <li class="toctree-l2"><a class="reference internal" href="../../../api/wrappers/#direction-obs">Direction Obs</a></li>
  223. <li class="toctree-l2"><a class="reference internal" href="../../../api/wrappers/#flatobs">FlatObs</a></li>
  224. <li class="toctree-l2"><a class="reference internal" href="../../../api/wrappers/#fully-obs">Fully Obs</a></li>
  225. <li class="toctree-l2"><a class="reference internal" href="../../../api/wrappers/#observation">Observation</a></li>
  226. <li class="toctree-l2"><a class="reference internal" href="../../../api/wrappers/#one-hot-partial-obs">One Hot Partial Obs</a></li>
  227. <li class="toctree-l2"><a class="reference internal" href="../../../api/wrappers/#reseed">Reseed</a></li>
  228. <li class="toctree-l2"><a class="reference internal" href="../../../api/wrappers/#rgb-img-obs">RGB Img Obs</a></li>
  229. <li class="toctree-l2"><a class="reference internal" href="../../../api/wrappers/#position-bonus">Position Bonus</a></li>
  230. <li class="toctree-l2"><a class="reference internal" href="../../../api/wrappers/#symbolic-obs">Symbolic Obs</a></li>
  231. <li class="toctree-l2"><a class="reference internal" href="../../../api/wrappers/#view-size">View Size</a></li>
  232. </ul>
  233. </li>
  234. </ul>
  235. <p class="caption" role="heading"><span class="caption-text">Environments</span></p>
  236. <ul class="current">
  237. <li class="toctree-l1 current has-children"><a class="reference internal" href="../">Minigrid Environments</a><input checked="" 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 child pages in navigation</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul class="current">
  238. <li class="toctree-l2"><a class="reference internal" href="../BlockedUnlockPickupEnv/">Blocked Unlock Pickup</a></li>
  239. <li class="toctree-l2 current current-page"><a class="current reference internal" href="#">Crossing</a></li>
  240. <li class="toctree-l2"><a class="reference internal" href="../DistShiftEnv/">Dist Shift</a></li>
  241. <li class="toctree-l2"><a class="reference internal" href="../DoorKeyEnv/">Door Key</a></li>
  242. <li class="toctree-l2"><a class="reference internal" href="../DynamicObstaclesEnv/">Dynamic Obstacles</a></li>
  243. <li class="toctree-l2"><a class="reference internal" href="../EmptyEnv/">Empty</a></li>
  244. <li class="toctree-l2"><a class="reference internal" href="../FetchEnv/">Fetch</a></li>
  245. <li class="toctree-l2"><a class="reference internal" href="../FourRoomsEnv/">Four Rooms</a></li>
  246. <li class="toctree-l2"><a class="reference internal" href="../GoToDoorEnv/">Go To Door</a></li>
  247. <li class="toctree-l2"><a class="reference internal" href="../GoToObjectEnv/">Go To Object</a></li>
  248. <li class="toctree-l2"><a class="reference internal" href="../KeyCorridorEnv/">Key Corridor</a></li>
  249. <li class="toctree-l2"><a class="reference internal" href="../LavaGapEnv/">Lava Gap</a></li>
  250. <li class="toctree-l2"><a class="reference internal" href="../LockedRoomEnv/">Locked Room</a></li>
  251. <li class="toctree-l2"><a class="reference internal" href="../MemoryEnv/">Memory</a></li>
  252. <li class="toctree-l2"><a class="reference internal" href="../MultiRoomEnv/">Multi Room</a></li>
  253. <li class="toctree-l2"><a class="reference internal" href="../ObstructedMaze_1Dlhb/">Obstructed Maze Dlhb</a></li>
  254. <li class="toctree-l2"><a class="reference internal" href="../ObstructedMaze_Full/">Obstructed Maze Full</a></li>
  255. <li class="toctree-l2"><a class="reference internal" href="../PlaygroundEnv/">Playground</a></li>
  256. <li class="toctree-l2"><a class="reference internal" href="../PutNearEnv/">Put Near</a></li>
  257. <li class="toctree-l2"><a class="reference internal" href="../RedBlueDoorEnv/">Red Blue Door</a></li>
  258. <li class="toctree-l2"><a class="reference internal" href="../UnlockEnv/">Unlock</a></li>
  259. <li class="toctree-l2"><a class="reference internal" href="../UnlockPickupEnv/">Unlock Pickup</a></li>
  260. </ul>
  261. </li>
  262. <li class="toctree-l1 has-children"><a class="reference internal" href="../../babyai/">BabyAI Environments</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 child pages in navigation</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
  263. <li class="toctree-l2"><a class="reference internal" href="../../babyai/GoToRedBallGrey/">Go To Red Ball Grey</a></li>
  264. <li class="toctree-l2"><a class="reference internal" href="../../babyai/GoToRedBall/">Go To Red Ball</a></li>
  265. <li class="toctree-l2"><a class="reference internal" href="../../babyai/GoToRedBallNoDists/">Go To Red Ball No Dists</a></li>
  266. <li class="toctree-l2"><a class="reference internal" href="../../babyai/GoToObj/">Go To Obj</a></li>
  267. <li class="toctree-l2"><a class="reference internal" href="../../babyai/GoToLocal/">Go To Local</a></li>
  268. <li class="toctree-l2"><a class="reference internal" href="../../babyai/GoTo/">Go To</a></li>
  269. <li class="toctree-l2"><a class="reference internal" href="../../babyai/GoToImpUnlock/">Go To Imp Unlock</a></li>
  270. <li class="toctree-l2"><a class="reference internal" href="../../babyai/GoToSeq/">Go To Seq</a></li>
  271. <li class="toctree-l2"><a class="reference internal" href="../../babyai/GoToRedBlueBall/">Go To Red Blue Ball</a></li>
  272. <li class="toctree-l2"><a class="reference internal" href="../../babyai/GoToDoor/">Go To Door</a></li>
  273. <li class="toctree-l2"><a class="reference internal" href="../../babyai/GoToObjDoor/">Go To Obj Door</a></li>
  274. <li class="toctree-l2"><a class="reference internal" href="../../babyai/Open/">Open</a></li>
  275. <li class="toctree-l2"><a class="reference internal" href="../../babyai/OpenRedDoor/">Open Red Door</a></li>
  276. <li class="toctree-l2"><a class="reference internal" href="../../babyai/OpenDoor/">Open Door</a></li>
  277. <li class="toctree-l2"><a class="reference internal" href="../../babyai/OpenTwoDoors/">Open Two Doors</a></li>
  278. <li class="toctree-l2"><a class="reference internal" href="../../babyai/OpenDoorsOrder/">Open Doors Order</a></li>
  279. <li class="toctree-l2"><a class="reference internal" href="../../babyai/Pickup/">Pickup</a></li>
  280. <li class="toctree-l2"><a class="reference internal" href="../../babyai/UnblockPickup/">Unblock Pickup</a></li>
  281. <li class="toctree-l2"><a class="reference internal" href="../../babyai/PickupLoc/">Pickup Loc</a></li>
  282. <li class="toctree-l2"><a class="reference internal" href="../../babyai/PickupDist/">Pickup Dist</a></li>
  283. <li class="toctree-l2"><a class="reference internal" href="../../babyai/PickupAbove/">Pickup Above</a></li>
  284. <li class="toctree-l2"><a class="reference internal" href="../../babyai/PutNextLocal/">Put Next Local</a></li>
  285. <li class="toctree-l2"><a class="reference internal" href="../../babyai/PutNext/">Put Next</a></li>
  286. <li class="toctree-l2"><a class="reference internal" href="../../babyai/Unlock/">Unlock</a></li>
  287. <li class="toctree-l2"><a class="reference internal" href="../../babyai/UnlockLocal/">Unlock Local</a></li>
  288. <li class="toctree-l2"><a class="reference internal" href="../../babyai/KeyInBox/">Key In Box</a></li>
  289. <li class="toctree-l2"><a class="reference internal" href="../../babyai/UnlockPickup/">Unlock Pickup</a></li>
  290. <li class="toctree-l2"><a class="reference internal" href="../../babyai/BlockedUnlockPickup/">Blocked Unlock Pickup</a></li>
  291. <li class="toctree-l2"><a class="reference internal" href="../../babyai/UnlockToUnlock/">Unlock To Unlock</a></li>
  292. <li class="toctree-l2"><a class="reference internal" href="../../babyai/ActionObjDoor/">Action Obj Door</a></li>
  293. <li class="toctree-l2"><a class="reference internal" href="../../babyai/FindObjS5/">Find Obj</a></li>
  294. <li class="toctree-l2"><a class="reference internal" href="../../babyai/KeyCorridor/">Key Corridor</a></li>
  295. <li class="toctree-l2"><a class="reference internal" href="../../babyai/OneRoomS8/">One Room</a></li>
  296. <li class="toctree-l2"><a class="reference internal" href="../../babyai/MoveTwoAcross/">Move Two Across</a></li>
  297. <li class="toctree-l2"><a class="reference internal" href="../../babyai/Synth/">Synth</a></li>
  298. <li class="toctree-l2"><a class="reference internal" href="../../babyai/SynthLoc/">Synth Loc</a></li>
  299. <li class="toctree-l2"><a class="reference internal" href="../../babyai/SynthSeq/">Synth Seq</a></li>
  300. <li class="toctree-l2"><a class="reference internal" href="../../babyai/MiniBossLevel/">Mini Boss Level</a></li>
  301. <li class="toctree-l2"><a class="reference internal" href="../../babyai/BossLevel/">Boss Level</a></li>
  302. <li class="toctree-l2"><a class="reference internal" href="../../babyai/BossLevelNoUnlock/">Boss Level No Unlock</a></li>
  303. </ul>
  304. </li>
  305. </ul>
  306. <p class="caption" role="heading"><span class="caption-text">Development</span></p>
  307. <ul>
  308. <li class="toctree-l1"><a class="reference internal" href="../../../release_notes/">Release Notes</a></li>
  309. <li class="toctree-l1"><a class="reference external" href="https://github.com/Farama-Foundation/MiniGrid">Github</a></li>
  310. </ul>
  311. </div>
  312. </div>
  313. </div>
  314. </div>
  315. </aside>
  316. <div class="main-container">
  317. <div class="main">
  318. <div class="content">
  319. <div class="article-container">
  320. <a href="#" class="back-to-top muted-link">
  321. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
  322. <path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12z"></path>
  323. </svg>
  324. <span>Back to top</span>
  325. </a>
  326. <div class="content-icon-container"><div class="theme-toggle-container theme-toggle-content">
  327. <button class="theme-toggle" title="Toggle color theme">
  328. <div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
  329. <svg class="theme-icon-when-auto">
  330. <use href="#svg-sun-half"></use>
  331. </svg>
  332. <svg class="theme-icon-when-dark">
  333. <use href="#svg-moon"></use>
  334. </svg>
  335. <svg class="theme-icon-when-light">
  336. <use href="#svg-sun"></use>
  337. </svg>
  338. </button>
  339. </div>
  340. <label class="toc-overlay-icon toc-content-icon" for="__toc">
  341. <div class="visually-hidden">Toggle table of contents sidebar</div>
  342. <i class="icon"><svg>
  343. <use href="#svg-toc"></use>
  344. </svg></i>
  345. </label>
  346. </div>
  347. <article role="main">
  348. <section id="crossing">
  349. <h1>Crossing<a class="headerlink" href="#crossing" title="Permalink to this heading">#</a></h1>
  350. <figure class="align-default">
  351. <a class="reference internal image-reference" href="../../../_images/CrossingEnv.gif"><img alt="Crossing" src="../../../_images/CrossingEnv.gif" style="width: 200px;" /></a>
  352. </figure>
  353. <section id="description">
  354. <h2>Description<a class="headerlink" href="#description" title="Permalink to this heading">#</a></h2>
  355. <p>Depending on the <code class="docutils literal notranslate"><span class="pre">obstacle_type</span></code> parameter:</p>
  356. <ul class="simple">
  357. <li><p><code class="docutils literal notranslate"><span class="pre">Lava</span></code> - The agent has to reach the green goal square on the other corner
  358. of the room while avoiding rivers of deadly lava which terminate the
  359. episode in failure. Each lava stream runs across the room either
  360. horizontally or vertically, and has a single crossing point which can be
  361. safely used; Luckily, a path to the goal is guaranteed to exist. This
  362. environment is useful for studying safety and safe exploration.</p></li>
  363. <li><p>otherwise - Similar to the <code class="docutils literal notranslate"><span class="pre">LavaCrossing</span></code> environment, the agent has to
  364. reach the green goal square on the other corner of the room, however
  365. lava is replaced by walls. This MDP is therefore much easier and maybe
  366. useful for quickly testing your algorithms.</p></li>
  367. </ul>
  368. </section>
  369. <section id="mission-space">
  370. <h2>Mission Space<a class="headerlink" href="#mission-space" title="Permalink to this heading">#</a></h2>
  371. <p>Depending on the <code class="docutils literal notranslate"><span class="pre">obstacle_type</span></code> parameter:</p>
  372. <ul class="simple">
  373. <li><p><code class="docutils literal notranslate"><span class="pre">Lava</span></code> - “avoid the lava and get to the green goal square”</p></li>
  374. <li><p>otherwise - “find the opening and get to the green goal square”</p></li>
  375. </ul>
  376. </section>
  377. <section id="action-space">
  378. <h2>Action Space<a class="headerlink" href="#action-space" title="Permalink to this heading">#</a></h2>
  379. <div class="table-wrapper colwidths-auto docutils container">
  380. <table class="docutils align-default">
  381. <thead>
  382. <tr class="row-odd"><th class="head"><p>Num</p></th>
  383. <th class="head"><p>Name</p></th>
  384. <th class="head"><p>Action</p></th>
  385. </tr>
  386. </thead>
  387. <tbody>
  388. <tr class="row-even"><td><p>0</p></td>
  389. <td><p>left</p></td>
  390. <td><p>Turn left</p></td>
  391. </tr>
  392. <tr class="row-odd"><td><p>1</p></td>
  393. <td><p>right</p></td>
  394. <td><p>Turn right</p></td>
  395. </tr>
  396. <tr class="row-even"><td><p>2</p></td>
  397. <td><p>forward</p></td>
  398. <td><p>Move forward</p></td>
  399. </tr>
  400. <tr class="row-odd"><td><p>3</p></td>
  401. <td><p>pickup</p></td>
  402. <td><p>Unused</p></td>
  403. </tr>
  404. <tr class="row-even"><td><p>4</p></td>
  405. <td><p>drop</p></td>
  406. <td><p>Unused</p></td>
  407. </tr>
  408. <tr class="row-odd"><td><p>5</p></td>
  409. <td><p>toggle</p></td>
  410. <td><p>Unused</p></td>
  411. </tr>
  412. <tr class="row-even"><td><p>6</p></td>
  413. <td><p>done</p></td>
  414. <td><p>Unused</p></td>
  415. </tr>
  416. </tbody>
  417. </table>
  418. </div>
  419. </section>
  420. <section id="observation-encoding">
  421. <h2>Observation Encoding<a class="headerlink" href="#observation-encoding" title="Permalink to this heading">#</a></h2>
  422. <ul class="simple">
  423. <li><p>Each tile is encoded as a 3 dimensional tuple:
  424. <code class="docutils literal notranslate"><span class="pre">(OBJECT_IDX,</span> <span class="pre">COLOR_IDX,</span> <span class="pre">STATE)</span></code></p></li>
  425. <li><p><code class="docutils literal notranslate"><span class="pre">OBJECT_TO_IDX</span></code> and <code class="docutils literal notranslate"><span class="pre">COLOR_TO_IDX</span></code> mapping can be found in
  426. <a class="reference internal" href="#minigrid/minigrid.py"><span class="xref myst">minigrid/minigrid.py</span></a></p></li>
  427. <li><p><code class="docutils literal notranslate"><span class="pre">STATE</span></code> refers to the door state with 0=open, 1=closed and 2=locked</p></li>
  428. </ul>
  429. </section>
  430. <section id="rewards">
  431. <h2>Rewards<a class="headerlink" href="#rewards" title="Permalink to this heading">#</a></h2>
  432. <p>A reward of ‘1 - 0.9 * (step_count / max_steps)’ is given for success, and ‘0’ for failure.</p>
  433. </section>
  434. <section id="termination">
  435. <h2>Termination<a class="headerlink" href="#termination" title="Permalink to this heading">#</a></h2>
  436. <p>The episode ends if any one of the following conditions is met:</p>
  437. <ol class="arabic simple">
  438. <li><p>The agent reaches the goal.</p></li>
  439. <li><p>The agent falls into lava.</p></li>
  440. <li><p>Timeout (see <code class="docutils literal notranslate"><span class="pre">max_steps</span></code>).</p></li>
  441. </ol>
  442. </section>
  443. <section id="registered-configurations">
  444. <h2>Registered Configurations<a class="headerlink" href="#registered-configurations" title="Permalink to this heading">#</a></h2>
  445. <p>S: size of the map SxS.
  446. N: number of valid crossings across lava or walls from the starting position
  447. to the goal</p>
  448. <ul class="simple">
  449. <li><p><code class="docutils literal notranslate"><span class="pre">Lava</span></code> :</p>
  450. <ul>
  451. <li><p><code class="docutils literal notranslate"><span class="pre">MiniGrid-LavaCrossingS9N1-v0</span></code></p></li>
  452. <li><p><code class="docutils literal notranslate"><span class="pre">MiniGrid-LavaCrossingS9N2-v0</span></code></p></li>
  453. <li><p><code class="docutils literal notranslate"><span class="pre">MiniGrid-LavaCrossingS9N3-v0</span></code></p></li>
  454. <li><p><code class="docutils literal notranslate"><span class="pre">MiniGrid-LavaCrossingS11N5-v0</span></code></p></li>
  455. </ul>
  456. </li>
  457. <li><p>otherwise :</p>
  458. <ul>
  459. <li><p><code class="docutils literal notranslate"><span class="pre">MiniGrid-SimpleCrossingS9N1-v0</span></code></p></li>
  460. <li><p><code class="docutils literal notranslate"><span class="pre">MiniGrid-SimpleCrossingS9N2-v0</span></code></p></li>
  461. <li><p><code class="docutils literal notranslate"><span class="pre">MiniGrid-SimpleCrossingS9N3-v0</span></code></p></li>
  462. <li><p><code class="docutils literal notranslate"><span class="pre">MiniGrid-SimpleCrossingS11N5-v0</span></code></p></li>
  463. </ul>
  464. </li>
  465. </ul>
  466. </section>
  467. </section>
  468. </article>
  469. </div>
  470. <footer>
  471. <div class="related-pages">
  472. <a class="next-page" href="../DistShiftEnv/">
  473. <div class="page-info">
  474. <div class="context">
  475. <span>Next</span>
  476. </div>
  477. <div class="title">Dist Shift</div>
  478. </div>
  479. <svg class="furo-related-icon">
  480. <use href="#svg-arrow-right"></use>
  481. </svg>
  482. </a>
  483. <a class="prev-page" href="../BlockedUnlockPickupEnv/">
  484. <svg class="furo-related-icon">
  485. <use href="#svg-arrow-right"></use>
  486. </svg>
  487. <div class="page-info">
  488. <div class="context">
  489. <span>Previous</span>
  490. </div>
  491. <div class="title">Blocked Unlock Pickup</div>
  492. </div>
  493. </a>
  494. </div>
  495. <div class="bottom-of-page">
  496. <div class="left-details">
  497. <div class="copyright">
  498. Copyright &#169; 2023 Farama Foundation
  499. </div>
  500. <!--
  501. Made with <a href="https://www.sphinx-doc.org/">Sphinx</a> and <a class="muted-link" href="https://pradyunsg.me">@pradyunsg</a>'s
  502. <a href="https://github.com/pradyunsg/furo">Furo</a>
  503. -->
  504. </div>
  505. <div class="right-details">
  506. <div class="icons">
  507. <a class="muted-link" href="https://github.com/Farama-Foundation/Minigrid/"
  508. aria-label="On GitHub">
  509. <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16">
  510. <path fill-rule="evenodd"
  511. 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">
  512. </path>
  513. </svg>
  514. </a>
  515. </div>
  516. </div>
  517. </div>
  518. </footer>
  519. </div>
  520. <aside class="toc-drawer">
  521. <div class="toc-sticky toc-scroll">
  522. <div class="toc-title-container">
  523. <span class="toc-title">
  524. On this page
  525. </span>
  526. </div>
  527. <div class="toc-tree-container">
  528. <div class="toc-tree">
  529. <ul>
  530. <li><a class="reference internal" href="#">Crossing</a><ul>
  531. <li><a class="reference internal" href="#description">Description</a></li>
  532. <li><a class="reference internal" href="#mission-space">Mission Space</a></li>
  533. <li><a class="reference internal" href="#action-space">Action Space</a></li>
  534. <li><a class="reference internal" href="#observation-encoding">Observation Encoding</a></li>
  535. <li><a class="reference internal" href="#rewards">Rewards</a></li>
  536. <li><a class="reference internal" href="#termination">Termination</a></li>
  537. <li><a class="reference internal" href="#registered-configurations">Registered Configurations</a></li>
  538. </ul>
  539. </li>
  540. </ul>
  541. </div>
  542. </div>
  543. </div>
  544. </aside>
  545. </div>
  546. </div>
  547. </div>
  548. <script>
  549. const toggleMenu = () => {
  550. const menuBtn = document.querySelector(".farama-header-menu__btn");
  551. const menuContainer = document.querySelector(".farama-header-menu-container");
  552. if (document.querySelector(".farama-header-menu").classList.contains("active")) {
  553. menuBtn.setAttribute("aria-expanded", "false");
  554. menuContainer.setAttribute("aria-hidden", "true");
  555. } else {
  556. menuBtn.setAttribute("aria-expanded", "true");
  557. menuContainer.setAttribute("aria-hidden", "false");
  558. }
  559. document.querySelector(".farama-header-menu").classList.toggle("active");
  560. }
  561. document.querySelector(".farama-header-menu__btn").addEventListener("click", toggleMenu);
  562. document.getElementById("farama-close-menu").addEventListener("click", toggleMenu);
  563. </script>
  564. <script>
  565. (() => {
  566. if (!localStorage.getItem("shownCookieAlert")) {
  567. const boxElem = document.createElement("div");
  568. boxElem.classList.add("cookie-alert");
  569. const containerElem = document.createElement("div");
  570. containerElem.classList.add("cookie-alert__container");
  571. const textElem = document.createElement("p");
  572. textElem.innerHTML = `This page uses <a href="https://analytics.google.com/">
  573. Google Analytics</a> to collect statistics. You can disable it by blocking
  574. the JavaScript coming from www.google-analytics.com.`;
  575. containerElem.appendChild(textElem);
  576. const closeBtn = document.createElement("button");
  577. closeBtn.innerHTML = `<?xml version="1.0" ?><svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><defs><style>.cls-1{fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:2px;}</style></defs><title/><g id="cross"><line class="cls-1" x1="7" x2="25" y1="7" y2="25"/><line class="cls-1" x1="7" x2="25" y1="25" y2="7"/></g></svg>`
  578. closeBtn.onclick = () => {
  579. localStorage.setItem("shownCookieAlert", "true");
  580. boxElem.style.display = "none";
  581. }
  582. containerElem.appendChild(closeBtn);
  583. boxElem.appendChild(containerElem);
  584. document.body.appendChild(boxElem);
  585. }
  586. })()
  587. </script>
  588. <script async src="https://www.googletagmanager.com/gtag/js?id=G-FBXJQQLXKD"></script>
  589. <script>
  590. window.dataLayer = window.dataLayer || [];
  591. function gtag(){dataLayer.push(arguments);}
  592. gtag('js', new Date());
  593. gtag('config', 'G-FBXJQQLXKD');
  594. </script>
  595. <script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script>
  596. <script src="../../../_static/jquery.js"></script>
  597. <script src="../../../_static/underscore.js"></script>
  598. <script src="../../../_static/_sphinx_javascript_frameworks_compat.js"></script>
  599. <script src="../../../_static/doctools.js"></script>
  600. <script src="../../../_static/sphinx_highlight.js"></script>
  601. <script src="../../../_static/scripts/furo.js"></script>
  602. <script>
  603. // Create menu with Farama projects by using the API at farama.org/api/projects.json
  604. const createCORSRequest = (method, url) => {
  605. let xhr = new XMLHttpRequest();
  606. xhr.responseType = 'json';
  607. if ("withCredentials" in xhr) {
  608. xhr.open(method, url, true);
  609. } else if (typeof XDomainRequest != "undefined") {
  610. // IE8 & IE9
  611. xhr = new XDomainRequest();
  612. xhr.open(method, url);
  613. } else {
  614. // CORS not supported.
  615. xhr = null;
  616. }
  617. return xhr;
  618. };
  619. const url = 'https://farama.org/api/projects.json';
  620. const imagesBasepath = "https://farama.org/assets/images"
  621. const method = 'GET';
  622. let xhr = createCORSRequest(method, url);
  623. xhr.onload = () => {
  624. const jsonResponse = xhr.response;
  625. const sections = {
  626. "Documentation": [],
  627. "Mature Projects": [],
  628. "Incubating Projects": [],
  629. "Foundation": [
  630. {
  631. name: "About",
  632. link: "https://farama.org/about"
  633. },
  634. {
  635. name: "Standards",
  636. link: "https://farama.org/project_standards",
  637. },
  638. {
  639. name: "Donate",
  640. link: "https://farama.org/donations"
  641. }
  642. ]
  643. }
  644. Object.keys(jsonResponse).forEach(key => {
  645. projectJson = jsonResponse[key];
  646. if (projectJson.website !== null) {
  647. projectJson.link = projectJson.website;
  648. sections["Documentation"].push(projectJson)
  649. } else if (projectJson.type == "mature") {
  650. projectJson.link = projectJson.github;
  651. sections["Mature Projects"].push(projectJson)
  652. } else {
  653. projectJson.link = projectJson.github;
  654. sections["Incubating Projects"].push(projectJson)
  655. }
  656. })
  657. const menuContainer = document.querySelector(".farama-header-menu__body");
  658. Object.keys(sections).forEach((key, i) => {
  659. projects = sections[key];
  660. const sectionElem = Object.assign(
  661. document.createElement('div'), {
  662. className:'farama-header-menu__section',
  663. style: "padding-left: 24px"
  664. }
  665. )
  666. sectionElem.appendChild(Object.assign(document.createElement('span'),
  667. {
  668. className:'farama-header-menu__section-title' ,
  669. innerText: key
  670. }
  671. ))
  672. const ulElem = Object.assign(document.createElement('ul'),
  673. {
  674. className:'farama-header-menu-list',
  675. }
  676. )
  677. for (let project of projects) {
  678. const liElem = document.createElement("li");
  679. const aElem = Object.assign(document.createElement("a"),
  680. {
  681. href: project.link
  682. }
  683. );
  684. liElem.appendChild(aElem);
  685. if (key !== "Foundation") {
  686. const imgElem = Object.assign(document.createElement("img"),
  687. {
  688. src: project.image ? imagesBasepath + project.image : imagesBasepath + "/farama_black.svg",
  689. alt: `${project.name} logo`,
  690. className: "farama-black-logo-invert"
  691. }
  692. );
  693. aElem.appendChild(imgElem);
  694. }
  695. aElem.appendChild(document.createTextNode(project.name));
  696. ulElem.appendChild(liElem);
  697. }
  698. sectionElem.appendChild(ulElem);
  699. menuContainer.appendChild(sectionElem)
  700. });
  701. }
  702. xhr.onerror = function() {
  703. console.error("Unable to load projects");
  704. };
  705. xhr.send();
  706. </script>
  707. <script>
  708. const versioningConfig = {
  709. githubUser: 'Farama-Foundation',
  710. githubRepo: 'Minigrid',
  711. };
  712. fetch('/main/_static/versioning/versioning_menu.html').then(response => {
  713. if (response.status === 200) {
  714. response.text().then(text => {
  715. const container = document.createElement("div");
  716. container.innerHTML = text;
  717. document.querySelector("body").appendChild(container);
  718. // innerHtml doenst evaluate scripts, we need to add them dynamically
  719. Array.from(container.querySelectorAll("script")).forEach(oldScript => {
  720. const newScript = document.createElement("script");
  721. Array.from(oldScript.attributes).forEach(attr => newScript.setAttribute(attr.name, attr.value));
  722. newScript.appendChild(document.createTextNode(oldScript.innerHTML));
  723. oldScript.parentNode.replaceChild(newScript, oldScript);
  724. });
  725. });
  726. } else {
  727. console.warn("Unable to load versioning menu", response);
  728. }
  729. });
  730. </script>
  731. </body>
  732. </html>