simulation module

Author:Dominic Hunt
simulation.csv_model_simulation(modelData, simID, file_name_generator)[source]

Saves the fitting data to a CSV file

Parameters:
  • modelData (dict) – The data from the model
  • simID (string) – The identifier for the simulation
  • file_name_generator (function) – Creates a new file with the name <handle> and the extension <extension>. It takes two string parameters: (handle, extension) and returns one fileName string
simulation.log_simulation_parameters(task_parameters, model_parameters, simID)[source]

Writes to the log the description and the label of the task and model

Parameters:
  • task_parameters (dict) – The task parameters
  • model_parameters (dict) – The model parameters
  • simID (string) – The identifier for each simulation.

See also

recordSimParams()
Records these parameters for later use
simulation.record_simulation(file_name_generator, task_data, model_data, simID, pickle=False)[source]

Records the data from an task-model run. Creates a pickled version

Parameters:
  • file_name_generator (function) – Creates a new file with the name <handle> and the extension <extension>. It takes two string parameters: (handle, extension) and returns one fileName string
  • task_data (dict) – The data from the task
  • model_data (dict) – The data from the model
  • simID (str) – The label identifying the simulation
  • pickle (bool, optional) – If true the data for each model, task and participant is recorded. Default is False

See also

pickleLog()
records the picked data
simulation.run(task_name='Basic', task_changing_properties=None, task_constant_properties=None, model_name='QLearn', model_changing_properties=None, model_constant_properties=None, model_changing_properties_repetition=1, label=None, config_file=None, output_path=None, pickle=False, min_log_level='INFO', numpy_error_level='log')[source]

A framework for letting models interact with tasks and record the data

Parameters:
  • task_name (string) – The name of the file where a tasks.taskTemplate.Task class can be found. Default Basic
  • task_changing_properties (dictionary of floats or lists of floats) – Parameters are the options that you are or are likely to change across task instances. When a parameter contains a list, an instance of the task will be created for every combination of this parameter with all the others. Default None
  • task_constant_properties (dictionary of float, string or binary valued elements) – These contain all the the task options that describe the task being studied but do not vary across task instances. Default None
  • model_name (string) – The name of the file where a model.modelTemplate.Model class can be found. Default QLearn
  • model_changing_properties (dictionary containing floats or lists of floats, optional) – Parameters are the options that you are or are likely to change across model instances. When a parameter contains a list, an instance of the model will be created for every combination of this parameter with all the others. Default None
  • model_constant_properties (dictionary of float, string or binary valued elements, optional) – These contain all the the model options that define the version of the model being studied. Default None
  • model_changing_properties_repetition (int, optional) – The number of times each parameter combination is repeated.
  • config_file (string, optional) – The file name and path of a .yaml configuration file. Overrides all other parameters if found. Default None
  • output_path (string, optional) – The path that will be used for the run output. Default None
  • pickle (bool, optional) – If true the data for each model, task and participant is recorded. Default is False
  • label (string, optional) – The label for the simulation. Default None, which means nothing will be saved
  • min_log_level (str, optional) – Defines the level of the log from (DEBUG, INFO, WARNING, ERROR, CRITICAL). Default INFO
  • numpy_error_level ({'log', 'raise'}) – Defines the response to numpy errors. Default log. See numpy.seterr