has two meanings. The first sticks to the formal description -not too common during practical applications. The second is a much slacker meaning, allowing for small deviations from the theory.
Reactive by Definition
Whether behaviors or techniques, all AI
take an input and produce an output. For reactive AI, there is a particular property about the output; given a specific input, it will always be the same.
This can be interpreted as a function in the mathematical sense (see Figure 3.1). Each configuration in the domain (input) corresponds to only one configuration in the codomain (output). Naturally, these functions can take multiple input
and return multiple outputs, but this can be
as one single
on the input and output.
Figure 3.1. A reactive mapping from the input to the output. The mapping is deterministic, because no ambiguity exists. All the inputs are assigned to one output only, but outputs may
to multiple inputs (
Often, these functions are known as
. None of the inputs correspond to multiple outputs, so there is no ambiguity. Each output is fully predictable for this reason. Such components are therefore known as a
Practically speaking, a reactive behavior always does the same thing in the same situation. A reactive component makes the same decisions, and outputs the same
for identical input conditions, which is particularly appropriate for computer
. Designers and
tend to prefer predictable results.
Reactive in Practice
In theory, a reactive component would have
no sense of
; it has no memory, however small. If it did, the mapping between domain and codomain would not be deterministic; an output that depends on a state variable
varies output based on the same input.
Strictly speaking, internal feedback is not reactive either for the same reason. If the
output is used to determine the
value, the same input could also lead to a different output. Both these examples reflect
Using a small trick, it's also possible to consider these techniques as reactive (see Figure 3.2). If we consider the internal state, or the feedback connection, as another input, the mapping is once again reactive! There is no longer any ambiguity when the internal
that would make the component nondeterministic are instead exposed as inputs.
Figure 3.2. A nondeterministic component can be interpreted as reactive if the internal state values are
as an input. The state also may be updated reactively.
So in practice, components with a small sense of state or feedback connections are considered as reactive. Even when a small random factor is used to perform the mapping, it can be considered as reactive, too; the random number could be interpreted as an additional input.