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
Comments
Hi Boris,
Welcome to the forum!
Such pseudorandomisation functionality is not (yet) implemented in OpenSesame. Perhaps you could try Mix (only for Windows, unfortunately), a program that allows you to generate trial orders according to a wide range of constraints. The minimal distance restriction you mention will be very easy to apply with this software.
It can be downloaded here:
And the reference is:
Van Casteren, M., & Davis, M. H. (2006). Mix, a program for pseudorandomization. Behavior research methods, 38(4), 584–589.
I hope this helps.
Best wishes,
Lotje
Did you like my answer? Feel free to
Thank you for your answer !
I know Mix and Shuffle (also for linux or mac) but this forces me to use pre-made lists for each subject.
Isn't it possible to do this with a Python inline ?
Best regards,
Boris
Hi Boris,
It's possible to use an inline, but you'll need to build your experiment a bit different from the usual way.
Normally you would fill out a list item with all of your stimulus words and set the list order to random. For pseudorandom options, you'll have to do the randomization yourself. You could still predefine all your stimulus words up front, in a variable or a text document (in a. tsv-like lay-out).
Lets say you did this in the way you prefer and created a list variable containing all the words in the beginning of your experiment. After the inline_script in which you do this, add some more code:
inline_script_1
Add the following to your sequence in an empty list with repeats = trials
Now you can use the variable stimword in OpenSesame items used to present your stimulus like so: [stimword]
Good luck!
Hi Edwin,
Thank you very much for your code but I'm not sure that I understand everything.
The point is that, I have difficulties to see how your inline identify the column defining words and pseudowords (the one where I do not want more than x repetitions)
For instance, for the moment, my stimulus list is the following:
Here the column that should not repeat are columns 3 ("Type") or 4 ("TypeCible"). But I need to have the other columns in my result file...
Best,
Boris
I also tried your code with a simple list ("1" would code for words and "2" for nonwords) like
But when I print stimlist it gives:
Which is not what I was waiting for.
I was waiting for something like: (for no more than 3 repetitions)
And I think that stimlist should be a multi-dimensional array on which I could do the randomization on a particular column...
I found this discussion on this question but I am unfortunately not able to apply it to my problem:
http://stackoverflow.com/questions/4630723/using-python-for-quasi-randomization
Hi Boris,
I think that Lotje's suggestion to use Mix is the most pragmatic. But since you appear to be quite keen to use Python code, here's another example. The idea is the same as the script that Edwin provided, but it indeed uses a multidimensional array. At the start of the experiment, add an inline_script item with the following code:
This will read in a text file that specifies all the conditions. For this example I assumed that the conditions are as you described in your previous post. The text file should be tab-separated, not contain column headers, and be placed in the file pool. (If you want to do it differently, take a look at numpy.loadtxt().)
Next, you add an inline_script to the start of each trial sequence with the following in the prepare phase:
This will walk through the trial list that was loaded and randomized at the start of the experiment, and store the values from the columns as experimental variables that you can use in sketchpads etc.
Randomizing with constraints is not the easiest thing in the world! You may want to take a look at NumPy, which is great library for numeric stuff:
Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi Sebastiaan,
Thank you very much !!
Unfortunately, I tried your code and had the following error
My script is there if it can help:
https://docs.google.com/file/d/0B-sE9ac1ksCAbXRfd0ljdklkWFk/edit?usp=sharing
I also wanted to know what I should write in the "block_loop"
Finally I think that the strategy to shuffle again may probably fail with many items. (I think I experienced that with Eprime)
Ideally I would like to shuffle a first time and then verify the items and when an item is repeated more than 3 times ( 1 1 1 1), switch it with the next other item (2).
For instance
1 1 1 1 2 1 2 2 2 2
would give in a first time (there is still a problem at the end but we loop on the beginning of the table until a solution is found)
1 1 1 2 1 1 2 2 2 2
which would give
2 1 1 2 1 1 2 2 2 1
Best,
Boris
Hi Boris,
I understood you did not want to have the same word appear over two successive times, but I now see you meant the type of word. In this case my script won't work indeed! It assumes the original stimlist is a list containing your stimulus words.
Another suggestion:
inline_script_1 (at start of experiment)
inline_script_2 (at start of trial, in prepare phase)
stimuli.txt
================================
WORKAROUND, DUE TO \n ERROR IN INLINE_SCRIPT:
inline_script_1 (at start of experiment)
stimuli.txt
For some reason, inline_script_2 isn't shown full. Retry: (see above)
EDIT: bleep, same problem. In two pieces, but do put 'em in the same inline!
EDIT #13415313: got it, there is a 'smaller than' sign that looks like the start of some html-bit. Just replace #SMALLER THAN SIGN# by <
Now you can use the variables with the names they have in stimuli.txt (in our case: [Target], [Prime], [Type], [TypeCibele] and [CorrectAnswer]).
OpenSesame file: http://dl.dropbox.com/u/95377477/Sem.opensesame
Good luck!
EDIT: BUG REPORT!
Sebastiaan, when I tried to run above code, OpenSesame crashes because of the use of '\n' in an inline_script. It seems to think '\n' represents a return within the inline_script, instead of a part of the code (win7, 0.27 run from source).
Boris: temporary workaround, see above.
Hi Edwin,
I ran your opensesame script (from the dropbox).
I converted the stimuli.txt file to UTF8
I emptied the "block_loop" object in OS
It runs but:
-it did not respect the constraint of 2 or 3 max successive items
-some items are repeating themselves in the 20 trials... (and consequently some items are missing)
So I added the line in the first inline: (because I did not find where you define the maximum number of repetitions [but I am not sure of this])
exp.set("maxreps", 2)
But this did not change the above problems...
Here is the final script
https://docs.google.com/file/d/0B-sE9ac1ksCAU1B6aUpVTjB2Y1U/edit?usp=sharing
Hi Sebastiaan,
Finally I found that the problem I had with your script concerned the path (space and/or accentuated characters)
Now it's working nicely.
The only problem remaining is that it crashes with 120 items or more...
Here is the script for 120 items:
https://docs.google.com/file/d/0B-sE9ac1ksCAc0s3NlktaERRUW8/edit?usp=sharing
And the stimuli:
https://docs.google.com/file/d/0B-sE9ac1ksCAWktYc1NvbV9qY3c/edit?usp=sharing
Hi Boris,
Ah, yes, you are right! A variable that should have been a string turned out to be an integer (seems to be automatically converted by OpenSesame). Therefore the comparison always turned out False (i.e.: '1' == 1 is False indeed).
On the matter of the maximum repetitions: somewhere it got lost (although I can distinctly remember to have written it... spooky!). It's in where it's supposed to be now.
For the repetition of certain words: you're right again! I forgot to include that in the new script. Now it should be fixed.
Finally, concerning the converting to UTF-8: this is because of the accents, right? Didn't quite spot those since just now
Anyhow, the correct OpenSesame script, the stimuli.txt that I used and a sample output file are in the Dropbox (https://www.dropbox.com/sh/amjj3gsou22b5cn/XCnTnr7aAt).
Hope it's fixed now!
Hi Edwin,
I tested your code and it works nicely now.
More interesting it's working in "extreme conditions" with 240 items and only 2 repetitions.
So I'll check everything tomorrow but it looks like a problem solved ! (interestingly people from Eprime support never found a proper solution to this problem)
Thank you very very much !
Nice! No problem, glad to help out. Especially if we did better than E-Prime's support
Hi Edwin,
I think that another solution than the dummy column for the "\n" is to do a rstrip
Best,
Hi,
Unfortunately, I was too enthusiastic.
The script is often crashing when running the experiment at the end of the 240 items (for instance after 235).
The problem is if, arriving on item 235, all the words have already been selected for example, then it is looping endlessly.
Here is the script and the stimuli:
https://docs.google.com/folder/d/0B-sE9ac1ksCAeVJWUGFlRE5RdWc/edit?usp=sharing
Best,
Hi Boris,
Do I understand correctly that all of the single-word repeats have 'run out' for all words? Wouldn't that mean that all of the trials are already run? (basically meaning that you cannot possibly run 240 trials, unles you heighten the variable for the number of repeats for unique stimuli)
EDIT: if you are using the original 20 items posted here, than 240 should be possible indeed. I'll look into it.
Best,
Edwin
Yes
No because there are still some pseudowords to display...
I'm not using the 20 items but 240 different ones
A strategy would be to randomize items and switch problematic items with the next good one (restarting with the beginning of the items if there is a problem at the end of the list) but I don't success in implementing that in python.
Hi Edwin,
I think that I found a partial solution to the problem.
This new script is doing well to randomize my table "stimuli". (I tested it in a Python interpreter and it was working)
So at the end in my result file, I have no "1" or "2" (column "Type") more than 3 times which is good.
But I still the big following problem:
-during the experiment I have quite often more than 4 words following. At the end in my csv file, I notice that my French word VAURIEN is transformed in a "2" (nonword) during the experiment while in the stimuli.txt file it is marked as "1" (word)
Script & Stimuli
https://docs.google.com/folder/d/0B-sE9ac1ksCALVhvdTVUUXY0dG8/edit?usp=sharing
Best regards,
Finally I found the solution !
This code should work whatever the size of your stimulus list and whatever the max number of consecutive trials you want (you can adapt the script easily)
Put this inline in the beginning of the script:
and this one at the beginning of your "trial_sequence"
The script and stimuli are here:
https://docs.google.com/folder/d/0B-sE9ac1ksCALVhvdTVUUXY0dG8/edit?usp=sharing
I hope this code will be useful to other users !
Hi Boris,
Great that you've found a solution! I like the french commenting, it's always nice to pick up a few more words in a different language.
Good luck with the testing!
Sorry for my French but I'm a lazy English user... (always cost more energy to write/say something in English ) :P
Hi, I find myself in a similar situation that I am finding easier to solve with Sebastiaan's code (it crashes, but I feel like I'm close to it..) and I would prefer not to write a predefined list per subject.
I have a list of possible conditions (24) and 5 columns. To make things easier I've coded all values in numbers (integers). In the last column I have values 0 or 1 like this:
2 2 10 1 1
2 1 10 1 1
2 2 10 1 0
2 1 10 1 0
I want to pseudorandomize the order of conditions according to the last column so that (ideally) if on one trial the condition has a value 1 in the last column, the next trial has to have a value 0, but when I used the shuffle it was taking too much time (now I'm only using a list of 24 possible trials but they will be more) so instead I set number of maximum repetitions=2
I have created a txt file tab delimited with no header.
At the beginning of the experiment I created an inline script with in run phase:
import numpy as np
repeatCheck = 3 # # How many repeats are not allowed
column = 4 # Which column should be checked for repeats
src = 'C:\Users\act\Desktop\stim.txt' # A tab separated text file in the file pool
Load the conditions into a NumPy array
a = np.loadtxt(exp.get_file(src), delimiter='\t', dtype='str')
Go into a 'shuffle loop'
while True:
# Shuffle the array
np.random.shuffle(a)
Store the array as exp.stimlist, so we can access it later on
exp.set("stimlist", a)
if I print a I get a nicely shuffles list. So that works now I just want for each trial to read the list in a sequential manner and use the info in it. In my loop item now empty (right?) I only set number of repetitions of each cycle to 1, inside I have a trial sequence which calls another inline script with all my experiment written. at the beginning in the prepare phase I put:
Get the trial id using the trial_sequence counter, and use that to get the
correct row from the stimlist
trialId = self.get('count_trial_sequence')
trialCond = exp.stimlist[trialId]
Use the columns from the stimlist to set the experimental variables
exp.set('correct_response', trialCond[0])
exp.set('target_pos', trialCond[1])
exp.set('target_letter', trialCond[2])
exp.set('warning_signal', trialCond[3])
exp.set('cue_validity', trialCond[4])
but it crashes with this error
exception message: string index out of range
exception type: IndexError
Traceback (also in debug window):
File "dist\libopensesame\inline_script.py", line 150, in prepare
File "dist\libopensesame\python_workspace.py", line 111, in _exec
File "", line 8, in
IndexError: string index out of range
I think it doesn't correctly creates the object stimlist, I have tried when loading the txt to put object instead of string but it doesn't work. Also, if I try to print stimlist at the end of the first inline script it doesn't work. Instead if I print "a" it works, why?
thank you for your help
Stefania
I know this is a pretty old thread, but if you're still using this forum, Boris, I have a question for you! I very much like your script and think I will use it (thanks for that!), but I wanted to clarify a potential problem I see.
My question is in regard to this part of your script:
Doesn't looking for a solution from the beginning of the table potentially lead to "undoing" the previous work? For example, if you had the following sequence of item types:
2 2 2 1 2 2 1 1 2 1 1 2 2 1 1 1 2 2 2 2
and on i = 16 (the 17th item), you find that the following three items are of the same type, but you're at the end of your list, so you loop back around to find an item to "swap" and the first available one you come by is at k = 3 (the fourth item). By swapping the fourth and 17th items, you've now created a run of 5 "2's" at the start of your list.
Perhaps I'm missing something?
Thanks in advance!
-Jonathan
Ohhhh wait I get it. You continue to cycle through the list until you do a whole pass without finding any unwanted repetitions (so repet remains set to 0 and BigSolution can be set to 1).
Sorry for the unnecessary question! Hopefully it will help someone who misunderstands as I did