index.html 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750
  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/UnlockEnv.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="Unlock Pickup" href="../UnlockPickupEnv/" /><link rel="prev" title="Red Blue Door" href="../RedBlueDoorEnv/" />
  12. <link rel="canonical" href="https://minigrid.farama.org/environments/minigrid/UnlockEnv.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>Unlock - 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"><a class="reference internal" href="../CrossingEnv/">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 current current-page"><a class="current reference internal" href="#">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="unlock">
  349. <h1>Unlock<a class="headerlink" href="#unlock" title="Permalink to this heading">#</a></h1>
  350. <figure class="align-default">
  351. <a class="reference internal image-reference" href="../../../_images/UnlockEnv.gif"><img alt="Unlock" src="../../../_images/UnlockEnv.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>The agent has to open a locked door. This environment can be solved without
  356. relying on language.</p>
  357. </section>
  358. <section id="mission-space">
  359. <h2>Mission Space<a class="headerlink" href="#mission-space" title="Permalink to this heading">#</a></h2>
  360. <p>“open the door”</p>
  361. </section>
  362. <section id="action-space">
  363. <h2>Action Space<a class="headerlink" href="#action-space" title="Permalink to this heading">#</a></h2>
  364. <div class="table-wrapper colwidths-auto docutils container">
  365. <table class="docutils align-default">
  366. <thead>
  367. <tr class="row-odd"><th class="head"><p>Num</p></th>
  368. <th class="head"><p>Name</p></th>
  369. <th class="head"><p>Action</p></th>
  370. </tr>
  371. </thead>
  372. <tbody>
  373. <tr class="row-even"><td><p>0</p></td>
  374. <td><p>left</p></td>
  375. <td><p>Turn left</p></td>
  376. </tr>
  377. <tr class="row-odd"><td><p>1</p></td>
  378. <td><p>right</p></td>
  379. <td><p>Turn right</p></td>
  380. </tr>
  381. <tr class="row-even"><td><p>2</p></td>
  382. <td><p>forward</p></td>
  383. <td><p>Move forward</p></td>
  384. </tr>
  385. <tr class="row-odd"><td><p>3</p></td>
  386. <td><p>pickup</p></td>
  387. <td><p>Unused</p></td>
  388. </tr>
  389. <tr class="row-even"><td><p>4</p></td>
  390. <td><p>drop</p></td>
  391. <td><p>Unused</p></td>
  392. </tr>
  393. <tr class="row-odd"><td><p>5</p></td>
  394. <td><p>toggle</p></td>
  395. <td><p>Toggle/activate an object</p></td>
  396. </tr>
  397. <tr class="row-even"><td><p>6</p></td>
  398. <td><p>done</p></td>
  399. <td><p>Unused</p></td>
  400. </tr>
  401. </tbody>
  402. </table>
  403. </div>
  404. </section>
  405. <section id="observation-encoding">
  406. <h2>Observation Encoding<a class="headerlink" href="#observation-encoding" title="Permalink to this heading">#</a></h2>
  407. <ul class="simple">
  408. <li><p>Each tile is encoded as a 3 dimensional tuple:
  409. <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>
  410. <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
  411. <a class="reference internal" href="#minigrid/minigrid.py"><span class="xref myst">minigrid/minigrid.py</span></a></p></li>
  412. <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>
  413. </ul>
  414. </section>
  415. <section id="rewards">
  416. <h2>Rewards<a class="headerlink" href="#rewards" title="Permalink to this heading">#</a></h2>
  417. <p>A reward of ‘1 - 0.9 * (step_count / max_steps)’ is given for success, and ‘0’ for failure.</p>
  418. </section>
  419. <section id="termination">
  420. <h2>Termination<a class="headerlink" href="#termination" title="Permalink to this heading">#</a></h2>
  421. <p>The episode ends if any one of the following conditions is met:</p>
  422. <ol class="arabic simple">
  423. <li><p>The agent opens the door.</p></li>
  424. <li><p>Timeout (see <code class="docutils literal notranslate"><span class="pre">max_steps</span></code>).</p></li>
  425. </ol>
  426. </section>
  427. <section id="registered-configurations">
  428. <h2>Registered Configurations<a class="headerlink" href="#registered-configurations" title="Permalink to this heading">#</a></h2>
  429. <ul class="simple">
  430. <li><p><code class="docutils literal notranslate"><span class="pre">MiniGrid-Unlock-v0</span></code></p></li>
  431. </ul>
  432. </section>
  433. </section>
  434. </article>
  435. </div>
  436. <footer>
  437. <div class="related-pages">
  438. <a class="next-page" href="../UnlockPickupEnv/">
  439. <div class="page-info">
  440. <div class="context">
  441. <span>Next</span>
  442. </div>
  443. <div class="title">Unlock Pickup</div>
  444. </div>
  445. <svg class="furo-related-icon">
  446. <use href="#svg-arrow-right"></use>
  447. </svg>
  448. </a>
  449. <a class="prev-page" href="../RedBlueDoorEnv/">
  450. <svg class="furo-related-icon">
  451. <use href="#svg-arrow-right"></use>
  452. </svg>
  453. <div class="page-info">
  454. <div class="context">
  455. <span>Previous</span>
  456. </div>
  457. <div class="title">Red Blue Door</div>
  458. </div>
  459. </a>
  460. </div>
  461. <div class="bottom-of-page">
  462. <div class="left-details">
  463. <div class="copyright">
  464. Copyright &#169; 2023 Farama Foundation
  465. </div>
  466. <!--
  467. Made with <a href="https://www.sphinx-doc.org/">Sphinx</a> and <a class="muted-link" href="https://pradyunsg.me">@pradyunsg</a>'s
  468. <a href="https://github.com/pradyunsg/furo">Furo</a>
  469. -->
  470. </div>
  471. <div class="right-details">
  472. <div class="icons">
  473. <a class="muted-link" href="https://github.com/Farama-Foundation/Minigrid/"
  474. aria-label="On GitHub">
  475. <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16">
  476. <path fill-rule="evenodd"
  477. 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">
  478. </path>
  479. </svg>
  480. </a>
  481. </div>
  482. </div>
  483. </div>
  484. </footer>
  485. </div>
  486. <aside class="toc-drawer">
  487. <div class="toc-sticky toc-scroll">
  488. <div class="toc-title-container">
  489. <span class="toc-title">
  490. On this page
  491. </span>
  492. </div>
  493. <div class="toc-tree-container">
  494. <div class="toc-tree">
  495. <ul>
  496. <li><a class="reference internal" href="#">Unlock</a><ul>
  497. <li><a class="reference internal" href="#description">Description</a></li>
  498. <li><a class="reference internal" href="#mission-space">Mission Space</a></li>
  499. <li><a class="reference internal" href="#action-space">Action Space</a></li>
  500. <li><a class="reference internal" href="#observation-encoding">Observation Encoding</a></li>
  501. <li><a class="reference internal" href="#rewards">Rewards</a></li>
  502. <li><a class="reference internal" href="#termination">Termination</a></li>
  503. <li><a class="reference internal" href="#registered-configurations">Registered Configurations</a></li>
  504. </ul>
  505. </li>
  506. </ul>
  507. </div>
  508. </div>
  509. </div>
  510. </aside>
  511. </div>
  512. </div>
  513. </div>
  514. <script>
  515. const toggleMenu = () => {
  516. const menuBtn = document.querySelector(".farama-header-menu__btn");
  517. const menuContainer = document.querySelector(".farama-header-menu-container");
  518. if (document.querySelector(".farama-header-menu").classList.contains("active")) {
  519. menuBtn.setAttribute("aria-expanded", "false");
  520. menuContainer.setAttribute("aria-hidden", "true");
  521. } else {
  522. menuBtn.setAttribute("aria-expanded", "true");
  523. menuContainer.setAttribute("aria-hidden", "false");
  524. }
  525. document.querySelector(".farama-header-menu").classList.toggle("active");
  526. }
  527. document.querySelector(".farama-header-menu__btn").addEventListener("click", toggleMenu);
  528. document.getElementById("farama-close-menu").addEventListener("click", toggleMenu);
  529. </script>
  530. <script>
  531. (() => {
  532. if (!localStorage.getItem("shownCookieAlert")) {
  533. const boxElem = document.createElement("div");
  534. boxElem.classList.add("cookie-alert");
  535. const containerElem = document.createElement("div");
  536. containerElem.classList.add("cookie-alert__container");
  537. const textElem = document.createElement("p");
  538. textElem.innerHTML = `This page uses <a href="https://analytics.google.com/">
  539. Google Analytics</a> to collect statistics. You can disable it by blocking
  540. the JavaScript coming from www.google-analytics.com.`;
  541. containerElem.appendChild(textElem);
  542. const closeBtn = document.createElement("button");
  543. 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>`
  544. closeBtn.onclick = () => {
  545. localStorage.setItem("shownCookieAlert", "true");
  546. boxElem.style.display = "none";
  547. }
  548. containerElem.appendChild(closeBtn);
  549. boxElem.appendChild(containerElem);
  550. document.body.appendChild(boxElem);
  551. }
  552. })()
  553. </script>
  554. <script async src="https://www.googletagmanager.com/gtag/js?id=G-FBXJQQLXKD"></script>
  555. <script>
  556. window.dataLayer = window.dataLayer || [];
  557. function gtag(){dataLayer.push(arguments);}
  558. gtag('js', new Date());
  559. gtag('config', 'G-FBXJQQLXKD');
  560. </script>
  561. <script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script>
  562. <script src="../../../_static/jquery.js"></script>
  563. <script src="../../../_static/underscore.js"></script>
  564. <script src="../../../_static/_sphinx_javascript_frameworks_compat.js"></script>
  565. <script src="../../../_static/doctools.js"></script>
  566. <script src="../../../_static/sphinx_highlight.js"></script>
  567. <script src="../../../_static/scripts/furo.js"></script>
  568. <script>
  569. // Create menu with Farama projects by using the API at farama.org/api/projects.json
  570. const createCORSRequest = (method, url) => {
  571. let xhr = new XMLHttpRequest();
  572. xhr.responseType = 'json';
  573. if ("withCredentials" in xhr) {
  574. xhr.open(method, url, true);
  575. } else if (typeof XDomainRequest != "undefined") {
  576. // IE8 & IE9
  577. xhr = new XDomainRequest();
  578. xhr.open(method, url);
  579. } else {
  580. // CORS not supported.
  581. xhr = null;
  582. }
  583. return xhr;
  584. };
  585. const url = 'https://farama.org/api/projects.json';
  586. const imagesBasepath = "https://farama.org/assets/images"
  587. const method = 'GET';
  588. let xhr = createCORSRequest(method, url);
  589. xhr.onload = () => {
  590. const jsonResponse = xhr.response;
  591. const sections = {
  592. "Documentation": [],
  593. "Mature Projects": [],
  594. "Incubating Projects": [],
  595. "Foundation": [
  596. {
  597. name: "About",
  598. link: "https://farama.org/about"
  599. },
  600. {
  601. name: "Standards",
  602. link: "https://farama.org/project_standards",
  603. },
  604. {
  605. name: "Donate",
  606. link: "https://farama.org/donations"
  607. }
  608. ]
  609. }
  610. Object.keys(jsonResponse).forEach(key => {
  611. projectJson = jsonResponse[key];
  612. if (projectJson.website !== null) {
  613. projectJson.link = projectJson.website;
  614. sections["Documentation"].push(projectJson)
  615. } else if (projectJson.type == "mature") {
  616. projectJson.link = projectJson.github;
  617. sections["Mature Projects"].push(projectJson)
  618. } else {
  619. projectJson.link = projectJson.github;
  620. sections["Incubating Projects"].push(projectJson)
  621. }
  622. })
  623. const menuContainer = document.querySelector(".farama-header-menu__body");
  624. Object.keys(sections).forEach((key, i) => {
  625. projects = sections[key];
  626. const sectionElem = Object.assign(
  627. document.createElement('div'), {
  628. className:'farama-header-menu__section',
  629. style: "padding-left: 24px"
  630. }
  631. )
  632. sectionElem.appendChild(Object.assign(document.createElement('span'),
  633. {
  634. className:'farama-header-menu__section-title' ,
  635. innerText: key
  636. }
  637. ))
  638. const ulElem = Object.assign(document.createElement('ul'),
  639. {
  640. className:'farama-header-menu-list',
  641. }
  642. )
  643. for (let project of projects) {
  644. const liElem = document.createElement("li");
  645. const aElem = Object.assign(document.createElement("a"),
  646. {
  647. href: project.link
  648. }
  649. );
  650. liElem.appendChild(aElem);
  651. if (key !== "Foundation") {
  652. const imgElem = Object.assign(document.createElement("img"),
  653. {
  654. src: project.image ? imagesBasepath + project.image : imagesBasepath + "/farama_black.svg",
  655. alt: `${project.name} logo`,
  656. className: "farama-black-logo-invert"
  657. }
  658. );
  659. aElem.appendChild(imgElem);
  660. }
  661. aElem.appendChild(document.createTextNode(project.name));
  662. ulElem.appendChild(liElem);
  663. }
  664. sectionElem.appendChild(ulElem);
  665. menuContainer.appendChild(sectionElem)
  666. });
  667. }
  668. xhr.onerror = function() {
  669. console.error("Unable to load projects");
  670. };
  671. xhr.send();
  672. </script>
  673. <script>
  674. const versioningConfig = {
  675. githubUser: 'Farama-Foundation',
  676. githubRepo: 'Minigrid',
  677. };
  678. fetch('/main/_static/versioning/versioning_menu.html').then(response => {
  679. if (response.status === 200) {
  680. response.text().then(text => {
  681. const container = document.createElement("div");
  682. container.innerHTML = text;
  683. document.querySelector("body").appendChild(container);
  684. // innerHtml doenst evaluate scripts, we need to add them dynamically
  685. Array.from(container.querySelectorAll("script")).forEach(oldScript => {
  686. const newScript = document.createElement("script");
  687. Array.from(oldScript.attributes).forEach(attr => newScript.setAttribute(attr.name, attr.value));
  688. newScript.appendChild(document.createTextNode(oldScript.innerHTML));
  689. oldScript.parentNode.replaceChild(newScript, oldScript);
  690. });
  691. });
  692. } else {
  693. console.warn("Unable to load versioning menu", response);
  694. }
  695. });
  696. </script>
  697. </body>
  698. </html>