The attached experiment defines a single protocol composed of two task systems, each of which contains three states. The task systems have the same name (“Task System”), and in both the three states are named “First State”, “Second State”, and “Third State”. Each of the states includes a “report” action that announces the task system number (1 or 2) and state number (1, 2, or 3). When the experiment is run, the report actions produce the following output:
TS 1, TSS 1
TS 2, TSS 2
TS 2, TSS 3
TS 2, TSS 1
TS 2, TSS 2
TS 2, TSS 3
Note that state 1 in task system 1 is followed by state 2 in task system 2. This happens because the two “Second State” states have the same full name (“New Protocol/Task System/Second State”). Since the state in TS 2 is created after the one in TS 1, it overwrites the first one in the ComponentRegistry.
Najib and I ran into this problem in lab the other day. Initially we thought it was a range replicator issue, but my attached example does not include any replicators. Najib says that this problem has come up (and been fixed) in the past. Looking at the ComponentRegistry source, I see that there used to be code that prevented experiments from using non-unique component names. However, this commit disabled it, with a note mentioning that it caused problems with replicated stimuli. Maybe Dave can shed some light on that.
One way or another, we need to prevent this from happening.