Page History: Old Roulette Element
Compare Page Revisions
Page Revision: 2011/07/18 11:48
|
New Element
|
Info |
Category: |
Scenario control |
|
AddIn: |
Base Elements |
Creator: |
OkazoLab Team |
|
Scope: |
Parent Event |
Owns Snippets: |
no |
|
Usage: |
Runtime Screen,Snippets |
Roulette is an element that is designed to produce flexible randomization scenarios in your experiment. In the simplest case it works as a random number generator.
Description
In the simplest case it works as a random number generator. For more complicated scenarios it can generate the balanced random blocks of integer numbers and provides a runtime control over them. A simple roulette random number generator can be created by choosing an appropriate event and selecting
Event –
Add Element command and selecting
Roulette under the
Design section.
Snapshots
Snapshot 1
| Snapshot 2 |
Practical Use
A Simple Random Number Generator ¶
Many experiments require the use of simple random number generators for independent, non-blocked features of the design. In a visual task for example it may be necessary to randomly rotate the stimuli on each trial. This factor is unrelated to the experimental factors that will be manipulated in the design (see next section). Once the new Roulette element has been added, it is necessary to amend certain properties in order to get it to behave as appropriately. If the random number generator is simply that, then it is necessary to set the range of the random numbers that are desired in the Factors box by specifying the highest number in the range and placing the letter x behind it. If a stimulus is going to be rotated by a random number of degrees upon each trial for example, then we would set the factors box to read “360x”.
It is of course necessary to specify via code, the parameter that will be controlled by the random number that has been generated.
Experimental Factors and Blocking ¶
Most experiments will have a roulette counter to ensure that the main experimental factors are randomly presented, a specific number of times, within each block. If, under the Roulette properties, the property for
Blocking is set to ‘True’, then the main levels of the experimental variables can be defined. Under
Factors the levels of each experimental variable should be written as ‘2x3x3’ or ‘2x2’ etc. The
Block Length will then be calculated, and if a certain variable should be more frequent then others, then this can be manipulated via the
Value Frequencies option.
It is of course necessary to assign the output of the
Factored Random Value as a multiparameter array (see Parameters and then in the code snippets, assign the individual parameters of this array to variable names. It is then necessary to specify what the properties of these parameters should be, in the differing levels of each variable. See the bottom of this page for a more detailed example.
In the example below,
Blocking is set to "true", and the experimental design in outlined in the Factors box as 2x2x2x3x4. A multi parameter array named ‘fRandomValue’ (visible in orange) has been assigned to the property
Factored Random Value.
The individual parameters of this array have been assigned specific names in the snippets box.
The last factor (x4) has not been defined. This means that each of the conditions that have been defined, will be repeated 4 times – thus lengthening the duration of each block.
Given that the first parameter in the array ‘TContrast’ can be only one of two values (as defined in the Factors box), only four simple lines of code are required to specify what EventIDE should do for each of the 2 levels of this factor. In this example, the shared ‘Colormask’ property of three different elements has been assigned as a multi-parameter array, and the RGB values of this color mask manipulated as required. See the section parameters for more information on manipulating the properties of individual elements.
TContrast=fRandomValue[0];
DContrast=fRandomValue[1];
OContrast=fRandomValue[2];
Distance=fRandomValue [3];
Generic Properties
Name | Description | Attributes | Value Type |
---|
Randomization |
Show demo block | Demonstrates a random block generated with the current settings. | Design-time action |
Min Value | Minimal value for random numbers in block | D,R | Int32 |
Max Value | Maximal value for random numbers in block | D,R | Int32 |
Frequencies | Defines the frequency for each integer value in the random block range between MinValue and MaxValue. For example, Frequency[0] denotes how many times the MinValue will appear in a generated random block. | D,R | Int32[] |
Block Length | Total length of the random block, estimated as Mix Value*Frequency[0]+…+Max Value *Frequency[N] | D,R | Int32 |
Blocking | If true, balanced blocks are generated (defined number of occurrences for each of random numbers) | D,R | Boolean |
Factors | Defines the ranges for decomposition of a single random number. For example, a random number in the range [1.. 24] can be decomposed on 3 factors with the ranges 4x2x3 | D,R | String |
No repetition | No repetition between blocks. If true, the first value in each new random block will be never the same as the last value in the previous block | D | Boolean |
Runtime Info |
Index in block | Indicates an index of the exposed random number in the current random block. The index starts from zero. | R, Read-only | Int32 |
Current Block | Indicated a number of the current block in a sequence of blocks generated from the start of experiment | R, Read-only | Int32 |
Block Completed | Indicated that the last random number is exposed in the current block. When the parent event become activate next time, a new random block will be generated. | R, Read-only | Boolean |
Runtime Commands |
Force new block | Force the immediate generation of a new random block. However, the new single random value will be exposed only at the next activation of the parent event. | Runtime command | Boolean |
Cancel value | Cancels exposing of the current random number. Its value will be randomly reinserted back into the current random block. Later this value will be exposed again. | Runtime command | Boolean |
Runtime Output |
Random value | Exposed random value from the current random block. (The property obtains a new value each time when the parent event is activated) | R, Read-only | Int32 |
Random values | Array that contains all random values in the current random block. (The property obtains a new value each time when a new block is generated) | R, Read-only | Int32[] |
Factored random value | Exposed random value from the current random block, decomposed according to the factors ranges (property Factors). For example, the random value 24 will be decomposed as {4,2,3} if the ranges 4x2x3 are set. The decomposed values can be read by the array member with indexes [0],[1],[2] and so on. | R, Read-only | Int32[] |