Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Pseudorandomize with constraint: Each stimulus separated by unequal number of fillers

Dear all,

I have a question with setting up pseudorandomization constraint in Opensesame. I have 24 word stimuli and 72 fillers and need to present all items to the participants in the following way: each word stimulus should be separated by filler (fillers). That means no more than one word stimulus appear in succession. However, there is no requirement about how many fillers to appear in succession.

Is this achievable by adding a few scrip in the loop script? I'm quite green in python coding, so I'll be grateful for your help here! Thank you!

Sandra

Comments

  • Hi Sandra,

    Try that here:

    import random
    
    #i'll implement it with letters for times sake
    stimuli = ['S']*24 # 24 Ss as targets
    fillers = ['F']*72 # 72 Fs as fillers
    combined = stimuli + fillers
    random.shuffle(combined) # randomize
    all_stimuli = combined[0] # initialize a list with the first item of the combined list
    
    while len(stimuli) != 0 or len(fillers)!= 0: 
        stim = combined[0]
        if all_stimuli[-1] in stimuli and stim in stimuli:
            random.shuffle(combined)
        else:
             all_stimuli.append(combined.pop(0))
    

    Does that work for you?

    Eduard

    Buy Me A Coffee

  • Hi Eduard,

    Many thanks for providing the script.

    I initiated a new experiment and tried your script independently. But I'm not sure if I did the sketchpad with the right variable name. So which variable should I use when I present the stimuli in the sketchpad: all_stimuli, stim, combined? I tried all of them in the sketchpad, but opensesame warns that the variable "all_stimuli" (or "stim" or "combined") does not exist.

    Here's what I did: I added a new sequence under the new experiment, and under the sequence, I first put an in-line script with the code above and after that comes the sketchpad, on which I cite the [all_stimuli] (or [stim] or [combined]).

    I also tried putting inline scrip before the sequence, but the same error occurred. Did I do it in the right way? Thanks!

    Sandra
    @eduard

  • Hi Sandra,

    First of all,

    So which variable should I use when I present the stimuli in the sketchpad

    all_stimuli, because it has the stimuli in the right order in it. To better understand what the code does, you can also run it line by line

    To be able to use a variable in a sketchpad you have to store it as part of var. So, if you, in the end of the inline_script, do this: var.all_stimuli = all_stimuli you would not get the error message that the variable does not exist.

    However, the variable var.all_stimuli contains all the stimuli you want to show in a block, right? So all targets and fillers. So, when you try to present var.all_stimuli in a sketchpad it will still fail, just because you draw all the stimuli on a single sketchpad. Even though you probably want to draw each stimulus in a separate one, right?

    So, the general procedure is as follows

    1) Create the list of all stimuli (before the block loop)
    2) In the block loop, first pick the current stimulus from the stimulus list in an inline_script (you need to count the current trial number to do so)
    3) present that stimulus in the sketchpad

    I attach a template for an experiment that does so, from there on you can start working, I hope.

    Eduard

    Buy Me A Coffee

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games