Selection variable question

Chris, you attached an example to this question.

I don’t understand what the list and the range replicator are for. In general I have no idea what lists are used for. Can you explain?

thanks!
Mark

Hi Mark,

The block, trial, and list paradigm components are basically identical. The only difference is that block and trial increment a system variable (#announceBlock and #annouceTrial [sic], respectively) when entered and decrement it upon exit, while list does not. If you don’t make use of those variables when analyzing your data, then you can consider the three interchangeable.

In the example experiment, the range replicator creates nine identical copies of “New List”. The result is that, when the experiment runs, “New List” executes nine times in succession. The purpose is to demonstrate the selection variable (which contains three values) being exhausted and reset three times in a row. In a real experiment, you’d probably use a state system instead of a range replicator to control repetition.

If you have any more questions, please let me know!

Chris

Thanks Chris, that makes sense.
If I remove the list it no longer changes the selection variable.
Why is that? Does the range replicator replicate the object it contains? (Shows how little I understand about the mworks code structure). If so, does it only replicate a single object or can it contain multiple objects (i.e. trials or lists?)
Would it work identically if I just set the Protocol nsamples to 9 and removed both the list and range replicator?

I have one more set of questions I will send separately. Thanks!

Hi Mark,

If I remove the list it no longer changes the selection variable. Why is that? Does the range replicator replicate the object it contains? If so, does it only replicate a single object or can it contain multiple objects (i.e. trials or lists?)

According to the rules defined by the editor (which are only implicitly enforced by the parser, if at all), a range replicator can contain one or more of the following component types:

  • Paradigm component (trial, block, list, task system)
  • Stimulus
  • Stimulus group
  • Range replicator
  • List replicator

If I remove the list but leave the enclosed actions, the example fails to load (with a rather obscure error message) in the current nightly. This is expected, as range replicators can’t contain actions unless they’re enclosed in a paradigm component. I don’t know what’s happening in the build you’re using, but it probably isn’t good.

Would it work identically if I just set the Protocol nsamples to 9 and removed both the list and range replicator?

That wouldn’t work only because you’d be resetting num_used to 0 in each iteration. However, you could get the same result by removing the range rep and setting nsamples to 9 on the list (see attached example). In fact, that probably would’ve been a smarter way to write it in the first place :slight_smile:

Chris

Attachment: selection_var_no_range_rep.xml (1.96 KB)

p.s. I think it’s great that the logic below is enforced by the parser.

Ok, thanks! I have a much better idea of how the parser puts sequences
together now.
Mark