index.html 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725
  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="">
  7. <meta property="og:title" content="MiniGrid Documentation" />
  8. <meta property="og:type" content="website" />
  9. <meta property="og:description" content="" />
  10. <meta property="og:url" content="https://minigrid.farama.org/environments/minigrid/DistShiftEnv.html" /><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="Door Key" href="../DoorKeyEnv/" /><link rel="prev" title="Crossing" href="../CrossingEnv/" />
  12. <link rel="canonical" href="https://minigrid.farama.org/environments/minigrid/DistShiftEnv.html" />
  13. <link rel="shortcut icon" href="../../../_static/minigrid-favicon.png"/><meta name="generator" content="sphinx-5.2.3, furo 2022.09.15.dev1"/>
  14. <title>Dist Shift - 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=9ec31e2665bf879c1d47d93a8ec4893870ee1e45" />
  17. <link rel="stylesheet" type="text/css" href="../../../_static/styles/furo-extensions.css?digest=6e5c1b8ed2a40fe812b456d29406f7f0a7f2228c" />
  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">
  38. <div class="farama-header__container">
  39. <div class="farama-header__left">
  40. <a href="../../../">
  41. <img class="farama-header__logo only-light" src="../../../_static/img/minigrid.svg" alt="Light Logo"/>
  42. <img class="farama-header__logo only-dark" src="../../../_static/img/minigrid-white.svg" alt="Dark Logo"/>
  43. <h1 class="farama-header__title">MiniGrid Documentation</h1>
  44. </a>
  45. </div>
  46. <div class="farama-header__right">
  47. <div class="farama-header-menu">
  48. <div class="farama-header-menu__btn">
  49. <span class="farama-header-menu__btn-name">
  50. Farama Foundation
  51. </span>
  52. <svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:bx="https://boxy-svg.com">
  53. <defs></defs>
  54. <path d="M 3 4.677 C 3 3.751 3.659 3 4.474 3 L 27.526 3 C 28.341 3 29 3.751 29 4.677 C 29 5.603 28.341 6.354 27.526 6.354 L 4.474 6.354 C 3.659 6.354 3 5.603 3 4.677 Z" bx:origin="0.622825 3.875593"></path>
  55. <path d="M 3 16 C 3 15.074 3.659 14.323 4.474 14.323 L 27.526 14.323 C 28.341 14.323 29 15.074 29 16 C 29 16.926 28.341 17.677 27.526 17.677 L 4.474 17.677 C 3.659 17.677 3 16.926 3 16 Z" bx:origin="0.622825 0.5"></path>
  56. <path d="M 3 27.323 C 3 26.397 3.659 25.646 4.474 25.646 L 27.526 25.646 C 28.341 25.646 29 26.397 29 27.323 C 29 28.249 28.341 29 27.526 29 L 4.474 29 C 3.659 29 3 28.249 3 27.323 Z" bx:origin="0.622825 -2.875591"></path>
  57. </svg>
  58. </div>
  59. <div class="farama-header-menu-container">
  60. <div class="farama-header-menu__header">
  61. <a href="https://farama.org">
  62. <img class="farama-header-menu__logo" src="../../../_static/img/farama_solid_white.svg" alt="Farama Foundation">
  63. <span>Farama Foundation</span>
  64. </a>
  65. <button id="farama-close-menu">
  66. <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor"
  67. stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon-close">
  68. <line x1="3" y1="21" x2="21" y2="3"></line>
  69. <line x1="3" y1="3" x2="21" y2="21"></line>
  70. </svg>
  71. </button>
  72. </div>
  73. <div class="farama-header-menu__body">
  74. <div class="farama-header-menu__section" style="padding-left: 24px;" >
  75. <span class="farama-header-menu__section-title">Documentation</span>
  76. <ul class="farama-header-menu-list">
  77. <li>
  78. <a href="https://gymnasium.farama.org">
  79. <img src="../../../_static/img/gymnasium-white.svg">
  80. Gymnasium
  81. </a>
  82. </li>
  83. <li>
  84. <a href="https://pettingzoo.farama.org">
  85. <img src="../../../_static/img/pettingzoo-white.svg">
  86. PettingZoo
  87. </a>
  88. </li>
  89. <li>
  90. <a href="https://minigrid.farama.org">
  91. <img src="../../../_static/img/minigrid-white.svg">
  92. MiniGrid
  93. </a>
  94. </li>
  95. <li>
  96. <a href="https://robotics.farama.org">
  97. <img src="../../../_static/img/gymrobotics-white.svg">
  98. Gymnasium-Robotics
  99. </a>
  100. </li>
  101. </ul>
  102. </div>
  103. <div class="farama-header-menu__section" style="padding-left: 24px;" >
  104. <span class="farama-header-menu__section-title">Mature Projects</span>
  105. <ul class="farama-header-menu-list">
  106. <li>
  107. <a href="https://github.com/Farama-Foundation/SuperSuit">
  108. <img src="../../../_static/img/supersuit-white.svg">
  109. SuperSuit
  110. </a>
  111. </li>
  112. <li>
  113. <a href="https://github.com/Farama-Foundation/tinyscaler">
  114. <img src="../../../_static/img/tinyscaler-white.svg">
  115. Tinyscaler
  116. </a>
  117. </li>
  118. <li>
  119. <a href="https://github.com/Farama-Foundation/AutoROM">
  120. <img src="../../../_static/img/autorom-white.svg">
  121. AutoROM
  122. </a>
  123. </li>
  124. <li>
  125. <a href="https://github.com/Farama-Foundation/Jumpy">
  126. <img src="../../../_static/img/jumpy-white.svg">
  127. JumPy
  128. </a>
  129. </li>
  130. </ul>
  131. </div>
  132. <div class="farama-header-menu__section" style="padding-left: 24px;" >
  133. <span class="farama-header-menu__section-title">Incubating Projects</span>
  134. <ul class="farama-header-menu-list">
  135. <li>
  136. <a href="https://github.com/Farama-Foundation/MAgent2">
  137. <img src="../../../_static/img/MAgent2-white.svg">
  138. MAgent2
  139. </a>
  140. </li>
  141. <li>
  142. <a href="https://github.com/Farama-Foundation/procgen2">
  143. <img src="../../../_static/img/procgen2-white.svg">
  144. Procgen2
  145. </a>
  146. </li>
  147. <li>
  148. <a href="https://github.com/Farama-Foundation/MiniWorld">
  149. <img src="../../../_static/img/miniworld-white.svg">
  150. Miniworld
  151. </a>
  152. </li>
  153. <li>
  154. <a href="https://github.com/Farama-Foundation/D4RL">
  155. <img src="../../../_static/img/d4rl-white.svg">
  156. D4RL
  157. </a>
  158. </li>
  159. <li>
  160. <a href="https://github.com/Farama-Foundation/Kabuki">
  161. <img src="../../../_static/img/kabuki-white.svg">
  162. Kabuki
  163. </a>
  164. </li>
  165. </ul>
  166. </div>
  167. <div class="farama-header-menu__section" style="padding-left: 24px;" >
  168. <span class="farama-header-menu__section-title">Foundation</span>
  169. <ul class="farama-header-menu-list">
  170. <li>
  171. <a href="https://farama.org/about">
  172. About
  173. </a>
  174. </li>
  175. <li>
  176. <a href="https://farama.org/project_standards">
  177. Standards
  178. </a>
  179. </li>
  180. <li>
  181. <a href="https://farama.org/donations">
  182. Donate
  183. </a>
  184. </li>
  185. </ul>
  186. </div>
  187. </div>
  188. </div>
  189. </div>
  190. </div>
  191. </div>
  192. </header>
  193. <div class="farama-header-menu__overlay"></div>
  194. <script>
  195. document.body.dataset.theme = localStorage.getItem("theme") || "auto";
  196. </script>
  197. <svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
  198. <symbol id="svg-toc" viewBox="0 0 24 24">
  199. <title>Contents</title>
  200. <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 1024 1024">
  201. <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"/>
  202. </svg>
  203. </symbol>
  204. <symbol id="svg-menu" viewBox="0 0 24 24">
  205. <title>Menu</title>
  206. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
  207. stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-menu">
  208. <line x1="3" y1="12" x2="21" y2="12"></line>
  209. <line x1="3" y1="6" x2="21" y2="6"></line>
  210. <line x1="3" y1="18" x2="21" y2="18"></line>
  211. </svg>
  212. </symbol>
  213. <symbol id="svg-arrow-right" viewBox="0 0 24 24">
  214. <title>Expand</title>
  215. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
  216. stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-chevron-right">
  217. <polyline points="9 18 15 12 9 6"></polyline>
  218. </svg>
  219. </symbol>
  220. <symbol id="svg-sun" viewBox="0 0 24 24">
  221. <title>Light mode</title>
  222. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
  223. stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather-sun">
  224. <circle cx="12" cy="12" r="5"></circle>
  225. <line x1="12" y1="1" x2="12" y2="3"></line>
  226. <line x1="12" y1="21" x2="12" y2="23"></line>
  227. <line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
  228. <line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
  229. <line x1="1" y1="12" x2="3" y2="12"></line>
  230. <line x1="21" y1="12" x2="23" y2="12"></line>
  231. <line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
  232. <line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
  233. </svg>
  234. </symbol>
  235. <symbol id="svg-moon" viewBox="0 0 24 24">
  236. <title>Dark mode</title>
  237. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
  238. stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-moon">
  239. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  240. <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" />
  241. </svg>
  242. </symbol>
  243. <symbol id="svg-sun-half" viewBox="0 0 24 24">
  244. <title>Auto light/dark mode</title>
  245. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
  246. stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-shadow">
  247. <path stroke="none" d="M0 0h24v24H0z" fill="none"/>
  248. <circle cx="12" cy="12" r="9" />
  249. <path d="M13 12h5" />
  250. <path d="M13 15h4" />
  251. <path d="M13 18h1" />
  252. <path d="M13 9h4" />
  253. <path d="M13 6h1" />
  254. </svg>
  255. </symbol>
  256. </svg>
  257. <input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation">
  258. <input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc">
  259. <label class="overlay sidebar-overlay" for="__navigation">
  260. <div class="visually-hidden">Hide navigation sidebar</div>
  261. </label>
  262. <label class="overlay toc-overlay" for="__toc">
  263. <div class="visually-hidden">Hide table of contents sidebar</div>
  264. </label>
  265. <div class="page">
  266. <header class="mobile-header">
  267. <div class="header-left">
  268. <label class="nav-overlay-icon" for="__navigation">
  269. <div class="visually-hidden">Toggle site navigation sidebar</div>
  270. <i class="icon"><svg><use href="#svg-menu"></use></svg></i>
  271. </label>
  272. </div>
  273. <div class="header-center">
  274. <a href="../../../"><div class="brand">MiniGrid Documentation</div></a>
  275. </div>
  276. <div class="header-right">
  277. <div class="theme-toggle-container theme-toggle-header">
  278. <button class="theme-toggle">
  279. <div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
  280. <svg class="theme-icon-when-auto"><use href="#svg-sun-half"></use></svg>
  281. <svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
  282. <svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
  283. </button>
  284. </div>
  285. <label class="toc-overlay-icon toc-header-icon" for="__toc">
  286. <div class="visually-hidden">Toggle table of contents sidebar</div>
  287. <i class="icon"><svg><use href="#svg-toc"></use></svg></i>
  288. </label>
  289. </div>
  290. </header>
  291. <aside class="sidebar-drawer">
  292. <div class="sidebar-container">
  293. <div class="sidebar-sticky"><form class="sidebar-search-container" method="get" action="../../../search/" role="search">
  294. <input class="sidebar-search" placeholder=Search name="q" aria-label="Search">
  295. <input type="hidden" name="check_keywords" value="yes">
  296. <input type="hidden" name="area" value="default">
  297. </form>
  298. <div id="searchbox"></div><div class="sidebar-scroll"><div class="sidebar-tree">
  299. <p class="caption" role="heading"><span class="caption-text">Introduction</span></p>
  300. <ul>
  301. <li class="toctree-l1"><a class="reference internal" href="../../../content/basic_usage/">Basic Usage</a></li>
  302. <li class="toctree-l1"><a class="reference internal" href="../../../content/basic_usage/#training-an-agent">Training an Agent</a></li>
  303. <li class="toctree-l1"><a class="reference internal" href="../../../content/publications/">List of Publications</a></li>
  304. </ul>
  305. <p class="caption" role="heading"><span class="caption-text">Wrappers</span></p>
  306. <ul>
  307. <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>
  308. <li class="toctree-l2"><a class="reference internal" href="../../../api/wrappers/">Action Bonus</a></li>
  309. <li class="toctree-l2"><a class="reference internal" href="../../../api/wrappers/#dict-observation-space">Dict Observation Space</a></li>
  310. <li class="toctree-l2"><a class="reference internal" href="../../../api/wrappers/#direction-obs">Direction Obs</a></li>
  311. <li class="toctree-l2"><a class="reference internal" href="../../../api/wrappers/#flatobs">FlatObs</a></li>
  312. <li class="toctree-l2"><a class="reference internal" href="../../../api/wrappers/#fully-obs">Fully Obs</a></li>
  313. <li class="toctree-l2"><a class="reference internal" href="../../../api/wrappers/#observation">Observation</a></li>
  314. <li class="toctree-l2"><a class="reference internal" href="../../../api/wrappers/#one-hot-partial-obs">One Hot Partial Obs</a></li>
  315. <li class="toctree-l2"><a class="reference internal" href="../../../api/wrappers/#reseed">Reseed</a></li>
  316. <li class="toctree-l2"><a class="reference internal" href="../../../api/wrappers/#rgb-img-obs">RGB Img Obs</a></li>
  317. <li class="toctree-l2"><a class="reference internal" href="../../../api/wrappers/#state-bonus">State Bonus</a></li>
  318. <li class="toctree-l2"><a class="reference internal" href="../../../api/wrappers/#symbolic-obs">Symbolic Obs</a></li>
  319. <li class="toctree-l2"><a class="reference internal" href="../../../api/wrappers/#view-size">View Size</a></li>
  320. </ul>
  321. </li>
  322. </ul>
  323. <p class="caption" role="heading"><span class="caption-text">Environments</span></p>
  324. <ul class="current">
  325. <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">
  326. <li class="toctree-l2"><a class="reference internal" href="../BlockedUnlockPickupEnv/">Blocked Unlock Pickup</a></li>
  327. <li class="toctree-l2"><a class="reference internal" href="../CrossingEnv/">Crossing</a></li>
  328. <li class="toctree-l2 current current-page"><a class="current reference internal" href="#">Dist Shift</a></li>
  329. <li class="toctree-l2"><a class="reference internal" href="../DoorKeyEnv/">Door Key</a></li>
  330. <li class="toctree-l2"><a class="reference internal" href="../DynamicObstaclesEnv/">Dynamic Obstacles</a></li>
  331. <li class="toctree-l2"><a class="reference internal" href="../EmptyEnv/">Empty</a></li>
  332. <li class="toctree-l2"><a class="reference internal" href="../FetchEnv/">Fetch</a></li>
  333. <li class="toctree-l2"><a class="reference internal" href="../FourRoomsEnv/">Four Rooms</a></li>
  334. <li class="toctree-l2"><a class="reference internal" href="../GoToDoorEnv/">Go To Door</a></li>
  335. <li class="toctree-l2"><a class="reference internal" href="../GoToObjectEnv/">Go To Object</a></li>
  336. <li class="toctree-l2"><a class="reference internal" href="../KeyCorridorEnv/">Key Corridor</a></li>
  337. <li class="toctree-l2"><a class="reference internal" href="../LavaGapEnv/">Lava Gap</a></li>
  338. <li class="toctree-l2"><a class="reference internal" href="../LockedRoomEnv/">Locked Room</a></li>
  339. <li class="toctree-l2"><a class="reference internal" href="../MemoryEnv/">Memory</a></li>
  340. <li class="toctree-l2"><a class="reference internal" href="../MultiRoomEnv/">Multi Room</a></li>
  341. <li class="toctree-l2"><a class="reference internal" href="../ObstructedMaze_1Dlhb/">Obstructed Maze Dlhb</a></li>
  342. <li class="toctree-l2"><a class="reference internal" href="../ObstructedMaze_Full/">Obstructed Maze Full</a></li>
  343. <li class="toctree-l2"><a class="reference internal" href="../PlaygroundEnv/">Playground</a></li>
  344. <li class="toctree-l2"><a class="reference internal" href="../PutNearEnv/">Put Near</a></li>
  345. <li class="toctree-l2"><a class="reference internal" href="../RedBlueDoorEnv/">Red Blue Door</a></li>
  346. <li class="toctree-l2"><a class="reference internal" href="../UnlockEnv/">Unlock</a></li>
  347. <li class="toctree-l2"><a class="reference internal" href="../UnlockPickupEnv/">Unlock Pickup</a></li>
  348. </ul>
  349. </li>
  350. <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>
  351. <li class="toctree-l2"><a class="reference internal" href="../../babyai/GoToRedBallGrey/">Go To Red Ball Grey</a></li>
  352. <li class="toctree-l2"><a class="reference internal" href="../../babyai/GoToRedBall/">Go To Red Ball</a></li>
  353. <li class="toctree-l2"><a class="reference internal" href="../../babyai/GoToRedBallNoDists/">Go To Red Ball No Dists</a></li>
  354. <li class="toctree-l2"><a class="reference internal" href="../../babyai/GoToObj/">Go To Obj</a></li>
  355. <li class="toctree-l2"><a class="reference internal" href="../../babyai/GoToLocal/">Go To Local</a></li>
  356. <li class="toctree-l2"><a class="reference internal" href="../../babyai/GoTo/">Go To</a></li>
  357. <li class="toctree-l2"><a class="reference internal" href="../../babyai/GoToImpUnlock/">Go To Imp Unlock</a></li>
  358. <li class="toctree-l2"><a class="reference internal" href="../../babyai/GoToSeq/">Go To Seq</a></li>
  359. <li class="toctree-l2"><a class="reference internal" href="../../babyai/GoToRedBlueBall/">Go To Red Blue Ball</a></li>
  360. <li class="toctree-l2"><a class="reference internal" href="../../babyai/GoToDoor/">Go To Door</a></li>
  361. <li class="toctree-l2"><a class="reference internal" href="../../babyai/GoToObjDoor/">Go To Obj Door</a></li>
  362. <li class="toctree-l2"><a class="reference internal" href="../../babyai/Open/">Open</a></li>
  363. <li class="toctree-l2"><a class="reference internal" href="../../babyai/OpenRedDoor/">Open Red Door</a></li>
  364. <li class="toctree-l2"><a class="reference internal" href="../../babyai/OpenDoor/">Open Door</a></li>
  365. <li class="toctree-l2"><a class="reference internal" href="../../babyai/OpenTwoDoors/">Open Two Doors</a></li>
  366. <li class="toctree-l2"><a class="reference internal" href="../../babyai/OpenDoorsOrder/">Open Doors Order</a></li>
  367. <li class="toctree-l2"><a class="reference internal" href="../../babyai/Pickup/">Pickup</a></li>
  368. <li class="toctree-l2"><a class="reference internal" href="../../babyai/UnblockPickup/">Unblock Pickup</a></li>
  369. <li class="toctree-l2"><a class="reference internal" href="../../babyai/PickupLoc/">Pickup Loc</a></li>
  370. <li class="toctree-l2"><a class="reference internal" href="../../babyai/PickupDist/">Pickup Dist</a></li>
  371. <li class="toctree-l2"><a class="reference internal" href="../../babyai/PickupAbove/">Pickup Above</a></li>
  372. <li class="toctree-l2"><a class="reference internal" href="../../babyai/PutNextLocal/">Put Next Local</a></li>
  373. <li class="toctree-l2"><a class="reference internal" href="../../babyai/PutNext/">Put Next</a></li>
  374. <li class="toctree-l2"><a class="reference internal" href="../../babyai/Unlock/">Unlock</a></li>
  375. <li class="toctree-l2"><a class="reference internal" href="../../babyai/UnlockLocal/">Unlock Local</a></li>
  376. <li class="toctree-l2"><a class="reference internal" href="../../babyai/KeyInBox/">Key In Box</a></li>
  377. <li class="toctree-l2"><a class="reference internal" href="../../babyai/UnlockPickup/">Unlock Pickup</a></li>
  378. <li class="toctree-l2"><a class="reference internal" href="../../babyai/BlockedUnlockPickup/">Blocked Unlock Pickup</a></li>
  379. <li class="toctree-l2"><a class="reference internal" href="../../babyai/UnlockToUnlock/">Unlock To Unlock</a></li>
  380. <li class="toctree-l2"><a class="reference internal" href="../../babyai/ActionObjDoor/">Action Obj Door</a></li>
  381. <li class="toctree-l2"><a class="reference internal" href="../../babyai/FindObjS5/">Find Obj</a></li>
  382. <li class="toctree-l2"><a class="reference internal" href="../../babyai/KeyCorridor/">Key Corridor</a></li>
  383. <li class="toctree-l2"><a class="reference internal" href="../../babyai/OneRoomS8/">One Room</a></li>
  384. <li class="toctree-l2"><a class="reference internal" href="../../babyai/MoveTwoAcross/">Move Two Across</a></li>
  385. <li class="toctree-l2"><a class="reference internal" href="../../babyai/Synth/">Synth</a></li>
  386. <li class="toctree-l2"><a class="reference internal" href="../../babyai/SynthLoc/">Synth Loc</a></li>
  387. <li class="toctree-l2"><a class="reference internal" href="../../babyai/SynthSeq/">Synth Seq</a></li>
  388. <li class="toctree-l2"><a class="reference internal" href="../../babyai/MiniBossLevel/">Mini Boss Level</a></li>
  389. <li class="toctree-l2"><a class="reference internal" href="../../babyai/BossLevel/">Boss Level</a></li>
  390. <li class="toctree-l2"><a class="reference internal" href="../../babyai/BossLevelNoUnlock/">Boss Level No Unlock</a></li>
  391. </ul>
  392. </li>
  393. </ul>
  394. <p class="caption" role="heading"><span class="caption-text">Development</span></p>
  395. <ul>
  396. <li class="toctree-l1"><a class="reference external" href="https://github.com/Farama-Foundation/MiniGrid">Github</a></li>
  397. </ul>
  398. </div>
  399. </div>
  400. </div>
  401. </div>
  402. </aside>
  403. <div class="main">
  404. <div class="content">
  405. <div class="article-container">
  406. <a href="#" class="back-to-top muted-link">
  407. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
  408. <path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12z"></path>
  409. </svg>
  410. <span>Back to top</span>
  411. </a>
  412. <div class="content-icon-container">
  413. <div class="theme-toggle-container theme-toggle-content">
  414. <button class="theme-toggle">
  415. <div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
  416. <svg class="theme-icon-when-auto"><use href="#svg-sun-half"></use></svg>
  417. <svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
  418. <svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
  419. </button>
  420. </div>
  421. <label class="toc-overlay-icon toc-content-icon" for="__toc">
  422. <div class="visually-hidden">Toggle table of contents sidebar</div>
  423. <i class="icon"><svg><use href="#svg-toc"></use></svg></i>
  424. </label>
  425. </div>
  426. <article role="main">
  427. <section id="dist-shift">
  428. <h1>Dist Shift<a class="headerlink" href="#dist-shift" title="Permalink to this heading">#</a></h1>
  429. <figure class="align-default">
  430. <a class="reference internal image-reference" href="../../../_images/DistShiftEnv.gif"><img alt="Dist Shift" src="../../../_images/DistShiftEnv.gif" style="width: 200px;" /></a>
  431. </figure>
  432. <section id="description">
  433. <h2>Description<a class="headerlink" href="#description" title="Permalink to this heading">#</a></h2>
  434. <p>This environment is based on one of the DeepMind <a class="reference external" href="https://github.com/deepmind/ai-safety-gridworlds">AI safety gridworlds</a>.
  435. The agent starts in the
  436. top-left corner and must reach the goal which is in the top-right corner,
  437. but has to avoid stepping into lava on its way. The aim of this environment
  438. is to test an agent’s ability to generalize. There are two slightly
  439. different variants of the environment, so that the agent can be trained on
  440. one variant and tested on the other.</p>
  441. </section>
  442. <section id="mission-space">
  443. <h2>Mission Space<a class="headerlink" href="#mission-space" title="Permalink to this heading">#</a></h2>
  444. <p>“get to the green goal square”</p>
  445. </section>
  446. <section id="action-space">
  447. <h2>Action Space<a class="headerlink" href="#action-space" title="Permalink to this heading">#</a></h2>
  448. <div class="table-wrapper colwidths-auto docutils container">
  449. <table class="docutils align-default">
  450. <thead>
  451. <tr class="row-odd"><th class="head"><p>Num</p></th>
  452. <th class="head"><p>Name</p></th>
  453. <th class="head"><p>Action</p></th>
  454. </tr>
  455. </thead>
  456. <tbody>
  457. <tr class="row-even"><td><p>0</p></td>
  458. <td><p>left</p></td>
  459. <td><p>Turn left</p></td>
  460. </tr>
  461. <tr class="row-odd"><td><p>1</p></td>
  462. <td><p>right</p></td>
  463. <td><p>Turn right</p></td>
  464. </tr>
  465. <tr class="row-even"><td><p>2</p></td>
  466. <td><p>forward</p></td>
  467. <td><p>Move forward</p></td>
  468. </tr>
  469. <tr class="row-odd"><td><p>3</p></td>
  470. <td><p>pickup</p></td>
  471. <td><p>Unused</p></td>
  472. </tr>
  473. <tr class="row-even"><td><p>4</p></td>
  474. <td><p>drop</p></td>
  475. <td><p>Unused</p></td>
  476. </tr>
  477. <tr class="row-odd"><td><p>5</p></td>
  478. <td><p>toggle</p></td>
  479. <td><p>Unused</p></td>
  480. </tr>
  481. <tr class="row-even"><td><p>6</p></td>
  482. <td><p>done</p></td>
  483. <td><p>Unused</p></td>
  484. </tr>
  485. </tbody>
  486. </table>
  487. </div>
  488. </section>
  489. <section id="observation-encoding">
  490. <h2>Observation Encoding<a class="headerlink" href="#observation-encoding" title="Permalink to this heading">#</a></h2>
  491. <ul class="simple">
  492. <li><p>Each tile is encoded as a 3 dimensional tuple:
  493. <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>
  494. <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
  495. <span class="xref myst">minigrid/minigrid.py</span></p></li>
  496. <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>
  497. </ul>
  498. </section>
  499. <section id="rewards">
  500. <h2>Rewards<a class="headerlink" href="#rewards" title="Permalink to this heading">#</a></h2>
  501. <p>A reward of ‘1’ is given for success, and ‘0’ for failure.</p>
  502. </section>
  503. <section id="termination">
  504. <h2>Termination<a class="headerlink" href="#termination" title="Permalink to this heading">#</a></h2>
  505. <p>The episode ends if any one of the following conditions is met:</p>
  506. <ol class="arabic simple">
  507. <li><p>The agent reaches the goal.</p></li>
  508. <li><p>The agent falls into lava.</p></li>
  509. <li><p>Timeout (see <code class="docutils literal notranslate"><span class="pre">max_steps</span></code>).</p></li>
  510. </ol>
  511. </section>
  512. <section id="registered-configurations">
  513. <h2>Registered Configurations<a class="headerlink" href="#registered-configurations" title="Permalink to this heading">#</a></h2>
  514. <ul class="simple">
  515. <li><p><code class="docutils literal notranslate"><span class="pre">MiniGrid-DistShift1-v0</span></code></p></li>
  516. <li><p><code class="docutils literal notranslate"><span class="pre">MiniGrid-DistShift2-v0</span></code></p></li>
  517. </ul>
  518. </section>
  519. </section>
  520. </article>
  521. </div>
  522. <footer>
  523. <div class="related-pages">
  524. <a class="next-page" href="../DoorKeyEnv/">
  525. <div class="page-info">
  526. <div class="context">
  527. <span>Next</span>
  528. </div>
  529. <div class="title">Door Key</div>
  530. </div>
  531. <svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
  532. </a>
  533. <a class="prev-page" href="../CrossingEnv/">
  534. <svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
  535. <div class="page-info">
  536. <div class="context">
  537. <span>Previous</span>
  538. </div>
  539. <div class="title">Crossing</div>
  540. </div>
  541. </a>
  542. </div>
  543. <div class="bottom-of-page">
  544. <div class="left-details">
  545. <div class="copyright">
  546. Copyright &#169; 2022
  547. </div>
  548. <!--
  549. Made with <a href="https://www.sphinx-doc.org/">Sphinx</a> and <a class="muted-link" href="https://pradyunsg.me">@pradyunsg</a>'s
  550. <a href="https://github.com/pradyunsg/furo">Furo</a>
  551. -->
  552. </div>
  553. <div class="right-details">
  554. <div class="icons">
  555. <a class="muted-link" href="https://github.com/Farama-Foundation/Minigrid" aria-label="On GitHub">
  556. <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16">
  557. <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>
  558. </svg>
  559. </a>
  560. </div>
  561. </div>
  562. </div>
  563. </footer>
  564. </div>
  565. <aside class="toc-drawer">
  566. <div class="toc-sticky toc-scroll">
  567. <div class="toc-title-container">
  568. <span class="toc-title">
  569. On this page
  570. </span>
  571. </div>
  572. <div class="toc-tree-container">
  573. <div class="toc-tree">
  574. <ul>
  575. <li><a class="reference internal" href="#">Dist Shift</a><ul>
  576. <li><a class="reference internal" href="#description">Description</a></li>
  577. <li><a class="reference internal" href="#mission-space">Mission Space</a></li>
  578. <li><a class="reference internal" href="#action-space">Action Space</a></li>
  579. <li><a class="reference internal" href="#observation-encoding">Observation Encoding</a></li>
  580. <li><a class="reference internal" href="#rewards">Rewards</a></li>
  581. <li><a class="reference internal" href="#termination">Termination</a></li>
  582. <li><a class="reference internal" href="#registered-configurations">Registered Configurations</a></li>
  583. </ul>
  584. </li>
  585. </ul>
  586. </div>
  587. </div>
  588. </div>
  589. </aside>
  590. </div>
  591. </div>
  592. <script>
  593. let toggleMenu = () => {
  594. document.querySelector(".farama-header-menu").classList.toggle("active");
  595. document.querySelector(".farama-header-menu__overlay").classList.toggle("active");
  596. }
  597. document.querySelector(".farama-header-menu__btn").addEventListener("click", toggleMenu);
  598. document.getElementById("farama-close-menu").addEventListener("click", toggleMenu);
  599. document.querySelector(".farama-header-menu__overlay").addEventListener("click", toggleMenu);
  600. window.onclick = function(event) {
  601. if (!event.target.matches('.farama-header-menu__btn')) {
  602. const dropdown = document.querySelector(".farama-header-menu-container");
  603. if (dropdown.classList.contains('active')) {
  604. dropdown.classList.remove('active');
  605. document.querySelector(".farama-header-menu__overlay").classList.remove("active");
  606. }
  607. }
  608. }
  609. </script>
  610. <script>
  611. (() => {
  612. if (!localStorage.getItem("shownCookieAlert")) {
  613. const boxElem = document.createElement("div");
  614. boxElem.classList.add("cookie-alert");
  615. const containerElem = document.createElement("div");
  616. containerElem.classList.add("cookie-alert__container");
  617. const textElem = document.createElement("p");
  618. textElem.innerHTML = `This page uses <a href="https://analytics.google.com/">
  619. Google Analytics</a> to collect statistics. You can disable it by blocking
  620. the JavaScript coming from www.google-analytics.com.`;
  621. containerElem.appendChild(textElem);
  622. const closeBtn = document.createElement("button");
  623. 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>`
  624. closeBtn.onclick = () => {
  625. localStorage.setItem("shownCookieAlert", "true");
  626. boxElem.style.display = "none";
  627. }
  628. containerElem.appendChild(closeBtn);
  629. boxElem.appendChild(containerElem);
  630. document.body.appendChild(boxElem);
  631. }
  632. })()
  633. </script>
  634. <script async src="https://www.googletagmanager.com/gtag/js?id=G-FBXJQQLXKD"></script>
  635. <script>
  636. window.dataLayer = window.dataLayer || [];
  637. function gtag(){dataLayer.push(arguments);}
  638. gtag('js', new Date());
  639. gtag('config', 'G-FBXJQQLXKD');
  640. </script>
  641. <script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script>
  642. <script src="../../../_static/jquery.js"></script>
  643. <script src="../../../_static/underscore.js"></script>
  644. <script src="../../../_static/_sphinx_javascript_frameworks_compat.js"></script>
  645. <script src="../../../_static/doctools.js"></script>
  646. <script src="../../../_static/sphinx_highlight.js"></script>
  647. <script src="../../../_static/scripts/furo.js"></script>
  648. </body>
  649. </html>