Skip to content

Commit 7a49752

Browse files
committed
Add publishsubject in hobgoblin event description
1 parent 6822fc1 commit 7a49752

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tutorials/hobgoblin-reaction.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Next, we will set up our `Hobgoblin`.
3737
- Insert a [`Device`] operator and set the `PortName` property.
3838
- Insert a [`DeviceDataWriter`] and set the `Path` property. Connecting it directly to the device ensures thats all events are logged.
3939
- During this tutorial we will need to have the ability to send/receive commands from distinct places in the workflow. To allow this kind of "many-to-one"/"one-to-many" communication, we will:
40-
- Insert a [`PublishSubject`] operator and name it `Hobgoblin Events`.
40+
- Insert a [`PublishSubject`] operator and name it `Hobgoblin Events`. This operator broadcasts events from the `Hobgoblin`, which you can receive at multiple points in the workflow using a [SubscribeSubject].
4141
- Right-click the [`Device`] operator, select `Create Source (Bonsai.Harp.HarpMessage)` > [`BehaviorSubject`]. Name the generated ``BehaviourSubject`1`` operator `Hobgoblin Commands`. Connect it as input to the [`Device`] operator.
4242

4343
>[!NOTE]
@@ -124,12 +124,13 @@ pd.Series(valid_response_times).plot(kind="box", ylim=(0,1))
124124

125125
### Exercise 4: Driving state transitions with external behaviour events
126126

127-
In order to translate our simple reaction time task in the previous exercises into a proper state machine, we need to split up the fixed interval stimulus into different states. It is often convenient to consider the inter-trial interval period as the initial state, followed by stimulus presentation. We will begin with the workflow portion from the end of [Exercise 1](#exercise-1-generating-a-fixed-interval-stimulus).
127+
In order to translate our simple reaction time task in the previous exercises into a proper state machine, we need to split up the fixed interval stimulus into different states. It is often convenient to consider the inter-trial interval period as the initial state, followed by stimulus presentation.
128128

129129
:::workflow
130130
![Stimulus presentation](../workflows/hobgoblin-reactiontime-stimulus-response.bonsai)
131131
:::
132132

133+
- Copy the workflows from [Exercise 1](#exercise-1-generating-a-fixed-interval-stimulus).
133134
- Select the [`Timer`] operator and set its `DueTime` property to 3 second.
134135
- Click and drag to select both the [`CreateMessage`] ([`DigitalOutputSetPayload`]) and `Hobgoblin Commands` operators.
135136
- Right-click, select `Group` > `Sink (Reactive)`. Set the `Name` property to `StimOn`.
@@ -180,6 +181,7 @@ In order to translate our simple reaction time task in the previous exercises in
180181
[`MulticastSubject`]: xref:Bonsai.Expressions.MulticastSubject
181182
[`Parse`]: xref:Harp.Hobgoblin.Parse
182183
[`PublishSubject`]: xref:Bonsai.Reactive.PublishSubject
184+
[`SubscribeSubject`]: xref:Bonsai.Reactive.SubscribeSubject
183185
[`Repeat`]: xref:Bonsai.Reactive.Repeat
184186
[`SelectMany`]: xref:Bonsai.Reactive.SelectMany
185187
[`Sink`]: xref:Bonsai.Reactive.Sink

0 commit comments

Comments
 (0)