index.html 42 KB

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