In this case recursion is also used to generate the bulks of messages, but it
has an fixed limit defined by the positive integer constant , which along
with the constant probability
, form the set of parameters for the binomial
distribution.
As figure shows, whenever the Binomial_Bulk
object receives a message, it can be forwarded to the server if the action with
probability
is executed, and then, in either one of the action codes, it
will check whether the state variable
is greater than zero. In the
positive case, it will decrease
by one and send another message to
itself. Otherwise it will reset
to
and finish the recursion.
It is clear from the previous explanation and from the code, that the recursion
in the Binomial_Bulk object takes place at most consecutive times. It can
happen less than
times if the process reaches a state where the queue is
full.
The important thing to notice in this example is that, in order to generate a fixed size recursion, we need to add a new state variable to the model for keeping track of how deep the recursion is so far.
In the previous example, the model did not require this, because it refered to a geometric distribution, which has the memoryless property. This way, each step of the recursion can be determined without the use of any memory (state variables).
Since the geometric distribution is also the only discrete memoryless distribution, any other kind of batch size distribution (including the binomial case) will have to add new state variables to allow Tangram-II to generate the model's state space and transition rates.
At first, one might think this is bad, since adding a new state variable might increase the state space, but it turns out this does not happen. To explain why, we need to consider an example of what happens during the chain generation procedure for this model.
Suppose the model is set initially to the state where the queue is empty, and
let our state tuple be defined as
.
Since the
object requires that
be initialized to
,
and having
in this example, our initial state will be
. We further
assume that the maximum number of customers in the queueing system is 10.
When an arrival event happens, while the model is in the initial state, the
sequence of execution in the model can be illustrated by the diagram shown in
figure .
Notice that the recursion ends when reaches zero, being reset to
.
All the message exchanging happens in zero time, with the generation of several
intermediate states, in which the value of
can be 0, 1 and 2, but after
the recursion the model always ends up with
. Because of this, all the
intermediate states do not show up in the final state space (as shown in figure
), and so are called .
After generating the state space for this model, all the states will have
. The main lesson to learn here is that even though the
variable is not necessary to describe the state space (since it equals the
constant
in all states), it is essential to the state generation procedure.