Howdy, Stranger!

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

Supported by

Controlled Randomization?

HI!

I'm a super beginner to coding and opensesame! For my experiment, I need to define the areas on the screen (excluding the center and corners) in which the stimulus will appear on random locations. I also want to be able to record the relative distance of the stimulus appearance to later look at. How do I accomplish this?

Thank you in advance!

Comments

  • Hi,

    There are many, many ways to do that.

    First of all, if you are a super beginner, I recommend that you finish a few tutorials before you tackle your problems. This will make your life so much easier in the future and even though it will take some extra time now, you'll save much more time later.

    You can start with the Opensesame tutorial to get familiar with the interface and the structure:

    https://osdoc.cogsci.nl/3.2/tutorials/beginner/

    and can also have a look at some basic Python tutorials (there are soo many out there!):

    https://python.cogsci.nl/

    I need to define the areas on the screen (excluding the center and corners) in which the stimulus will appear on random locations

    One approach could be to define areas that you want to exclude, and then randomly sample x,y positions and check whether they fall in that area. Here an example for how you would exclude the central 100 pixels around fixation (in a box shape, if you want a circular shape, you should use the distance between the middle of the sphere and the sampled position)

    import random
    
    # the define the limits of the area you want to exclude
    x_min = -50
    x_max = 50
    y_min = -50
    y_max = 50
    
    screen_width = 1600
    screen_height = 1000
    
    # keep on sampling x and y coordinates until you have some that lie outside the central box.
    while True: 
        x = random.sample(range(-0.5*screen_width,0.5*screen_width),1)[0]
        y = random.sample(range(-0.5*screen_height,0.5*screen_height),1)[0]
        if (x < x_min or x> x_max) and (y < y_min or y> y_max):
            break
    

    I also want to be able to record the relative distance of the stimulus appearance

    Distance can easily be computed with Pythagoras. For two points (x1,y1 and x2,y2) you square the difference between the x coordinates and add it with the squared distance of the y-coordinates and, finally, take the square root of that sum (sqrt((x1-x2)^2 + (y1-y2)^2)). You can write this code yourself or use existing functions, e.g. hypot in the math library.

    I hope this will get you started.

    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