determined by casting the dice—it is not as fixed as the graphical model representation may suggest. For example, WORM 3 and WORM 4 are always those worms
that were identified as the first and second worms in the second pair of worms that is
formed for the mating process, but from one round of casting dice to the next, these
are different worms whose lengths may differ from those of their parents.
Outflows from the WORM 1, WORM 2, etc. stocks occur once all dice are cast,
i.e. when ALL DICE ¼ 21. Those worms are now ready to fight for their life and
then generate offspring. For example, the outflow from the WORM 1 stock is
WORM 1 OUT ¼ IF ALL DICE ¼ 21 THEN WORM 1 ELSE 0
ð13:4Þ
The inflows are determined on the basis of a coin toss and who of the two worms
in a pair survived the fight for life. We will discuss the inflows into WORM
1, WORM 2, etc. below, after we dealt with the processes by which we determine
the winners of the fights and update the respective other stocks in our model.
Take, for example, the second pair of worms—the pair that got determined by
tossing the third and fourth dice (Fig. 13.3). The stock LIFE 2 retains information
about the length of the winner of a fight. That stock is initially set to zero, as are
LIFE 1 and LIFE 3—the winners of the other two fights.
The inflows into the stocks LIFE 1, LIFE 2, and LIFE 3 are called FIGHT
1, FIGHT 2, and FIGHT 3, and they contain the guts of this model. Here, we check
which of the worms got matched up in the dice-casting part of this model and then
compare their lengths. For example, if the third die showed the number 2 and the
fourth die a number 3, then we know that the second and third worm were paired up,
and we will compute the maximum of the lengths of the two. But if the third die
showed a number 2 and the second a number 4, then WORM 2 and WORM 4 were
paired up and their lengths need to be compared. We repeat this process until we
exhaust all combinatorial possibilities. If none of the possibilities arose, that is a
sign that the process of pairing the worms by casting the dice has not yet been
completed. In this case the value of FLIGHT 2 is set to zero and the stock LIFE
2 remains unchanged, as shown in equation 13.5:
Fig. 13.3
13.1 Artificial Worm Model
109
that were identified as the first and second worms in the second pair of worms that is
formed for the mating process, but from one round of casting dice to the next, these
are different worms whose lengths may differ from those of their parents.
Outflows from the WORM 1, WORM 2, etc. stocks occur once all dice are cast,
i.e. when ALL DICE ¼ 21. Those worms are now ready to fight for their life and
then generate offspring. For example, the outflow from the WORM 1 stock is
WORM 1 OUT ¼ IF ALL DICE ¼ 21 THEN WORM 1 ELSE 0
ð13:4Þ
The inflows are determined on the basis of a coin toss and who of the two worms
in a pair survived the fight for life. We will discuss the inflows into WORM
1, WORM 2, etc. below, after we dealt with the processes by which we determine
the winners of the fights and update the respective other stocks in our model.
Take, for example, the second pair of worms—the pair that got determined by
tossing the third and fourth dice (Fig. 13.3). The stock LIFE 2 retains information
about the length of the winner of a fight. That stock is initially set to zero, as are
LIFE 1 and LIFE 3—the winners of the other two fights.
The inflows into the stocks LIFE 1, LIFE 2, and LIFE 3 are called FIGHT
1, FIGHT 2, and FIGHT 3, and they contain the guts of this model. Here, we check
which of the worms got matched up in the dice-casting part of this model and then
compare their lengths. For example, if the third die showed the number 2 and the
fourth die a number 3, then we know that the second and third worm were paired up,
and we will compute the maximum of the lengths of the two. But if the third die
showed a number 2 and the second a number 4, then WORM 2 and WORM 4 were
paired up and their lengths need to be compared. We repeat this process until we
exhaust all combinatorial possibilities. If none of the possibilities arose, that is a
sign that the process of pairing the worms by casting the dice has not yet been
completed. In this case the value of FLIGHT 2 is set to zero and the stock LIFE
2 remains unchanged, as shown in equation 13.5:
Fig. 13.3
13.1 Artificial Worm Model
109
