The following example shows the structure and definition of a reactor behaviour, exemplified
through two reactor behaviours called Add and WindPower.
The Main actor, when run, will visualize the DAG of the Add reactor behaviour.
The Add reactor behaviour has 2 sources called a and b, and it
has one sink (denoted by out) which is bound to the result of (+ a b).
A more complex example is given by the WindPower reactor behaviour, which implements
a mathematical formula for computing the
theoretical wind power
of a wind turbine (i.e. the theoretical upper limit for the power generated from wind).
Try it out! Replace the expression
(to-graphviz Add) with (to-graphviz WindPower) and re-run the program
to visualize the DAG that corresponds with the WindPower reactor behaviour.