text: init_aif function, including the policy length and which parts of the information gain to 
  use, as well as the policy precision*γ*. 
  (cid:7)  (cid:4) 
  
  # Infer policies 
  infer_policies !( aif ) 
  (cid:6)  (cid:5) 
  
  Finally, sample_action! then samples the next action from the agent. This is performed by 
  marginalising the policy probabilities to obtain the probabilities for the action on the next 
  time step, and then softmax transforming it with the*α*action precision parameter. 
  (cid:7)  (cid:4) 
  
  # Sample Action 
  sample_action !( aif ) 
  (cid:6)  (cid:5) 
  
  These functions can be combined by users in various ways, depending on their purpose. 
  Often, however, users will want to combine them in a single function that implements 
  the full action–perception loop that receives an observation and returns an action. This is 
  implemented with the ActionModels sister package for behavioural modelling. 
  
  3.2. Simulation with ActionModels 
  
  ActionModels is a library for implementing, simulating and fitting various behavioural 
  models to data. Here, we show how to use it in conjunction with ActiveInference to 
  make the simulation of AIF models easy and in a fully generalised framework that is 
  compatible with other types of cognitive and behavioural models as well. ActiveInference 
  provides a full "action model"—a full model of the action-generating process in an agent— 
  for using AIF called action_pomdp!. In this case, all this information is contained in the 
  AIF object. action_pomdp! then takes the AIF object and a single-time-step observation 
  as arguments, and then runs state inference, parameter learning and policy inference, 
  and returns probability distributions over the possible actions of the agent. 
  (cid:7)  (cid:4) 
  
  observation = [1] # observation with one modality 
  # Run the action model for a single observation 
  action_distributions = action_pomdp !( aif :: AIF , observation ) 
  (cid:6)  (cid:5) 