Description of protocol control¶
Here, it is described as to how to abstract your stimulus-response sequence (i.e. protocol) during acquisition.
In case of behavioral tasks, in particular, the description of protocol-control is paired with the description of Behavioral model for a subject in the tasks section.
Currently, it does not belong anywhere in the tree of entities for the sake of simplicity in notation.
Contents
Overview¶
You can choose a suitable class from the two options:
Sequencer: describe as a sequence ofStimulusBlockobjects.StateMachine: describe in terms of transitions ofMachineState.- input can be
Event, including the “timeout” event.
- input can be
Typically, if the next state of the protocol depends on some on-line contexts (e.g.
responses from the subject), then the use of StateMachine would be appropriate.
Variable parameters, such as stimulus strengths and durations, may be
represented in terms of variable.
Unitary stimulus control¶
StimulusState¶
-
class
StimulusState¶ StimulusStaterepresents a state of stimulus output during a certain period of time, and comprises the basis of protocol specification.-
mode¶ the mode of the output. May be one of the followings:
Mode Related properties Description “constant” amplitudea constant (rectangular) output “rect-wave” amplitude,frequency,offseta sine-wave output with a certain frequency “sine-wave” amplitude,frequency,offseta rectangular-wave output with a certain frequency Note
In cases where e.g. amplitude changes over time during a
StimulusBlock: the output values is supposed to be represented by anexpression.
-
amplitude¶ an optional (but recommended) property except for the “ramp” mode, representing the height of the output, in terms of the corresponding
Qualityinstance.For the wave-type modes, this indicates the peak-to-peak amplitude: the output range from
offset - amplitude/2tooffset + amplitude/2.This property will be ignored for the “ramp” mode.
-
pulse¶ an optional property for describing a pulse-like output, in terms of the corresponding
Qualityinstance.If this property is set, it is assumed that the output only lasts for
pulselong.
-
offset¶ an optional (but recommended) property for the wave-type modes, representing the offset (center) of the wave, in terms of the corresponding
Qualityinstance.This property will be ignored for the non wave-type modes.
-
frequency¶ an optional (but recommended) property for the wave-type modes, representing the frequency of the wave, in terms of the corresponding
Qualityinstance.This property will be ignored for the non wave-type modes.
-
ApparatusState¶
During manipulation of apparatus in the behavioral setup, in particular, it is easier for a human being to understand if the state of control is written not by the voltage/current outputs but by the actions executed by the apparatus.
ApparatusState is used in such cases where it is simpler to describe
the outputs in terms of apparatus actions.
-
class
ApparatusState¶ this is a sort of
Restriction, describing the controls over the apparatus of interest. The predicate part is ontologically defined throughamorphys-control.TODO
some example ApparatusState
Sequence-type stimulus description¶
Sequencer¶
-
class
Sequencer¶ Sequencerconsists of blocks ofStimulusBlock, and it is probably useful when the acquisition involves a fixed protocol of stimulus trains (possibly with variable parameters) while recording the responses from the subject.-
type¶ a required
stringproperty. It must hold the value"sequencer".
-
description¶ a required
stringproperty, for a human-readable description of what thisSequencerclass is for.
-
run-by an optional (but recommended)
Programinstance, indicating the program that runs this sequence.
-
sequence¶ a required array of
StimulusBlockdescribing the stimulus sequence.
-
StimulusBlock¶
-
class
StimulusBlock¶ StimulusBlockspecifies a certain period during the stimulus sequence where the states of output stimuli stays constant.It can hold a mapping of
StimulusGenerationinstances aschannels.-
description¶ a required
stringproperty, for a human-readable description of what takes place during thisStimulusBlock.
-
duration¶ a required property holding a temporal
Quality, representing the duration of thisStimulusBlock.
-
output¶ an optional mapping from a stimulus identifier to a corresponding
StimulusGeneration, indicating what stimulus is generated during thisStimulusBlock.
Caution
Unlike the case of
MachineState, this property is memory-less i.e. if noStimulusGenerationinstance is specified for a channel during thisStimulusBlock, this channel is assumed to output nothing (e.g. 0 V or GND) during the block, no matter how you specified during the previous block.-
StimulusGeneration¶
-
class
StimulusGeneration¶ StimulusGenerationrepresents a certain state of output from a channel.-
state¶ a required property consisting of a
StimulusStateor aApparatusState, describing the output.
-
Context-dependent stimulus sequence¶
StateMachine¶
-
class
StateMachine¶ This class is used when the output stimulus sequence depends on input signals e.g. the state of behavior of the subject.
-
type¶ a required
stringproperty. It must hold the value"state-machine".
-
description¶ a required
stringproperty, for a human-readable description of what thisStateMachineclass is for.
-
run-by an optional (but recommended)
Programinstance, indicating the program that runs this state machine.
-
initial¶ the initial, entry
Statefor this state machine when it is reset. Normally, this property holds a reference to one of the states instates.
-
states¶ a required mapping from the names to their corresponding
MachineStateinstances.
-
MachineState¶
-
class
MachineState¶ The
MachineStateclass represents the state for aStateMachine.-
description¶ a required
stringproperty, for a human-readable description of what thisMachineStateclass stands for.
-
transitions¶ a required array of
MachineStateTransitionobjects, each describing a mapping between an incoming event and its corresponding state transition during this state.
-
timeout¶ an optional temporal
Quality, describing when the timeout occurs for this state.
-
on-start an optional array of
StimulusStateorApparatusStateobjects, describing what stimulus is turned on/off upon start of this state.
-
on-end an optional array of
StimulusStateorApparatusStateobjects, describing what stimulus is turned on/off upon end of this state.
Caution
Unlike the case of
StimulusBlock,on-startandon-endhas persisting effects i.e. once you set aStimulusStateinside aMachineState, the output state will not be cleared unless you explicitly do so.-
MachineStateTransition¶
-
class
MachineStateTransition¶ MachineStateTransitionrepresents a mapping between an incoming event and its corresponding target state.-
source¶ a required property hondling a
Eventor the string"$timeout", representing the event input required for this state transition to occur.Note that the string
"$timeout"refers to the state-timeout event.
-
target¶ a required property hondling a
MachineStateor the string"$terminate", representing the next, target state of this state transition.Note that the string
"$terminate"refers to the termination of the state machine.
-