class_docstr: 2-dimensional grid-world implementation with 5 actions (the 4 cardinal directions and staying put).
docstr: Updates the state of the environment, i.e. the location of the agent, using an action index that corresponds to one of the 5 possible moves.
  
  Parameters
  ----------
  action: ``int`` 
      Action index that refers to which of the 5 actions the agent will take. Actions are, in order: "UP", "RIGHT", "DOWN", "LEFT", "STAY".
  
  Returns
  ----------
  state: ``int``
      The new, updated state of the environment, i.e. the location of the agent in grid world after the action has been made. Will be 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: ["Updates","the","state","of","the","environment",",","i.e",".","the","location","of","the","agent",",","using","an","action","index","that","corresponds","to","one","of","the","5","possible","moves",".","Parameters","--","--","--","--","--","action",":","``","int","``","Action","index","that","refers","to","which","of","the","5","actions","the","agent","will","take",".","Actions","are",",","in","order",":","``","UP","''",",","``","RIGHT","''",",","``","DOWN","''",",","``","LEFT","''",",","``","STAY","''",".","Returns","--","--","--","--","--","state",":","``","int","``","The","new",",","updated","state","of","the","environment",",","i.e",".","the","location","of","the","agent","in","grid","world","after","the","action","has","been","made",".","Will","be","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 step(self, action):
      """
      Updates the state of the environment, i.e. the location of the agent, using an action index that corresponds to one of the 5 possible moves.
  
      Parameters
      ----------
      action: ``int``
          Action index that refers to which of the 5 actions the agent will take. Actions are, in order: "UP", "RIGHT", "DOWN", "LEFT", "STAY".
  
      Returns
      ----------
      state: ``int``
          The new, updated state of the environment, i.e. the location of the agent in grid world after the action has been made. Will be 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.
      """
      state = self.P[self.state][action]
      self.state = state
      self.last_action = action
      return state
  
imports: import numpy
  import matplotlib.pyplot
  import seaborn
  from pymdp.envs import Env
label_desc: Use image node_id 4 for calling the GridWorldEnv obj's underlying member method code with example usage: obj.step(action) and returns: state