Howdy, Stranger!

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

Supported by

Running two connected experiments concurrently?

edited February 2016 in OpenSesame

I'm going to be building a minimal social situation experiment, requiring the experiment to be run simultaneously on two PCs. The choice made by participant A on computer A should affect the options given to participant B on computer B. Is there any particular way of doing this with OpenSesame? Currently I'm leaning towards connecting the two machines via SSH, or else using one computer with two distantly connected monitors.

Comments

  • edited 12:46AM

    Hi there, yes this is certainly possible. In the past I have done this just by using sockets. I have just asked my collaborator on that experiment for permission to send you our files to use as an example and I hope to hear back from him shortly. If it is ok, I will place the experiment here.

    Buy Me A Coffee

  • edited 12:46AM

    Ok, I have put a simple example online at Github. Use that and see if it can help you start off. I had a more sophisticated example but I cannot seem to find it currently. Please note that you need OpenSesame 2 to run them. I have not had the time to adapt them to OpenSesame 3. Good luck, and let me know if it works out for you this way.

    Buy Me A Coffee

  • edited 12:46AM

    Fantastic, thank you so much!

  • edited 12:46AM

    Hi all,

    I just wanted to point out the psynteract plug-ins that a colleague of mine, Felix Henninger, and I are working on at the moment. They are designed to implement real-time interactive experiments in OpenSesame using simple drag&drop items.

    The plug-ins are still under active development, but you can download our current version along with some example experiments for OpenSesame 3 from https://github.com/psynteract/psynteract-os

    Best,

    Pascal

  • edited 12:46AM

    One additional note regarding the experiment under discussion: I don't know the specifics of the experiment, but I assume that our ultimatum game example (https://github.com/psynteract/psynteract-os/blob/master/examples/ultimatum_game.osexp) could be adapted to fit the purpose.

    Two participants are in different roles specified when starting the experiment using the psynteract_connect item (proposer, responder in the ultimatum game, could be A and B in your case). The proposer / participant A makes her decision first (you can use a run if condition that displays certain items depending on the current_role), then this decision is communicated using the psynteract_communicate item. Based on the decision of A, different options are shown to participant B.

    This way you can use the same experiment on both computers, have a random assignment of the roles, and communicate the decisions in real-time.

  • edited 12:46AM

    Hi everybody,

    Pascal has already presented our project perfectly (thanks!) -- I have nothing to add, except that you are warmly invited to contact us, and I can provide you with some further written documentation (which is in the works right now).

    What our plugins do is synchronize OpenSesame variables across multiple computers, and they require no additional code -- if you try them out, I'd love to hear about your experience!

    Kind regards

    -Felix

  • edited 12:46AM

    Wow that looks like an awesome project and feature to me!

    Buy Me A Coffee

  • edited 12:46AM

    That's perfect, thank you very much! I'll give them a go and let you know how it works out.

  • Hey,

    I just tried the plug-ins, because I want to implement the ultimatium game in our department. But, it doesn't work for me, maybe because I have the latest version of OpenSesame? Any ideas how to handle that?

    Thank you in advance!

    Laura

  • Hi Laura,

    Given that the plugin is 5 years old it is quite likely that there are some compatibility issues. But as one of the developers @Pascal is still active here on the forum, there might be a chance that it can be fixed. For this to be possible, we need a lot more information from your side, though. Such as, what Opensesame version do you run it on? On which operating system. What does it mean when you say "it doesn't work"? You can't install it? It crashes when you want to use it? The plugin doesn't behave it is supposed to?

    Feel free to add screenshots, or the experiment that doesn't work. Perhaps we can help you.

    thanks,

    Eduard

    Buy Me A Coffee

  • Hey Eduard,

    thank you for the kind response!

    I struggle with installing the psynteract plugin. I run the OpenSesame version 3.3.10 on Windows.

    It get the following error massage (I only copied the explicit error message):


    I'm not quite sure what to do.

    Best, Laura

  • Hi Laura,

    The installation instructions were out of date. I shall propose it to be changed. Can you try to run this command:

    pip.main(['install',  'https://github.com/eort/psynteract-os/archive/refs/tags/v0.7.1.2-alpha.zip'])

    I think this should work, but I am not sure (I'm also new to this :) )

    Buy Me A Coffee

  • Hi Eduard,

    thank you for the quick response!

    Unfortunately, it doesn't work either. I get the following error message:


    Best,

    Laura

  • Can you run Opensesame as adminstrator and retry?

    Btw, it is better to copy code and error messages into here, rather than making screenshots (one of the advantages is that like that things can be copied and pasted). Here, on the forum, you can format what you write, so that code is rendered nicely.

    Buy Me A Coffee

  • When running OpenSesame as administrator, I got it to work, thank you!! :)

    I do have another question, which might be a little bit stupid.

    I found the example fpr the ultimatum game at github (thank you Pascal & Felix), however, I don't really understand where to paste the code, so I can run it in OpenSesame. I'm kind of lost here.

    Thank you in advance!

    Laura

  • Either open Opensesame's first item in the overview and select general script. There you can replace all the code in it with what you copied from github. Alternatively, you can go to the start page of psyinteract's github, and download the entire directory as a zip file (https://github.com/eort/psynteract-os/archive/refs/heads/master.zip), unzip it and in examples you'll find the experiment file you want.

    Good luck,

    Eduard

    Buy Me A Coffee

  • Hey Eduard,

    Thank you again for your help!

    I tried using the way via zip file, but for some reason I get the error message "Failed to load plugin 'psynteract_communicate'" even though it's shown in the drag and drop menu on the left side. Thesame is shown for psynteract_wait and psynteract_connect. I tried to run OpenSesame as an Admin, but it makes no difference.

    The traceback is as following:

    File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\item_store.py", line 190, in new
        self.experiment.item_prefix()
      File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\plugins.py", line 449, in load_plugin
        item = item_class(item_name, experiment, string)
      File "C:\Program Files (x86)\OpenSesame\share\opensesame_plugins\psynteract_communicate\psynteract_communicate.py", line 125, in __init__
        self.custom_interactions()
      File "C:\Program Files (x86)\OpenSesame\share\opensesame_plugins\psynteract_communicate\psynteract_communicate.py", line 152, in custom_interactions
        self.custom_variables_widget.setEnabled(self.var.auto_detect_variables=='no')
      File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\item.py", line 240, in __getattr__
        raise AttributeError(u'%s not found' % var)
    AttributeError: custom_variables_widget not found
    

    Thank you!

    Laura

  • Hi Laura,

    These are most likely Python 2/3 compatibility problems, which makes sense given that the plugin was written 5 years ago. I don't know how much work it would be to make it Python3 compatible, nor whether it would be worth the effort. That might be a question more suited to @Pascal and/or Felix Henninger. I guess if you contact them, they can tell you whether it is something they have time for and that it would be worth to wait for you.

    (Of course, you can also try the rehaul of the code yourself. It is not terribly complicated, but a good degree of Python knowledge is definitely an advantage.

    Eduard

    Buy Me A Coffee

  • edited November 2021

    Dear Eduard, dear Laura,

    please excuse my delayed reply. I left academia last year transitioning into an industry position. I still continue to maintain the open source packages I developed (e.g., the mousetrap plugin for OpenSesame and the mousetrap R package). However, it usually takes me some time to answer questions in the forum as I can only check it in my free time. Thanks so much, Eduard, for filling in from time to time.

    Thanks a lot, Eduard, for suggesting an update of the installation instructions for psynteract on GitHub. I have taken a look at these yesterday and added some updates to the README for the psynteract plugin for OpenSesame on GitHub.

    Regarding psynteract: I think there are some further issues (beyond the plugin installation which is now fixed) when using psynteract under recent versions of OpenSesame (as you have also just mentioned above). As some of these are related to the general psynteract Python library, I have spoken with Felix (@mezzopiano), who is psynteract's main developer, and we are working on fixing these issues. We will let you know once they are resolved.

    Best,

    Pascal

  • Dear Eduard, dear Laura,

    a quick update on psynteract: Felix and I made some changes to both the psynteract library and the psynteract plugin for OpenSesame and things should be working with recent versions of OpenSesame now.

    You can find the updated installation instructions at https://github.com/psynteract/psynteract-os#installation (see also below). Please install the development version of psynteract (we have not put together a new release yet).

    You can install the latest development version by running the following command in OpenSesame's debug window:

    !pip install https://github.com/psynteract/psynteract-os/archive/master.zip

    You might run into some issues with the underlying psynteract library as you already have psynteract installed, so you could run the following command in addition to make sure that the psynteract library also gets updated:

    !pip install --upgrade --force-reinstall --no-deps https://github.com/psynteract/psynteract-py/releases/download/v0.9.0/psynteract-0.9.0.tar.gz

    We noticed a small issue regarding the psynteract extension in the menu (as the OS Web extension somehow gets moved to the psynteract menu). We believe that this might be an issue on the side of the OS Web extension and have raised a corresponding issue on GitHub: https://github.com/open-cogsci/opensesame-extension-osweb/issues/29 (@sebastiaan : Hope this is correct - and sorry in advance in case it is on our end!).

    Best,

    Pascal

  • @Pascal great work! And yes, the menu issue is on the radar, but I haven't had time to look into it yet.

  • Dear Pascal,

    thank you for the work you've put in, I appreciate it!

    I updated Psynteract, but still run into problems. The following error message keeps popping up:

    Hello from the pygame community. https://www.pygame.org/contribute.html

    Expyriment 0.10.0+opensesame2 (Python 3.7.6)

    Main file: Lib\site-packages\opensesame.py (7897e6)

    Unable to load numpy_formathandler accelerator from OpenGL_accelerate

    [2021-11-12 11:22:49,281:legacy:185:INFO] sampling freq = 48000, buffer size = 1024

    [2021-11-12 11:22:50,015:experiment:471:INFO] experiment started

    [2021-11-12 11:22:50,015:experiment:475:INFO] disabling garbage collection

    [2021-11-12 11:22:52,287:experiment:559:INFO] enabling garbage collection


    Unexpected error


    item-stack: experiment[run].psynteract_connect[run]

    time: Fri Nov 12 11:22:52 2021

    exception type: ConnectionError

    exception message: HTTPConnectionPool(host='server.example', port=5984): Max retries exceeded with url: /psynteract (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000029BB83D5948>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))


    Traceback:

     File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\urllib3\connection.py", line 157, in _new_conn

       (self._dns_host, self.port), self.timeout, **extra_kw

     File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\urllib3\util\connection.py", line 61, in create_connection

       for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):

     File "C:\Program Files (x86)\OpenSesame\lib\socket.py", line 752, in getaddrinfo

       for res in _socket.getaddrinfo(host, port, family, type, proto, flags):

    socket.gaierror: [Errno 11001] getaddrinfo failed


    During handling of the above exception, another exception occurred:


    Traceback (most recent call last):

     File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\urllib3\connectionpool.py", line 672, in urlopen

       chunked=chunked,

     File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\urllib3\connectionpool.py", line 387, in _make_request

       conn.request(method, url, **httplib_request_kw)

     File "C:\Program Files (x86)\OpenSesame\lib\http\client.py", line 1252, in request

       self._send_request(method, url, body, headers, encode_chunked)

     File "C:\Program Files (x86)\OpenSesame\lib\http\client.py", line 1298, in _send_request

       self.endheaders(body, encode_chunked=encode_chunked)

     File "C:\Program Files (x86)\OpenSesame\lib\http\client.py", line 1247, in endheaders

       self._send_output(message_body, encode_chunked=encode_chunked)

     File "C:\Program Files (x86)\OpenSesame\lib\http\client.py", line 1026, in _send_output

       self.send(msg)

     File "C:\Program Files (x86)\OpenSesame\lib\http\client.py", line 966, in send

       self.connect()

     File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\urllib3\connection.py", line 184, in connect

       conn = self._new_conn()

     File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\urllib3\connection.py", line 169, in _new_conn

       self, "Failed to establish a new connection: %s" % e

    urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x0000029BB83D5948>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed


    During handling of the above exception, another exception occurred:


    Traceback (most recent call last):

     File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\requests\adapters.py", line 449, in send

       timeout=timeout

     File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\urllib3\connectionpool.py", line 720, in urlopen

       method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]

     File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\urllib3\util\retry.py", line 436, in increment

       raise MaxRetryError(_pool, url, error or ResponseError(cause))

    urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='server.example', port=5984): Max retries exceeded with url: /psynteract (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000029BB83D5948>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))


    During handling of the above exception, another exception occurred:


    Traceback (most recent call last):

     File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libqtopensesame\misc\process.py", line 158, in run

       exp.run()

     File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\experiment.py", line 477, in run

       self.items.execute(self.var.start)

     File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\item_store.py", line 103, in execute

       self.run(name)

     File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\item_store.py", line 122, in run

       self[name].run()

     File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\sequence.py", line 51, in run

       self.experiment.items.run(_item)

     File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\item_store.py", line 122, in run

       self[name].run()

     File "C:\Program Files (x86)\OpenSesame\share\opensesame_plugins\psynteract_connect\psynteract_connect.py", line 63, in run

       offline=self.var.offline=='yes')

     File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\psynteract\__init__.py", line 61, in __init__

       self.db = self.server.database(db_name)

     File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\pycouchdb\client.py", line 156, in database

       (r, result) = self.resource.head(name)

     File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\pycouchdb\resource.py", line 126, in head

       return self.request("HEAD", path, **kwargs)

     File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\pycouchdb\resource.py", line 92, in request

       headers=headers, **kwargs)

     File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\requests\sessions.py", line 530, in request

       resp = self.send(prep, **send_kwargs)

     File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\requests\sessions.py", line 643, in send

       r = adapter.send(request, **kwargs)

     File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\requests\adapters.py", line 516, in send

       raise ConnectionError(e, request=request)

    requests.exceptions.ConnectionError: HTTPConnectionPool(host='server.example', port=5984): Max retries exceeded with url: /psynteract (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000029BB83D5948>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))


    To be honest, I don't really know what it means..

    Thank you in advance,

    Laura

  • Hi Laura,

    I think the issue is that the psynteract connect item wants to connect to a psynteract server but you have no server running. You can select the "Offline test mode" option in the psynteract connect item to test your experiments without a server.

    However, for running actual interaction experiments, you need to set up your own server and install the psynteract backend on it with the psynteract extension. Further information on that is provided in the BRM paper and also online at https://github.com/psynteract/psynteract-docs

    Hope this helps!

    Best

    Pascal

  • Hi Pascal,

    thank you for the response. It makes sense! I'll talk to my supervisor to set up the server.

    In the meantime I would like to try it offline, however, I did not find the "Offline test mode" checkmark. Do I have to install each plugin seperatly after installing psynteract? I tried to do so, but for some reason I would have to install another OpenSesame version (I'm currently running 3.3.10).

    Thank you in advance.

    Best,

    Laura

  • Hi Laura,

    once installing the psynteract plugin for OpenSesame using the command above, all six psynteract items should be available within OpenSesame. The option "Offline test mode" can be found within the psynteract connect item.

    Best,

    Pascal

  • Hi Pascal,

    I talked to my supervisior and he is willing to set up the server once I got the experiment to work. I chose the "Offline test mode", but the experiment stops at the inline script, with the followint error message:

    Details

    • item: process_decision
    • phase: run
    • item-stack: experiment[run].process_decision[run]
    • time: Fri Nov 26 11:51:47 2021
    • exception type: osexception
    • exception message: ` The variable 'partner01_decision' does not exist. Tip: Use the variable inspector (Ctrl+I) to see all variables.

    item-stack: experiment[run].process_decision[run] time: Fri Nov 26 11:51:47 2021 `

    Traceback (also in debug window)

      File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\inline_script.py", line 116, in run
        self.workspace._exec(self.crun)
      File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\base_python_workspace.py", line 124, in _exec
        exec(bytecode, self._globals)
      Inline script, line 2, in 
    

    Is that because of the offline mode? That the only answer I can possibly find.

    Thank you in advance!

    Best,

    Laura

  • Hi Laura,

    yes, you are right, this issue is due to the offline test mode (as it does not support roles). However, you should be able to run the prisoner's dilemma example in offline test mode without issues.

    Best,

    Pascal

  • Hey Pascal,

    my supervisor will set up the server, thank you so much!

    However, I still have a problem with variabel 'partner01_decision' (see screenshot). How can I handle it?

    Thank you!

    Laura

  • Hi Laura,

    which experiment are you using for your test? If you are still using the ultimatum game, this cannot be tested in offline test mode (due to the not assigned roles, see above) and you will get the error message that you just shared ("partner01_decision" does not exist, which is the case as there is no partner). However, you could run the prisoner's dilemma experiment in offline test mode, as this paradigm does not have roles and then the own decision is internally used by psynteract to simulate a partner decision.

    Best,

    Pascal

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