Help with Active Avoidance experiment

Dear team,

I’m developing an experiment in which the subject has to learn to shuttle from one side to the other of a grid every two seconds in order to avoid a punishment (that is represented in my experiment by a brief sound that I named ‘shock’).

So far, I was able to develop the grid and the programming for the virtual subject, represented by a red circle, to move around. I’m having a hard time to combine this with the ‘shock’ every two seconds, or the restart of the 2-sec interval if ‘subject’ shuttle from one side of the grid to the other.

I tried to create a tag named ‘last side touched touched’ (right or left) and if it is set to right ‘shock timer’ (a parameter I created) resets. Another trial (‘Shock’) is set to be presented if ‘shock timer’ is > 1999ms.

I was hoping that this configuration would reset ‘shock timer’ every shuttle the subject did and, therefore, ‘Shock’ would never be presented if a shuttle was emitted every 2 seconds or less.

However, I can shuttle and move around the grid just fine, but all the rest is not working…

Would it be possible to give me a hand, please?

I’m attaching the files and the experiment here to make it easier to understand. Also attaching a paper with a similar methodology.

Unsignaled Sidman Avoidance.sl5 (42 KB)

beep-01a.wav (85.5 KB)

translucid Grid.png

Virtual subject (translucid).png

Collins-2014-Taking action in the face of thre.pdf (898 KB)

Your avoidance and shock rules are never evaluated because every time a movement key is pressed, the Shuttle trial repeats itself. To fix this:

  • remove your Avoidance and Shock trials but have Shuttle absorb their rules.

  • remove the Repeat Trial action from all of your movement rules.

  • create a single rule that always repeats the trial; it should be the last rule in the list.

As an aside, any constant action should be placed on its own to avoid duplication. Otherwise, it will take longer to make fixes.

Other notes that may be important down the line:

  • In order for SuperLab to check for time even without participant response, you may want to set a small time limit on the Virtual Subject event.

  • Consider checking for successful shuttles before setting them.

  • Currently in your design, pressing the space bar ends your experiment.

Thanks, Arman.
I just followed your instructions, but now the subject moves ‘unpredictably’ through the grid instead of going to the next position I commanded it to.
I also couldn’t repeat the ‘shock’ for the second time…
Here is the second (corrected) version of the experiment.

Unsignaled Sidman Avoidance v2.sl5 (40.8 KB)

See the attachment for the changes that I’ve made.

The shock is only heard once because although your timer is reset, it is never started again. I have done so in the rule that repeats the trial.

As for the unpredictable movements, I have created a parameter that keeps track if the circle has moved within that particular trial. After moving, it is set to “yes” and no other movement rules will be initiated. This is also reset to “no” in the rule that repeats the trial.

Unsignaled Sidman Avoidance (80.4 KB)

This is great, Arman. Although, I’m not being able to reset ‘shock timer’ if the subject successfully shuttle from side to side (to the right side if it is initially on the left or to the right if is initially at the left) so that the subject will never be shocked provided that he/she keeps shuttling from one side to the other. But they will if they do not shuttle within 2 seconds.

I’m also not sure how many ‘shocks’ I’ll allow for each ‘trial’, maybe twice. I’ll probably have to write to you again with further questions. Sorry about that, but the experiment seems so complex for my level of knowledge of programming! Also sorry about the English, I hope I’m being able to express myself clearly.

Thanks a lot!

You cannot check against multiple values within a single field. See the image below for an example of where you have tried to do so:

Fortunately, you do not have to create a separate rule for each value. Instead, create another tag set called “Current Side Touched” (CST) to accommodate “Last Side Touched” (LST).

The flow of your experiment as it pertains to successful shuttles should be like so:

  • Start the experiment with LST set to “left” and CST set to “none”.

  • Check for position and set position tag appropriately.

  • Check position tag and set CST to “left” or “right” appropriately.

  • Check CST against LST for a successful shuttle.

  • If CST is either “left” or “right”, transfer the value to LST and set CST back to “none”.

Thanks! It worked perfectly.
I’m working on the additional parameters and probably will have to ask for help every now and then.
For now, I’m trying to set the first subject position randomly, which was easy – I just set the ‘subject location’ level in the ‘start initial position’ rule to ‘random’.
However, I have to tag this first position that was defined randomly. Is it possible?

It is possible, but you have to use more rules after the randomization of the initial trial level.

Example: If trial variable Subject Location is Level 1 (A3), set trial’s tag to A3, and etc.

Great. I’ll do that and get back if I need sth else. Thanks.


It worked fine. I attached the current version experiment so you can take a look at it.

I added another sound to signalize to the subject that they avoided the shock successfully and limited the number of avoidance “trials” (blocks 2 and 3). These are working great as well.

However, I tried to present blocks 2 and 3 not only after 6 seconds, which is working, but also if two successful shuttles are achieved, which is not. This later rule I tried to count the number of successful shuttles in a correspondent parameter and limit the presentations of this parameter in a rule included in the block. Why is it not working?

Another problem is that, sometimes, the first time the virtual subject touches one of the grid if being computed as a successful shuttle, sometimes it is not. I couldn’t figure it out why…

Thanks again!

Unsignaled Sidman Avoidance v4.sl5 (66.2 KB)

Safety sound - 200ms.wav (16 KB)

Shock 200ms.wav (10.2 KB)

  1. Your rule checks for exactly 2 successful shuttles. It should be checking for at least 2 shuttles. Change “Parameter Successful shuttles = 2” to “Parameter Successful shuttles > 1”. Also, at some point, you should be resetting the successful shuttles parameter.

  2. Your shuttle trial needs to start off with a tag for Last Side Touched. Manually select “None”. Then, adjust your successful shuttle rules like so:

  1. You also need to take care of the case that the circle spawns on columns A or E. To do so, open the Grid trial - where you set initial position - and use the “Set Last Side Touched” rules after the tag position rules.

In the future, if you are attaching an experiment with media files, please create a .zip file via SuperLab by clicking File > Create an Experiment Package….

Thanks! I’ll work on it and get back if I need further assitance.


I followed your instructions, but sometimes the same problems are happening: the “AA trial” block is running just once and “safety sound” is sometimes presented sometimes not. Can’t see a pattern. Don’t know exactly if is just the stimuli that is not being presented or if the shock is not being delayed as well. Kind of lost at this point…

Best regards!

Unsignaled Sidman Avoidance (43.6 KB)

Compare your successful shuttle rules. The organization in your criteria is faulty for “Successful shuttle to the left”. Fixing this should help with the safety sound.

As for your “AA trial” block sometimes running just once, try to figure out the case in which this occurs. Do you never want this to be the case?

It worked. Amazing how fast you guys find an error…
I will think about the AA trial repetition and now start working on recording subjects’ inputs…
Thanks a lot!