code: def initialize_RDM_GM(T=16, A_precis=1.0, break_reward=0.001):
      sampling_state_names = ["sampling", "breaking"]
      what_obs_names = ["null", "UP", "RIGHT", "DOWN", "LEFT"]
      where_obs_names = ["sampling", "breaking"]
      action_names = ["sample", "break"]
  
      n_dir = len(what_obs_names) - 1
  
      num_states = [len(motion_dir), len(sampling_state_names)]
      num_obs = [len(what_obs_names), len(where_obs_names)]
      num_controls = [1, len(action_names)]
  
      # Initialize A, B, C and D arrays
      A = utils.initialize_empty_A(
          num_obs=num_obs, num_states=num_states
      )
      B = utils.initialize_empty_B(
          num_states=num_states, num_controls=num_controls
      )
      C = utils.obj_array_zeros(num_obs)
      D = utils.obj_array_uniform(num_states)
  
      for idx, sampling_state in enumerate(sampling_state_names):
          if sampling_state == "sampling":
              A[0][0, 0, idx] = 1.0
              A[0][1:, 1:, idx] = maths.softmax(
                  A_precis * np.eye(n_dir)
              )
              A[1][0, :, idx] = 1.0
          elif sampling_state == "breaking":
              A[1][idx, :, idx] = 1.0
              A[0][0, :, idx] = 1.0
  
      B[0][:, :, 0] = np.eye(
          num_states[0]
      )  # agent assumes the hidden dot-direction state doesn't change over time
      B[1][
          0, 0, 0
      ] = 1.0  # if agent chooses to continnue sampling while already sampling, they keep sampling.
      B[1][1, 0, 1] = 1.0  # you can move from sampling to breaking
      B[1][
          1, 1, :
      ] = 1.0  # Once you are in the break-state, you cannot "escape" it with either eaction (break-state is an absorbing state or sink in the transition model)
  
      C[1][1] = break_reward
  
      start_state_id = sampling_state_names.index("sampling")
      D[1] = utils.onehot(
          start_state_id, num_states[1]
      )  # prior that agent starts in the sampling state
  
      parameters = {"A": A, "B": B, "C": C, "D": D}
  
      mapping = {
          "motion_dir": motion_dir,
          "sampling_state_names": sampling_state_names,
          "what_obs_names": what_obs_names,
          "where_obs_names": where_obs_names,
          "action_names": action_names,
      }
  
      dimensions = {
          "num_states": num_states,
          "num_obs": num_obs,
          "num_controls": num_controls,
      }
  
      return parameters, mapping, dimensions
  
imports: from pymdp.envs import Env
  from pymdp import utils, maths
  import numpy
  from itertools import permutations, product
label_desc: Use image node_id 3 for calling a global function with example usage: initialize_RDM_GM(T, A_precis, break_reward) and returns: parameters,  mapping,  dimensions