Giter VIP home page Giter VIP logo

Comments (2)

maximecb avatar maximecb commented on July 24, 2024

Thanks for reporting this issue. There have been a number of problems with this environment. Hopefully this is the last bug 😅

I don't love the idea of generating the observation twice because it will slow down the simulation. I think we can fix this bug by inverting the logic. That is, we update the obstacle positions before calling the parent step function. Then, the agent only gets punished if it tries to walk over an obstacle, which is as before. The difference is that the obstacles get priority with respect to movement. If the agent tries to move forward, sometimes a moving obstacle will get in its way before it can move. However, the agent is still in control of whether it reaches the goal or not.

I just pushed a commit implementing this. Let me know if it works for you or not. Note that your minigrid seems to be a bit out of date. There is a new renderer using numpy, no more pyqt and no more pixmaps. Hope that does not pose an issue either.

from minigrid.

fedem96 avatar fedem96 commented on July 24, 2024

Thanks for the quick reply, now the observation is consistent with the render.

As you noted, now the agent is sometimes blocked by the obstacles: if you want to avoid this behavior, you can replace the line:
self.place_obj(self.obstacles[i_obst], top=top, size=(3,3), max_tries=100)
with:
forward = action == self.actions.forward
self.place_obj(self.obstacles[i_obst], top=top, size=(3,3), max_tries=100, reject_fn=lambda this, pos, f=forward: f and all(this.front_pos == pos))

As for my version, I use the latest v1.0.1 from pypi, so the pixmap is a numpy array: the 'pixmap' string is there since I previously used the QT render. Anyway, thank you!

from minigrid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.