164 Agent-Based Modeling and Simulation with Swarm
6.6.1 Evolution of predatory behaviors using genetic search
This section introduces the fundamental idea of BUGS. We can exper-
imentally verify the evolution of bugs w hich possess “predatory b e haviors,”
i.e., the evolution of bugs that lear n to hunt bacteria. The o riginal motivation
for these experiments was derived from [29]. Bugs lear n to move to those re-
gions in the search space where the bacterial concentration is highest. Since
the bug concentration is set up to be proportional to the local value of the
function to be maximized in the search space, the “stabilized” bug concen-
trations are proportional to these sea rch space values. Hence the bugs learn
(GA style) to be hill climbers. A Swarm-based BUGS simulator is available
for readers’ self-study. The details are given in Section 6.7.
6.6.1.1 Bugs hunt bacteria
Figure 6.24 (a) illustrates the world in which bugs (large dots) live (a 512 ×
512 cellular grid). They feed on bacteria (small dots) which are continually
being deposited. The normal bacterial deposition rate is roughly 0.5 bacter ium
per (GA) generation over the whole grid. Each bug has its internal energy
source. The maximum energy supply of a bug is set at 1500 units. When a bug’s
energy supply is exhausted, the bug dies and disappears. Each bacterium eaten
provides a bug with 40 units of energy, which is enough to make 40 moves,
where a move is defined to be one of six possible directional displacements of
the bug, as shown in Fig. 6.25.
A bug’s motion is determined by coded instructions on its gene code.
The six directions a bug can move are labeled F, R, HR, RV, HL, and L for
Forward, Right, Hard Right, Reverse, Hard Left, and Left, respe c tively. The
GA chromosome for mat for these bugs is an intege r vector of size six where
the elements of the vector correspond to the directions in the following order:
(F,R,HR,RV,HL,L), e.g., (2,1,1,1,3 ,2) (as shown in the window in Fig. 6.24(a)).
When a bug is to make a move , it will move in the direction d
i
(e.g., d
3
= HR)
with a probability p(d
i
), which is determined by the following formula:
p(d
i
) =
e
a
i
P
6
j=1
e
a
j
(6.20)
where a
i
is the ith component value of the chromosome vecto r (e.g., a
5
= 3
above). O nce a move is made, a new directional orientation s hould be deter-
mined. Figure 6.25 shows the new F
next
directions, e.g., if the move is R, the
new forward direction will be to the right (i.e., east). For instance, a bug with
a gene code of (1,9,1,1,1,1) tur ns frequently in direction R so that it is highly
likely to move in a circle.
After 800 moves (i.e., when it attains an “age” of 800), the bug is said
to be “ma ture” and is ready to reproduce if it is “strong” (i.e., its energy is
greater than a threshold value of 1000 energy units). There are two types of
reproduction, asexual and sexual (see Fig. 6.26). With asexual re production,
a strong mature bug disappears and is replaced by two new bugs (in the same