THE AUDITORY MODELING TOOLBOX

Applies to version: 1.6.0

View the code

Go to function

frambi_simulate
Simulate a single trial of interactions between agent and environment

Usage:

[response, logs] = frambi_simulate(agent, environment, options)

Input parameters:

agent Structure representing the FrAMBI agent. See the general description of FrAMBI for more details. See exp_barumerli2024 for an example.
environment Structure representing the FrAMBI environment. See the general description of FrAMBI for more details. See exp_barumerli2024 for an example.
options

Structure representing the FrAMBI options. It needs to contain the structure sample with the following fields:

  • initialization: Flag, if true the states of the agent and environment will be initialized by calling the functions defined in agent.model.initialize and environment.model.initialize.
  • validation: Flag, if true the states of the agent and environment will be validated by calling frambi_validate.
  • simulate: Structure controlling the simulation with the field cycles_max describing the maximum number of perception-action cycles in order to obtain a response of the single trial.

Output parameters:

response Response simulated by the agent. Depending on the function defined in agent.model.respond, it can be a scalar, vector, or matrix.
logs

Cell array documenting the internal states and decisions in each cycle, useful for debugging and detailed analysis. Each row of logs contains information about a single perception-action cycle with the following fields:

  • agent: Structure containing the state of the agent.
  • environment: Structure containing the state of the environment.

The last row of logs contains the field response, which stores the response as returned by the function agent.model.respond.

Description:

frambi_simulate(..) simulates a single behavioral trial in an experiment described as perception-action cycles. To this end, the interaction between the agent and the environment is simulated by iterating over the following sequence:

  • Execute: Defined in environment.model.execute, the environment creates signals to be obeserved by the agent.
  • Observe: Defined in agent.model.observe, the agent observes the environment and creates features for the inference of the environment's hidden states.
  • Infer: Defined in agent.model.infer, the agent creates beliefs by infering the environment's hidden states.
  • Act: Defined in agent.model.act, the agent acts on the environment based on the infered beliefs.
  • Conclude: Defined in environment.model.conclude, the environment concludes whether to end or continue the trial.

This simulates the mechanisms present in a single behavioral trial.

With the trial being finished, frambi_simulate(..) obtains a response from the agent as defined in agent.model.respond.

References:

R. Barumerli and P. Majdak. FrAMBI: A Software Framework for Auditory Modeling Based on Bayesian Inference. under review at Neuroinformatics, 2024.