# Basic instrumental conditioning (demo script www.learningsimulator.org) # Mechanism: strimulus-response learning # This is an example of a rat in a skinner box # The rat receives a reward when it preses the lever n_subjects : 50 mechanism : SR behaviors : press,other stimulus_elements : lever,reward start_v : lever->other:0, default:-1 alpha_v : 0.1 beta : 1 u : reward:2, default:0 @phase instrumental_conditioning stop: lever=60 LEVER lever | press: REWARD | LEVER REWARD reward | LEVER @run instrumental_conditioning xscale: lever @figure Instrumental conditioning (blue line shows average) @subplot 121 {'xlabel':'Trial number','ylabel':'Probability of response', 'ylim':[0,1], 'title':'Probability of pressing lever'} subject: average @pplot lever->press {'linewidth':4} subject: all @pplot lever->press {'linewidth':0.5} @subplot 122 - {'xlabel':'Trial number','ylabel':'SR association or value (v)', 'title':'SR association lever-press' } subject: average @vplot lever->press {'linewidth':4} subject: all @vplot lever->press {'linewidth':0.5}