pyoperant.behavior.two_alt_choice module¶
-
class
pyoperant.behavior.two_alt_choice.
TwoAltChoiceExp
(*args, **kwargs)[source]¶ Bases:
pyoperant.behavior.base.BaseExp
A two alternative choice experiment
-
req_panel_attr
¶ list
list of the panel attributes that are required for this behavior
-
fields_to_save
¶ list
list of the fields of the Trial object that will be saved
-
trials
¶ list
all of the trials that have run
-
shaper
¶ Shaper
the protocol for shaping
-
parameters
¶ dict
all additional parameters for the experiment
-
data_csv
¶ string
path to csv file to save data
-
reinf_sched
¶ object
does logic on reinforcement
-
check_session_schedule
()[source]¶ Check the session schedule
Returns: True if sessions should be running Return type: bool
-
get_stimuli
(**conditions)[source]¶ Get the trial’s stimuli from the conditions
Returns: stim, epochs Return type: Event, list
-
make_data_csv
()[source]¶ Create the csv file to save trial data
This creates a new csv file at experiment.data_csv and writes a header row with the fields in experiment.fields_to_save
-
new_trial
(conditions=None)[source]¶ Creates a new trial and appends it to the trial list
If self.do_correction is True, then the conditions are ignored and a new trial is created which copies the conditions of the last trial.
Parameters: conditions (dict) – The conditions dict must have a ‘class’ key, which specifys the trial class. The entire dict is passed to exp.get_stimuli() as keyword arguments and saved to the trial annotations.
-
session_main
()[source]¶ Runs the sessions
Inside of session_main, we loop through sessions and through the trials within them. This relies heavily on the ‘block_design’ parameter, which controls trial conditions and the selection of queues to generate trial conditions.
-
session_pre
()[source]¶ Runs before the session starts
For each stimulus class, if there is a component associated with it, that component is mapped onto experiment.class_assoc[class]. For example, if the left port is registered with the ‘L’ class, you can access the response port through experiment.class_assoc[‘L’].
-