Groups

Groups are tags that refer to a set of other tags. The tags within the group could refer directly to particular stimulus files, or they could be groups themselves.

LET <tag> = {<tag1>, <tag2>, <tag3>, ... <tagN>}

Tags within a group should be separated by a comma and a space, and there should be no spaces between the opening curly brace and first tag name or the last tag name and the closing curly brace.

Groups refer to tags that have been previously defined, and create a hierarchical structure.

LET dog = "C:\BITTSy-Stimuli\animals\dog.png"
LET cat = "C:\BITTSy-Stimuli\animals\cat.png"
LET snake = "C:\BITTSy-Stimuli\animals\snake.png"
LET turtle = "C:\BITTSy-Stimuli\animals\turtle.png"

LET mammals = {dog, cat}
LET reptiles = {snake, turtle}

LET animals = {mammals, reptiles}

Below is a visualization of the relationships of tags in the above example.

In this example, dog, cat, snake, and turtle refer directly to files (the tag type covered in the previous section). The tags mammals, reptiles, and animals are all groups - but while the members of mammals and reptiles are tags referring to files, animals is a group of other groups.

Groups allow for random selection from within a set of tags, which can be used iteratively to select subsets of stimuli before selecting a particular stimulus from the final subset. Ultimately, the purpose will be to present a selected stimulus using an action statement. In order to select through a consistent number of steps, no matter which tags from within groups are chosen, the tags that are contained in a single group should be at the same level in the tag hierarchy. For example, if we wanted to make a group that was the set of the above animals that have legs, we could define:

LET has_legs = {dog, cat, turtle}

But we would NOT use:

LET has_legs = {mammals, turtle}

because if mammals is selected first from the group, there is another layer of selection required before finally presenting the stimulus than if we selected turtle initially. BITTSy cannot proceed through different numbers of selection steps based on what is chosen.

The above point is especially important in protocols using loops. But if your selections from your group are not inside a loop, and are occurring in a fixed order (such that you know when you're selecting another group and when you're selecting a tag) you can construct a group with tags at different levels in the tag hierarchy - there's nothing stopping you. But the fix below always works.

In cases where you really want something more like {mammals, turtle}, you can use "dummy groups," which contain only one item, to get around this issue.

LET dog = "C:\BITTSy-Stimuli\animals\dog.png"
LET cat = "C:\BITTSy-Stimuli\animals\cat.png"
LET snake = "C:\BITTSy-Stimuli\animals\snake.png"
LET turtle = "C:\BITTSy-Stimuli\animals\turtle.png"

LET mammals = {dog, cat}
LET testudines = {turtle}

LET has_legs = {mammals, testudines}

Note: You can go back and forth between defining tags that reference files or tags that are groups as you write protocols. However, whenever a group is defined, all of its component tags must have already been defined earlier in the protocol. BITTSy validates protocols by reading line by line, and if a tag name is referenced inside a group before it is defined through a LET statement, this will cause a validation error.

Groups of SIDES

There is one special type of group that doesn't contain tags as its elements - it contains side names. This allows for random selection not just of stimulus files (like other groups), but also of presentation location.

LET <tag> = {<side1>, <side2>, ... <sideN>}
LET stim_locations = {LEFT, CENTER, RIGHT}
LET targetsides = {LEFT, RIGHT}

The side names that can be used in groups should be previously defined in the starting SIDES definition.

Last updated