14.1 Combining two applications into one
For this recipe, we’ll look at two scripts that need to be combined. One script emits data from a Markov chain process, and the second script summarizes those results.
What’s important here is the Markov chain application is (intentionally) a bit mysterious. For the purposes of several recipes, we’ll treat this as opaque software, possibly written in another language.
(The GitHub repository for this book has the Markov chain written in Pascal to be reasonably opaque.)
For reference, here’s a depiction of the Markov chain state changes:
Figure 14.1: Markov chain states
The Start state will either succeed, fail, or generate a ”point” value. There are a number of values, each with distinct probabilities that sum to P = 0.667. The GrowUntil state generates values that may match the point, not match the point, or indicate failure...