Git Product home page Git Product logo

Comments (5)

zafarali avatar zafarali commented on June 18, 2024 1

Thanks for fixing this! It is now in the master branch with the reset() function from GridWorldMDP passing tests.

from emdp.

zafarali avatar zafarali commented on June 18, 2024

from emdp.

zafarali avatar zafarali commented on June 18, 2024

I fixed the issue in a recent commit. Sorry for the trouble. If you want to suggest a better fix I am happy to consider and accept. I will leave this issue open.

from emdp.

arnaghosh avatar arnaghosh commented on June 18, 2024

Hey thanks for your prompt reply. I feel removing the GridWorldMDP class reset function doesn't set the self.human_state at the initialization. This may affect other functions that use this variable to render the env graphically.
I feel assigning the extra variables (like size) that are not required by the MDP init prior to calling super.__init__ is a better workaround. This is what it would look like:

        if not convert_terminal_states_to_ints:
            terminal_states = list(map(lambda tupl: int(size * tupl[0] + tupl[1]), terminal_states))
        self.size =  size
        self.human_state = (None, None)
        self.has_absorbing_state = len(terminal_states) > 0
        super().__init__(P, R, gamma, p0, terminal_states, seed=seed, skip_check=skip_check)
        # self.reset()

    def reset(self):
        super().reset()
        self.human_state = self.unflatten_state(self.current_state)

from emdp.

arnaghosh avatar arnaghosh commented on June 18, 2024

Created a PR (#19) with this change.

from emdp.

Related Issues (8)

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.