psychopy.org | Reference | Downloads | Github

Selecting next trial based on previous trial (pseudo randomisation)


#1

Hello,
I am designing a go-nogo task. I’m drawing my conditions from a. Csv file. Initially I was presenting the trials (say 40) in random order so it wasn’t a problem(the column header being trialType).
But now I want to change the design so that a no go trial is followed by a go trial always while keeping the overall randomisation. How could I possibly achieve this pseudorandomisation in Builder?

The difference between my go and no go trials is that for go trials, I have set the duration of the nogo signal to zero. Thus stop duration being the variable value being drawn from csv file for different conditions.

By the looks of other posts, it seems that I should have a randomised file meeting the constraints beforehand (before the loop runs) as checking the current random value and changing it while loop is running might run into many problems. I was thinking, could I import my csv file in the begin experiment section (much before it is being used in the trial routine loop), randomise it there to meet the mentioned constraint(don’t know what code to write) and then save it and use this csv file in loop which runs sequentially later.

Thank you in advance.
Also I’m sorry if a question like this has already been asked and answered. If it has (I didn’t come across), could you please post a link to it.

Thanks,
Vishada.


#2

Hi,

The way I do this for prospective memory experiments is use one loop to load the filler items into one set of arrays and a second loop to load the target items. Then a third loop without an Excel file selects from the filler array unless the loopThisN value is equal to a random or arbitrary value for the next target. The value is then increased to the next value, e.g puttarget = puttarget + mingap + random.randint(0,maxgap).

I only use the builder but invariably end up putting lots of code snippets into it.

Best wishes,

Wakefield

Wakefield Morys-Carter
Senior Psychology Demonstrator
Oxford Brookes University