This model demonstrates that HDF allows consumption and production rates to vary dynamically. The port rates of the modal model is determined by the model inside the state refinement.
In this example, two increasing sequences of numbers is merged into one increasing sequence.The model uses a feedback loop to remember the previous largest number, which is from either input1 or input2. This number is fed back to input3 and used to compare with the new input from input2 or input1. Whether the consumption of token from input2 or input1 is described in the state machine. The smaller of the two is sent to the output and the larger one is updated to be the current largest number and fedback in the next iteration.