123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449 |
- <!doctype html>
- <html class="no-js">
- <head><meta charset="utf-8"/>
- <meta name="viewport" content="width=device-width,initial-scale=1"/>
- <meta name="color-scheme" content="light dark"><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
- <link rel="index" title="Index" href="../../genindex/" /><link rel="search" title="Search" href="../../search/" /><link rel="next" title="Go To Door" href="../go_to_door/" /><link rel="prev" title="Multi Room" href="../multi_room/" />
- <link rel="canonical" href="https://minigrid.farama.org/environments/fetch.html" />
- <link rel="shortcut icon" href="../../_static/minigrid-white.png"/><meta name="generator" content="sphinx-4.2.0, furo 2022.06.21"/>
- <title>Fetch - MiniGrid Documentation</title>
- <link rel="stylesheet" type="text/css" href="../../_static/pygments.css" />
- <link rel="stylesheet" type="text/css" href="../../_static/styles/furo.css?digest=40978830699223671f4072448e654b5958f38b89" />
- <link rel="stylesheet" type="text/css" href="../../_static/styles/furo-extensions.css?digest=30d1aed668e5c3a91c3e3bf6a60b675221979f0e" />
- <link rel="stylesheet" type="text/css" href="../../_static/css/custom.css" />
-
-
- <style>
- body {
- --color-code-background: #f8f8f8;
- --color-code-foreground: black;
-
- }
- @media not print {
- body[data-theme="dark"] {
- --color-code-background: #202020;
- --color-code-foreground: #d0d0d0;
-
- }
- @media (prefers-color-scheme: dark) {
- body:not([data-theme="light"]) {
- --color-code-background: #202020;
- --color-code-foreground: #d0d0d0;
-
- }
- }
- }
- </style></head>
- <body>
-
- <script>
- document.body.dataset.theme = localStorage.getItem("theme") || "auto";
- </script>
-
- <svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
- <symbol id="svg-toc" viewBox="0 0 24 24">
- <title>Contents</title>
- <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 1024 1024">
- <path d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 0 0 0 13.8z"/>
- </svg>
- </symbol>
- <symbol id="svg-menu" viewBox="0 0 24 24">
- <title>Menu</title>
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
- stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-menu">
- <line x1="3" y1="12" x2="21" y2="12"></line>
- <line x1="3" y1="6" x2="21" y2="6"></line>
- <line x1="3" y1="18" x2="21" y2="18"></line>
- </svg>
- </symbol>
- <symbol id="svg-arrow-right" viewBox="0 0 24 24">
- <title>Expand</title>
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
- stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-chevron-right">
- <polyline points="9 18 15 12 9 6"></polyline>
- </svg>
- </symbol>
- <symbol id="svg-sun" viewBox="0 0 24 24">
- <title>Light mode</title>
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
- stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather-sun">
- <circle cx="12" cy="12" r="5"></circle>
- <line x1="12" y1="1" x2="12" y2="3"></line>
- <line x1="12" y1="21" x2="12" y2="23"></line>
- <line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
- <line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
- <line x1="1" y1="12" x2="3" y2="12"></line>
- <line x1="21" y1="12" x2="23" y2="12"></line>
- <line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
- <line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
- </svg>
- </symbol>
- <symbol id="svg-moon" viewBox="0 0 24 24">
- <title>Dark mode</title>
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
- stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-moon">
- <path stroke="none" d="M0 0h24v24H0z" fill="none" />
- <path d="M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z" />
- </svg>
- </symbol>
- <symbol id="svg-sun-half" viewBox="0 0 24 24">
- <title>Auto light/dark mode</title>
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
- stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-shadow">
- <path stroke="none" d="M0 0h24v24H0z" fill="none"/>
- <circle cx="12" cy="12" r="9" />
- <path d="M13 12h5" />
- <path d="M13 15h4" />
- <path d="M13 18h1" />
- <path d="M13 9h4" />
- <path d="M13 6h1" />
- </svg>
- </symbol>
- </svg>
- <input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation">
- <input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc">
- <label class="overlay sidebar-overlay" for="__navigation">
- <div class="visually-hidden">Hide navigation sidebar</div>
- </label>
- <label class="overlay toc-overlay" for="__toc">
- <div class="visually-hidden">Hide table of contents sidebar</div>
- </label>
- <div class="page">
- <header class="mobile-header">
- <div class="header-left">
- <label class="nav-overlay-icon" for="__navigation">
- <div class="visually-hidden">Toggle site navigation sidebar</div>
- <i class="icon"><svg><use href="#svg-menu"></use></svg></i>
- </label>
- </div>
- <div class="header-center">
- <a href="../../"><div class="brand">MiniGrid Documentation</div></a>
- </div>
- <div class="header-right">
- <div class="theme-toggle-container theme-toggle-header">
- <button class="theme-toggle">
- <div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
- <svg class="theme-icon-when-auto"><use href="#svg-sun-half"></use></svg>
- <svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
- <svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
- </button>
- </div>
- <label class="toc-overlay-icon toc-header-icon" for="__toc">
- <div class="visually-hidden">Toggle table of contents sidebar</div>
- <i class="icon"><svg><use href="#svg-toc"></use></svg></i>
- </label>
- </div>
- </header>
- <aside class="sidebar-drawer">
- <div class="sidebar-container">
-
- <div class="sidebar-sticky"><a class="sidebar-brand" href="../../">
-
- <div class="sidebar-logo-container">
- <img class="sidebar-logo only-light" src="../../_static/img/minigrid.png" alt="Light Logo"/>
- <img class="sidebar-logo only-dark" src="../../_static/img/minigrid-white.png" alt="Dark Logo"/>
- </div>
-
- <span class="sidebar-brand-text">MiniGrid Documentation</span>
-
- </a><form class="sidebar-search-container" method="get" action="../../search/" role="search">
- <input class="sidebar-search" placeholder=Search name="q" aria-label="Search">
- <input type="hidden" name="check_keywords" value="yes">
- <input type="hidden" name="area" value="default">
- </form>
- <div id="searchbox"></div><div class="sidebar-scroll"><div class="sidebar-tree">
- <p class="caption" role="heading"><span class="caption-text">Introduction</span></p>
- <ul>
- <li class="toctree-l1"><a class="reference internal" href="../../content/installation/">Installation</a></li>
- <li class="toctree-l1"><a class="reference internal" href="../../content/basic_usage/">Basic Usage</a></li>
- <li class="toctree-l1"><a class="reference internal" href="../../api/wrappers/">Wrappers</a></li>
- <li class="toctree-l1"><a class="reference internal" href="../../content/pubs/">List of publications</a></li>
- </ul>
- <p class="caption" role="heading"><span class="caption-text">Environments</span></p>
- <ul class="current">
- <li class="toctree-l1"><a class="reference internal" href="../design/">General Structure</a></li>
- <li class="toctree-l1 current has-children"><a class="reference internal" href="../">Included environments</a><input checked="" 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 class="current">
- <li class="toctree-l2"><a class="reference internal" href="../empty/">Empty</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../four_rooms/">Four Rooms</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../door_key/">Door Key</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../multi_room/">Multi Room</a></li>
- <li class="toctree-l2 current current-page"><a class="current reference internal" href="#">Fetch</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../go_to_door/">Go To Door</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../put_near/">Put Near</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../red_blue_doors/">Red Blue Doors</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../memory_s7/">Memory S7</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../locked_room/">Locked Room</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../key_corridor_s6_r3/">Key Corridor S6 R3</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../unlock/">Unlock</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../unlock_pickup/">Unlock Pickup</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../blocked_unlock_pickup/">Blocked Unlock Pickup</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../obstructed_maze/">Obstructed Maze</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../dist_shift2/">Dist Shift2</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../lava_gap_s7/">Lava Gap S7</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../simple_crossing_s11_n5/">Simple Crossing S11 N5</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../dynamic/">Dynamic</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../go_to_object/">Go To Object</a></li>
- <li class="toctree-l2"><a class="reference internal" href="../playground/">Playground</a></li>
- </ul>
- </li>
- </ul>
- <p class="caption" role="heading"><span class="caption-text">Development</span></p>
- <ul>
- <li class="toctree-l1"><a class="reference external" href="https://github.com/Farama-Foundation/MiniGrid">Github</a></li>
- <li class="toctree-l1"><a class="reference external" href="https://farama.org/donations">Donate</a></li>
- <li class="toctree-l1"><a class="reference external" href="https://github.com/Farama-Foundation/MiniGrid/blob/master/.github/PULL_REQUEST_TEMPLATE.md">Contribute to the Docs</a></li>
- </ul>
- </div>
- </div>
- </div>
-
- </div>
- </aside>
- <div class="main">
- <div class="content">
- <div class="article-container">
- <a href="#" class="back-to-top muted-link">
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
- <path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12z"></path>
- </svg>
- <span>Back to top</span>
- </a>
- <div class="content-icon-container">
- <div class="theme-toggle-container theme-toggle-content">
- <button class="theme-toggle">
- <div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
- <svg class="theme-icon-when-auto"><use href="#svg-sun-half"></use></svg>
- <svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
- <svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
- </button>
- </div>
- <label class="toc-overlay-icon toc-content-icon" for="__toc">
- <div class="visually-hidden">Toggle table of contents sidebar</div>
- <i class="icon"><svg><use href="#svg-toc"></use></svg></i>
- </label>
- </div>
- <article role="main">
- <section id="fetch">
- <h1>Fetch<a class="headerlink" href="#fetch" title="Permalink to this headline">#</a></h1>
- <section id="description">
- <h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">#</a></h2>
- <p>This environment has multiple objects of assorted types and colors. The
- agent receives a textual string as part of its observation telling it which
- object to pick up. Picking up the wrong object terminates the episode with
- zero reward.</p>
- </section>
- <section id="mission-space">
- <h2>Mission Space<a class="headerlink" href="#mission-space" title="Permalink to this headline">#</a></h2>
- <p>“{syntax} {color} {type}”</p>
- <p>{syntax} is one of the following: “get a”, “go get a”, “fetch a”,
- “go fetch a”, “you must fetch a”.</p>
- <p>{color} is the color of the box. Can be “red”, “green”, “blue”, “purple”,
- “yellow” or “grey”.</p>
- <p>{type} is the type of the object. Can be “key” or “ball”.</p>
- </section>
- <section id="action-space">
- <h2>Action Space<a class="headerlink" href="#action-space" title="Permalink to this headline">#</a></h2>
- <div class="table-wrapper colwidths-auto docutils container">
- <table class="colwidths-auto docutils align-default">
- <thead>
- <tr class="row-odd"><th class="head"><p>Num</p></th>
- <th class="head"><p>Name</p></th>
- <th class="head"><p>Action</p></th>
- </tr>
- </thead>
- <tbody>
- <tr class="row-even"><td><p>0</p></td>
- <td><p>left</p></td>
- <td><p>Turn left</p></td>
- </tr>
- <tr class="row-odd"><td><p>1</p></td>
- <td><p>right</p></td>
- <td><p>Turn right</p></td>
- </tr>
- <tr class="row-even"><td><p>2</p></td>
- <td><p>forward</p></td>
- <td><p>Move forward</p></td>
- </tr>
- <tr class="row-odd"><td><p>3</p></td>
- <td><p>pickup</p></td>
- <td><p>Pick up an object</p></td>
- </tr>
- <tr class="row-even"><td><p>4</p></td>
- <td><p>drop</p></td>
- <td><p>Unused</p></td>
- </tr>
- <tr class="row-odd"><td><p>5</p></td>
- <td><p>toggle</p></td>
- <td><p>Unused</p></td>
- </tr>
- <tr class="row-even"><td><p>6</p></td>
- <td><p>done</p></td>
- <td><p>Unused</p></td>
- </tr>
- </tbody>
- </table>
- </div>
- </section>
- <section id="observation-encoding">
- <h2>Observation Encoding<a class="headerlink" href="#observation-encoding" title="Permalink to this headline">#</a></h2>
- <ul class="simple">
- <li><p>Each tile is encoded as a 3 dimensional tuple:
- <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>
- <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
- <span class="xref myst">minigrid/minigrid.py</span></p></li>
- <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>
- </ul>
- </section>
- <section id="rewards">
- <h2>Rewards<a class="headerlink" href="#rewards" title="Permalink to this headline">#</a></h2>
- <p>A reward of ‘1’ is given for success, and ‘0’ for failure.</p>
- </section>
- <section id="termination">
- <h2>Termination<a class="headerlink" href="#termination" title="Permalink to this headline">#</a></h2>
- <p>The episode ends if any one of the following conditions is met:</p>
- <ol class="arabic simple">
- <li><p>The agent picks up the correct object.</p></li>
- <li><p>The agent picks up the wrong object.</p></li>
- <li><p>Timeout (see <code class="docutils literal notranslate"><span class="pre">max_steps</span></code>).</p></li>
- </ol>
- </section>
- <section id="registered-configurations">
- <h2>Registered Configurations<a class="headerlink" href="#registered-configurations" title="Permalink to this headline">#</a></h2>
- <p>N: number of objects to be generated.</p>
- <ul class="simple">
- <li><p><code class="docutils literal notranslate"><span class="pre">MiniGrid-Fetch-5x5-N2-v0</span></code></p></li>
- <li><p><code class="docutils literal notranslate"><span class="pre">MiniGrid-Fetch-6x6-N2-v0</span></code></p></li>
- <li><p><code class="docutils literal notranslate"><span class="pre">MiniGrid-Fetch-8x8-N3-v0</span></code></p></li>
- </ul>
- </section>
- </section>
- </article>
- </div>
- <footer>
-
- <div class="related-pages">
- <a class="next-page" href="../go_to_door/">
- <div class="page-info">
- <div class="context">
- <span>Next</span>
- </div>
- <div class="title">Go To Door</div>
- </div>
- <svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
- </a>
- <a class="prev-page" href="../multi_room/">
- <svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
- <div class="page-info">
- <div class="context">
- <span>Previous</span>
- </div>
-
- <div class="title">Multi Room</div>
-
- </div>
- </a>
- </div>
- <div class="bottom-of-page">
- <div class="left-details">
- <div class="copyright">
- Copyright © 2022
- </div>
- Made with <a href="https://www.sphinx-doc.org/">Sphinx</a> and <a class="muted-link" href="https://pradyunsg.me">@pradyunsg</a>'s
-
- <a href="https://github.com/pradyunsg/furo">Furo</a>
-
- </div>
- <div class="right-details">
- <div class="icons">
-
- </div>
- </div>
- </div>
-
- </footer>
- </div>
- <aside class="toc-drawer">
-
-
- <div class="toc-sticky toc-scroll">
- <div class="toc-title-container">
- <span class="toc-title">
- On this page
- </span>
- </div>
- <div class="toc-tree-container">
- <div class="toc-tree">
- <ul>
- <li><a class="reference internal" href="#">Fetch</a><ul>
- <li><a class="reference internal" href="#description">Description</a></li>
- <li><a class="reference internal" href="#mission-space">Mission Space</a></li>
- <li><a class="reference internal" href="#action-space">Action Space</a></li>
- <li><a class="reference internal" href="#observation-encoding">Observation Encoding</a></li>
- <li><a class="reference internal" href="#rewards">Rewards</a></li>
- <li><a class="reference internal" href="#termination">Termination</a></li>
- <li><a class="reference internal" href="#registered-configurations">Registered Configurations</a></li>
- </ul>
- </li>
- </ul>
- </div>
- </div>
- </div>
-
-
- </aside>
- </div>
- </div><script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
- <script src="../../_static/jquery.js"></script>
- <script src="../../_static/underscore.js"></script>
- <script src="../../_static/doctools.js"></script>
- <script src="../../_static/scripts/furo.js"></script>
-
- <script>
- (() => {
- if (!localStorage.getItem("shownCookieAlert")) {
- const boxElem = document.createElement("div");
- boxElem.classList.add("cookie_alert");
- const containerElem = document.createElement("div");
- containerElem.classList.add("cookie_container");
- const textElem = document.createElement("p");
- textElem.innerHTML = `This page uses <a href="https://analytics.google.com/">
- Google Analytics</a> to collect statistics. You can disable it by blocking
- the JavaScript coming from www.google-analytics.com.`;
- containerElem.appendChild(textElem);
- const closeBtn = document.createElement("button");
- 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>`
- closeBtn.onclick = () => {
- localStorage.setItem("shownCookieAlert", "true");
- boxElem.style.display = "none";
- }
- containerElem.appendChild(closeBtn);
- boxElem.appendChild(containerElem);
- document.body.appendChild(boxElem);
- }
- })()
- </script>
- <!-- Google tag (gtag.js) -->
- <script async src="https://www.googletagmanager.com/gtag/js?id=G-JGXSLW7N06"></script>
- <script>
- window.dataLayer = window.dataLayer || [];
- function gtag(){dataLayer.push(arguments);}
- gtag('js', new Date());
- gtag('config', 'G-JGXSLW7N06');
- </script></body>
- </html>
|