docstr: Tests to make sure whole active inference loop works (with various past and future
  inference/policy horizons).
docstr_tok: ["Tests","to","make","sure","whole","active","inference","loop","works","(","with","various","past","and","future","inference\/policy","horizons",")","."]
code: def test_mmp_active_inference(self):
      """
      Tests to make sure whole active inference loop works (with various past and future
      inference/policy horizons).
      """
  
      num_obs = [3, 2]
      num_states = [4, 3]
      num_controls = [1, 3]
      A = utils.random_A_matrix(num_obs, num_states)
      B = utils.random_B_matrix(num_states, num_controls)
  
      C = utils.obj_array_zeros(num_obs)
      C[1][0] = 1.0
      C[1][1] = -2.0
  
      agent = Agent(
          A=A,
          B=B,
          C=C,
          control_fac_idx=[1],
          inference_algo="MMP",
          policy_len=2,
          inference_horizon=3,
      )
  
      T = 10
  
      for t in range(T):
          o = [
              np.random.randint(num_ob) for num_ob in num_obs
          ]  # just randomly generate observations at each timestep, no generative process
          qx = agent.infer_states(o)
          agent.infer_policies()
          action = agent.sample_action()
  
      self.assertEqual(len(agent.prev_obs), T)
      self.assertEqual(len(agent.prev_actions), T)
  
imports: import os
  import unittest
  import numpy
  from copy import deepcopy
  from pymdp.agent import Agent
  from pymdp import utils, maths
  from pymdp import inference, control, learning
  from pymdp.default_models import generate_grid_world_transitions
label_desc: Use image node_id 6 for calling the TestAgent obj's underlying member method code with example usage: obj.test_mmp_active_inference() without return types