Sign in with your CogSci, Facebook, Google, or Twitter account.

Or register to create a new account.

We'll use your information only for signing in to this forum.

Supported by

Concurrent Variable-Interval schedules

Hello to everyone,

I am new in this software, and I really appreciate all the work done to create an open-source program so we do not depend on big companies and their really expensive stuff. Thank you very much.

I am creating a concurrent Variable-Interval schedule, and I have created all the basic stuff: the screen, texts, time values to be taken in a random order, etc. But, my problem is, I do not know how to properly create and use time variables for my purpose. I have read the time part on the manual, but I do not know how it is related to my experiment, as I do not want to show the actual time.

Thank you in advance.


  • eduardeduard Posts: 764


    First of all, you could have a look at our tutorials. Getting familiar with the software is the first step to make your own experiment.

    Once you have a better understanding of Opensesame, you can give it a try and see how far you get. Once you get stuck, we'll help you of course.

    Alternatively, if you want to help in the conceptual phase of your programming, the least you can do is to provide a lot more detail on the design/task that you have in mind, so that we know better what it is that you need.



    Thanked by 1alikatado88
  • Hello Eduard, thanks for your response.

    I am actually familiar with the software, as I have programed two other experiments and they worked nice. The problem I am having with this one is related to the use of time clocks. I will give more details here so you can better understand about my problem:

    I need a concurrent Variable-Interval schedule. For those who are not familiar with those, let's imagine the following task: two circles are presented on each side of the screen, and the participant can get points by clicking on them -let's call them the left key and the right key-. On each key, an independent Variable-Interval schedule is running:

    On the left key, a Variable-Interval 10 seconds is running. This means the following: once the screen appears, two clocks start running: one for each the Variable-Interval schedule on the left, the other for the schedule on the right. If the participant makes a response on the left key after 10 seconds have elapsed, the participant will get the points from that schedule. Let's imagine that this schedule delivers 50 points at a time. Also, the schedule clock will re-start following points delivery. Each response that is made before this time has elapsed has no effect on the schedule. As the program is Variable-Interval (as opposed to Fixed-Interval), each time the schedule re-starts, the amount of time that needs to elapse so the response of the participant will lead to points is variable (a list of numbers around 10 seconds is created so the program samples from that list every time the schedule re-starts).

    On the right key, a Variable-Interval 30 seconds is running. It works the same way as the previous one, except for the list of numbers that will be used, which is a different one. Also, This schedule will deliver a different amount of points; 150, for example. Both programs are working simultaneously and independently.

    There is an extra-point that adds difficulty here: once the participant makes his first response on any schedule, during 5 seconds, the other option won't be available (the other stimulus is darkened to signal this situation). This is called a Change-Over-Delay (COD). I will give an example of this point, together with the functioning of the program in an example:

    Let's imagine that the experiment starts. On the left key, number 7 is sampled from its list, and number 32 is sampled from the list of the right key. The experiment has started and both clocks are running.

    • The participant, on second number 3 after the experiment started, make a response on the right key. As 3 is lower than 32, nothing happens on that key. The left key gets darkened and responses on it will not make any effect.

    • On second number 6, the participant makes another response on the right key. Still nothing happens.

    • On second number 8, the left key turns white again and responses on it will have an effect.

    • On second number 9, the participant responds on the left key. As 9 is greater than 7, the participant gets the 50 points, which are shown on that same key, and the clock from that key re-starts, and the program samples another number from this key, let's say 12. This means that, if the participant responds on this key after 12 seconds from now have elapsed, he will get another 50 points. Also, the right key becomes darkened and unavailable during 5 seconds.

    Essentially, that is the experiment I need.

    However, I do not know how to program those “clocks” on each key so the participant only gets the points if the appropriate amount of time has elapsed. I need help on how to program them and, once they are programmed, how to create a Change-Over-Delay (COD), as previously explained.

    Until now, I have the screen with both keys, which I have programed with the mousetrap add-in, and I have the basic sequences needed.

    I hope this explanation helped you to understand what I need.

    Thank you again.

  • Oh, I finally discovered how to solve it. I didn't know that the output variables are also variables that I could use during the experiment as all of them are already programed. I think I will be able to solve this on my own.

    Once I get my experiment finished, is there any experiments database? I wouldn't mind to share mine, as I haven't found any concurrrent schedules on the internet and it is a really common procedure.


  • eduardeduard Posts: 764


    Sorry for not having gotten back to you before you solved it yourself (credits to yourself!). Sounds like a nice paradigm. Once it is finished, you can upload it to https://osf.io/d2ecb/. This is soft of a repository for Opensesame experiments.

    Good luck and let us know if you get stuck again.


    Thanked by 1alikatado88
  • Sorry to bother you again, but even if I got how to use timing variables, I am stuck at something that seems pretty simple but I can't find how to fix it:

    In a certain sequence, I want OpenSesame to enter in a component only if the actual value of a variable whose output is a text string, differs from the previous value of that same variable. So, in case that the variable has the same value that the previous one, don't enter on that component.

    How can I do that?

    Thank you.

  • eduardeduard Posts: 764


    What exactly do you mean if you say "enter in a component", execute an item? If so, then you can make use of the run_if statements that define whether a component is executed or not. Just put something like [variable]=True in it and the component will only be run if your variable is true.

    So, in case that the variable has the same value that the previous one, don't enter on that component.

    This you have you compute first, but it is rather easy:

    if prev_variable == cur_variable: # prev_variable needs initiating once in the beginning of the experiment switch_variable = False else: switch_variable = True

    Just make sure you are updating the values for the prev and cur variables. The switch_variable, you can use then in the run_if fields to set which components should be executed.


    Thanked by 1alikatado88
  • alikatado88alikatado88 Posts: 7

    I am stuck again, near the end of the programming.
    Basically, I have two columns with different values on a loop item. These columns have time values for both Variable Interval schedules. I told the program to sample from these values in a random order. So, basically, the time that has to elapse before any response of the subject on the corresponding button leads to reinforcement will be randomized each time.
    My problem is that, once the subject makes a response, the loop starts again and so the program samples another value from that list, even if that trial has not be completed (from the experimental point of view). So, I would like to know, how can I tell the program to NOT sample again from each column until the subject has actually responded after the actual value has elapsed.
    Thank you in advance.

  • eduardeduard Posts: 764


    Sorry, I didn't understand that, I think. Would you mind uploading the experiment and/or rephrasing your problem? You probably need to do some direct python coding to solve this issue.


    Thanked by 1alikatado88
  • alikatado88alikatado88 Posts: 7

    Hi Eduard,

    I thought I may need some code, but I don't know how to solve it. I will try to explain it in a different way:

    Imagine that you have a loop item, and you have defined multiple cycles on that loop, for example you might define values 3, 5 and 7. At a first cycle, let's suppose that OpenSesame randomly picks value 5. I would like to tell OpenSesame to not pick another value until, let's say, a certain variable called "change" = "True".

  • alikatado88alikatado88 Posts: 7

    Solved it! Thank you anyway :)

    Once I have checked that the experiment is working 100%, I will upload it to the webpage you put.

  • eduardeduard Posts: 764

    Good to hear. See, after all you haven't needed much help anyway ;-)

Sign In or Register to comment.