Howdy, Stranger!

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

Supported by

[solved] Nested Loops

edited September 2012 in OpenSesame

Hi Sebasstian,

Is it possible to create Nested Loops as used within E-Prime? I have existing projects that I would like to convert into OpenSesame to use instead. It seems that without using a sequence for every loop, all cycles need to be completed.

In the past I used the E-Prime Sampling functionality that could run 1 random sample from the total cycle list. I don't seem to find an option to do this without using inline scripting.

Is there a plan to incorporate this functionality into future versions?

Thanks

Anthony McGuffie

Comments

  • edited 10:19AM

    Hi Anthony,

    It is possible to only run one random cycle within a loop by using the 'Repeat' option. For example, if you were to run a loop with 5 cycles, you could set the order to random and the number of repeats to 0.20. In this case one random cycle would be run.

    I admit this is a bit of a workaround, but you could use this to get your experiments going for now. I'll leave it to Sebastiaan to answer your question regarding the future implementations ;)

    Hope this helps!

    Edwin

  • edited 10:19AM

    Hi Edwin,

    Thanks for the quick response. I just tried it and it does work ok. I did not know the repeat function could be set to less than 1.

    Cheers

    Anthony

  • edited 10:19AM
    I admit this is a bit of a workaround, but you could use this to get your experiments going for now. I'll leave it to Sebastiaan to answer your question regarding the future implementations

    Yes, the repeat value is a bit awkward, although it should work. For 0.27 there are some new features in the loop item, but not this particular one. I've marked it as a feature request for 0.28 (I've already declared an informal "feature freeze" for 0.27): https://github.com/smathot/OpenSesame/issues/101

    Cheers!

  • edited September 2012

    Hi Sebastiaan,

    Please note:

    I have just tried to set the number of cycles to 3 and the repeat to 0.33 to provide 1 random cycle and it shows a "zero or negative length" error.

    Cheers

    Anthony

  • edited 10:19AM

    Hi Anthony,

    That's just because 3 times 0.33 is 0.99. More specifically, the number of cycles that is actually executed is always the floor of the input number. The floor of 0.99 is 0.
    Therefore, if you set the repeat to 0.34 (0.34 * 3 = 1.02), 1 random cycle should be executed.

    Does this solve your problem?

    Best wishes,

    Lotje

    Did you like my answer? Feel free to Buy Me A Coffee :)

  • edited September 2012

    Hi Lotje,

    I did try to 'round' the result to 1 but I wasn't sure whether doing this would cause the loop to produce errors in lengthy experiments. The project I am creating at present has 6 x 150 trials with 4 nested loops so i raised this issue before participants starting testing.

    Cheers

    Anthony

Sign In or Register to comment.