class_docstr: The Agent class, the highest-level API that wraps together processes for action, perception, and learning under active inference.
  
  The basic usage is as follows:
  
  >>> my_agent = Agent(A = A, B = C, <more_params>)
  >>> observation = env.step(initial_action)
  >>> qs = my_agent.infer_states(observation)
  >>> q_pi, G = my_agent.infer_policies()
  >>> next_action = my_agent.sample_action()
  >>> next_observation = env.step(next_action)
  
  This represents one timestep of an active inference process. Wrapping this step in a loop with an ``Env()`` class that returns
  observations and takes actions as inputs, would entail a dynamic agent-environment interaction.
class_docstr_tok: ["The","Agent","class",",","the","highest-level","API","that","wraps","together","processes","for","action",",","perception",",","and","learning","under","active","inference",".","The","basic","usage","is","as","follows",":",">",">",">","my_agent","=","Agent","(","A","=","A",",","B","=","C",",","<","more_params",">",")",">",">",">","observation","=","env.step","(","initial_action",")",">",">",">","qs","=","my_agent.infer_states","(","observation",")",">",">",">","q_pi",",","G","=","my_agent.infer_policies","(",")",">",">",">","next_action","=","my_agent.sample_action","(",")",">",">",">","next_observation","=","env.step","(","next_action",")","This","represents","one","timestep","of","an","active","inference","process",".","Wrapping","this","step","in","a","loop","with","an","``","Env","(",")","``","class","that","returns","observations","and","takes","actions","as","inputs",",","would","entail","a","dynamic","agent-environment","interaction","."]
docstr: Advances time by one step. This involves updating the ``self.prev_actions``, and in the case of a moving
  inference horizon, this also shifts the history of post-dictive beliefs forward in time (using ``self.set_latest_beliefs()``),
  so that the penultimate belief before the beginning of the horizon is correctly indexed.
  
  Returns
  ---------
  curr_timestep: ``int``
      The index in absolute simulation time of the current timestep.
docstr_tok: ["Advances","time","by","one","step",".","This","involves","updating","the","``","self.prev_actions","``",",","and","in","the","case","of","a","moving","inference","horizon",",","this","also","shifts","the","history","of","post-dictive","beliefs","forward","in","time","(","using","``","self.set_latest_beliefs","(",")","``",")",",","so","that","the","penultimate","belief","before","the","beginning","of","the","horizon","is","correctly","indexed",".","Returns","--","--","--","--","-","curr_timestep",":","``","int","``","The","index","in","absolute","simulation","time","of","the","current","timestep","."]
code: def step_time(self):
      """
      Advances time by one step. This involves updating the ``self.prev_actions``, and in the case of a moving
      inference horizon, this also shifts the history of post-dictive beliefs forward in time (using ``self.set_latest_beliefs()``),
      so that the penultimate belief before the beginning of the horizon is correctly indexed.
  
      Returns
      ---------
      curr_timestep: ``int``
          The index in absolute simulation time of the current timestep.
      """
  
      if self.prev_actions is None:
          self.prev_actions = [self.action]
      else:
          self.prev_actions.append(self.action)
  
      self.curr_timestep += 1
  
      if (
          self.inference_algo == "MMP"
          and (self.curr_timestep - self.inference_horizon) >= 0
      ):
          self.set_latest_beliefs()
  
      return self.curr_timestep
  
imports: import warnings
  import numpy
  from pymdp import inference, control, learning
  from pymdp import utils, maths
  import copy
label_desc: Use image node_id 8 for calling the Agent obj's underlying member method code with example usage: obj.step_time() and returns: self