[solved] Staircase
Hi all,
My latest adventure (I'm probably becoming a bit of a pest at this point!) in OpenSesame is an attempt to create a staircase loop. I've found the following discussion:
http://www.cogsci.nl/forum/index.php?p=/discussion/149/open-breaking-from-a-staircase-loop/p1
and planned to contact the original poster to ascertain if they were successful in implementing the loop but I cannot locate any contact details.
I hope to create a loop where I'll have up to 8 different display timings for a sketchpad (same stimuli each time) and be able to drop out of the loop once a participant reaches approx. 75% accuracy on one of those timings and then run a sequence for the actual experiment using said timing.
Has anyone here successfully achieved anything similar?
Advice would be most welcome as I've managed to build an experiment just fine for an undergrad but this addition would make it more elegant and the student is keen to get started.
Boo.

Comments
Hi boo,
Sebastiaan contacted me about this.
as for the original post, I was able to figure it out:
http://www.filedropper.com/ioraccletters1opensesametar
Bare with me; it was the first thing I ever did in python (and thereby also in opensesame). The whole thing is a bit bloated, and it's full of eyelink-stuff that you probably won't need; but I hope you can still use it as an inspiration
The task was a slight variation of the posner cueing paradigm, where participants were to indicate whether an M or N was presented. The presentation time of the letter is what I varied using PEST, as outlined here:
http://www.hitl.washington.edu/publications/r-98-11/node54.html
(I'm not sure what you meant by "up to 8 different display timings", but maybe using PEST provides an alternative?)
My expt looks as follows;
An introduction with some familiarizing to the displays
A practice loop where the pres. time is not varied yet.
A staircase loop sc_loop where PEST is first run; either until it has converged or until It has lasted 'long enough'
An experiment during which PEST runs in the background
The staircase loop is what you're probably most interested in. What I did was:
... thus breaking from it when 'continue_staircase' becomes false.
That's practically all! For you, looking at the sc_loop structure seems most useful. I hope you can work it out this way!
It is a quite powerfool way to manipulate experiment flow, if you want more than simple randomization, and I use it a lot currently. One word of warning though: using while loops is always tricky: make sure you will at least ever break from your staircase procedure
good luck!
Wouter
Hi there Wouter,
Thanks very much for getting back to me!
I've downloaded your OpenSesame file but unfortunately get the following error:
I was wondering what version of OpenSesame you used as I'm still operating on 0.26?
If you use 0.27 this may be why I cannot open your file.
Boo.
huh...remarkable...I'm under 0.26 as well, so that can't be it.
here's the script by itself; i.e. not as a tar.gz but simply a .opensesame; does that work?
http://www.filedropper.com/ioraccletters1
Hi,
That opens up just fine now
I'll go ahead and have a play around with it for the rest of the day and report back how I get on.
Thanks Wouter, you're a star
Boo.
Hi Wouter,
I ended up doing something very different from your code and it also worked. I'll post it up here with detailed descriptions on what is happening soon for any other user that wants to do something similar.
If mods could leave the thread open for this purpose I'd appreciate it.
Thanks all,
Boo.
Hi all,
Sorry for taking so long to add this. Xmas break and crazy work since has distracted me somewhat.
The following is the staircase code I used for my experimental design in OS.
It is by no means the most efficient code (it certainly could be cleaned up).
It is a 6 block sequence where at the end of each block if accuracy falls on, above or below 75% the duration of display is adjust. For example, if below 75% the display duration is increased by 20ms.
After 3 blocks instead of 20 the changes are one frame of 10ms.
Here are shots of the OS stream of events:
file:///F:/open_forum/pic.bmp
The following is the code used in the inline script called 'acc_script':
print "START OF INLINE SCRIPT"
dur1 = self.experiment.get("dur")
acc = self.experiment.get("accuracy")
loop_count = self.experiment.get("count_inline_loop")
correct_count1 = self.experiment.get("correct_count")
if ((loop_count+1) <= 3):
print "FIRST IF < 3 LOOP COUNT"
print loop_count
if (correct_count1 > 10 ):
print "correct_count1 > 10", correct_count1
self.experiment.items['TOJ_Seq'].prepare()
self.experiment.unset("dur")
self.experiment.set("dur", dur1 - 20)
self.experiment.unset("accuracy")
self.experiment.set("accuracy", 0)
self.experiment.unset("correct_count")
self.experiment.set("correct_count", 0)
self.experiment.items['TOJ_Seq'].run()
elif ((loop_count+1) >= 4) and ((loop_count+1) <= 6):
print "ELIF > 3 LOOP COUNT"
else:
print "SOMETHING WENT WRONG!!!!"
The variable 'dur' was defined in the 'set_variables' loop.
I hope someone can find a use for this basic code or at least it may point you in the right direction.