simulation module¶
simulation Module¶
| Author: | Dominic Hunt |
|---|
Functions¶
csv_model_simulation(modelData, simID, …) |
Saves the fitting data to a CSV file |
log_simulation_parameters(task_parameters, …) |
Writes to the log the description and the label of the task and model |
record_simulation(file_name_generator, …) |
Records the data from an task-model run. |
run([task_name, task_changing_properties, …]) |
A framework for letting models interact with tasks and record the data |
| 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 onefileNamestring
-
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: 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 onefileNamestring - task_data (dict) – The data from the task
- model_data (dict) – The data from the model
- simID (basestring) – 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
- file_name_generator (function) – Creates a new file with the name <handle> and the extension <extension>. It takes two string parameters: (
-
simulation.run(task_name=u'Basic', task_changing_properties=None, task_constant_properties=None, model_name=u'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=u'INFO', numpy_error_level=u'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
.yamlconfiguration file. Overrides all other parameters if found. DefaultNone - 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 (basestring, optional) – Defines the level of the log from (
DEBUG,INFO,WARNING,ERROR,CRITICAL). DefaultINFO - numpy_error_level ({'log', 'raise'}) – Defines the response to numpy errors. Default
log. See numpy.seterr
See also
- task_name (string) – The name of the file where a tasks.taskTemplate.Task class can be found. Default