class_docstr: 2-dimensional grid-world implementation with 5 actions (the 4 cardinal directions and staying put).
docstr: Reset the state of the 2-D grid world. In other words, resets the location of the agent, and wipes the current action.
  
  Parameters
  ----------
  init_state: ``int`` or ``None``
      Initial state of the environment, i.e. the location of the agent in grid world. If not ``None``, must be a discrete index  in the range ``(0, (shape[0] * shape[1])-1)``. It is thus a "linear index" of the initial location of the agent in grid world.
      If ``None``, then an initial location will be randomly sampled from the grid.
  
  Returns
  ----------
  self.state: ``int``
      The current state of the environment, i.e. the location of the agent in grid world. Will be a discrete index  in the range ``(0, (shape[0] * shape[1])-1)``. It is thus a "linear index" of the location of the agent in grid world.
docstr_tok: ["Reset","the","state","of","the","2-D","grid","world",".","In","other","words",",","resets","the","location","of","the","agent",",","and","wipes","the","current","action",".","Parameters","--","--","--","--","--","init_state",":","``","int","``","or","``","None","``","Initial","state","of","the","environment",",","i.e",".","the","location","of","the","agent","in","grid","world",".","If","not","``","None","``",",","must","be","a","discrete","index","in","the","range","``","(","0",",","(","shape","[","0","]","*","shape","[","1","]",")","-1",")","``",".","It","is","thus","a","``","linear","index","''","of","the","initial","location","of","the","agent","in","grid","world",".","If","``","None","``",",","then","an","initial","location","will","be","randomly","sampled","from","the","grid",".","Returns","--","--","--","--","--","self.state",":","``","int","``","The","current","state","of","the","environment",",","i.e",".","the","location","of","the","agent","in","grid","world",".","Will","be","a","discrete","index","in","the","range","``","(","0",",","(","shape","[","0","]","*","shape","[","1","]",")","-1",")","``",".","It","is","thus","a","``","linear","index","''","of","the","location","of","the","agent","in","grid","world","."]
code: def reset(self, init_state=None):
      """
      Reset the state of the 2-D grid world. In other words, resets the location of the agent, and wipes the current action.
  
      Parameters
      ----------
      init_state: ``int`` or ``None``
          Initial state of the environment, i.e. the location of the agent in grid world. If not ``None``, must be a discrete index  in the range ``(0, (shape[0] * shape[1])-1)``. It is thus a "linear index" of the initial location of the agent in grid world.
          If ``None``, then an initial location will be randomly sampled from the grid.
  
      Returns
      ----------
      self.state: ``int``
          The current state of the environment, i.e. the location of the agent in grid world. Will be a discrete index  in the range ``(0, (shape[0] * shape[1])-1)``. It is thus a "linear index" of the location of the agent in grid world.
      """
      self.set_init_state(init_state)
      self.last_action = None
      return self.state
  
imports: import numpy
  import matplotlib.pyplot
  import seaborn
  from pymdp.envs import Env
label_desc: Use image node_id 2 for calling the GridWorldEnv obj's underlying member method code with example usage: obj.reset(init_state) and returns: self