Howdy, Stranger!

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

Supported by

Randomize trial in a sequence and repeat the same sequence two times

Hi, I have a sequence with 4 items. I need to randomize items in the sequence e show the sequence two times. For example, if my trials are "A, B, C, D" I need to randomize them (e.g. B, C, A, D) and then show this sequence two times (B, C, A, D, B, C, A, D).
In OpenSesame I set an experimental loop with 4 cycles in random order. Then, how can I repeat the same sequence two times?

Comments

  • Hi,

    That's an interesting scenario. There are multiple ways to solve it, but here's what I would do. First, in your loop, define your condition variable in terms of other variables: condition0, condition1, etc. Keep a sequential order, and set repeat to 2:

    Then, before the loop, insert an inline_script in which you define the variables condition0, etc. such that they correspond to your conditions ('A', 'B', 'C', and 'D) in a random order.

    import random
    
    conditions = ['A', 'B', 'C', 'D']
    random.shuffle(conditions)
    
    var.condition0 = conditions[0]
    var.condition1 = conditions[1]
    var.condition2 = conditions[2]
    var.condition3 = conditions[3]
    

    Do you see the logic here?

    Cheers,
    Sebastiaan

  • Hi Sebastian,
    Thanks for your response. I'm not very good in Python, so I'll show you my experiment:

    On the left you can see the experimental sequence, then my experimental loop (is that correct?). Then i wrote a inline_script as you told me:

    Could you help me in a more specific way?

    Thanks a lot

  • Hi,

    What exactly is the problem? Your script and structure seem to be fine. (Maybe you could move your script for the run to the prepare phase of your inline_script). Are there any error messages?

    Eduard

    Buy Me A Coffee

  • The problem is that trials are not randomized. It shows times 25, 35, 45 and 55 and then repeats.

  • Oh, I see. Well, this is because you do randomize only your condition variable but not the durations of the conditions. They are hardcoded.

    You can try coding all your variables in a similar way:

    import random
    
    order = [1,2,3,4]
    conditions = ['A', 'B', 'C', 'D']
    durations = [25000,35000,45000,55000]
    random.shuffle(order)
    
    # the conditions
    var.condition0 = conditions[order[0]]
    var.condition1 = conditions[order[1]]
    var.condition2 = conditions[order[2]]
    var.condition3 = conditions[order[3]]
    
    # the durations
    var.durations0 = durations[order[0]]
    var.durations1 = durations[order[1]]
    var.durations2 = durations[order[2]]
    var.durations3 = durations[order[3]]
    
    # etc..
    

    Alternatively, you have to add another inline_script to the trial sequence and in that one set variables depending on the condition you are in.

    Does that make sense?

    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