ARTIFICIAL LIFE CONTEST
A Tool for Informal Teaching of Artificial Intelligence
Diego Milone
CONICET, sinc(i)-FICH-UNL, Ciudad Universitaria, 3000, Santa Fe, Argentina
Georgina Stegmayer
CONICET, CIDISI-FRSF-UTN, Lavaise 610, 3000, Santa Fe, Argentina
Daniel Beber
FI-UNER, Ruta 11 Km. 10, Oro Verde, Entre Rios, Argentina
Keywords:
Informal teaching, Students motivation, Artificial life, Game-based learning.
Abstract:
This work reports an experience in using an Artificial Life competitive game that simulates an artificial life
environment for unstructured and informal Artificial Intelligence (AI) teaching to students from computer sci-
ence engineering careers. The game consists of a simulated Petri dish where two colonies of microorganisms
–software agents– must struggle to survive. To achieve this goal, the participants must implement surviving
strategies for their agents, which include fighting strategies and basic reproduction rules to prevail over all the
artificial environment. The technical bases of the contest as well as a description of the artificial life model are
explained in detail. The pedagogical experience acquired in the contest development is discussed, as well as
the resulting learning experience, which generated students enthusiasm and has helped them to develop mental
models of possible AI algorithms.
1 INTRODUCTION
Artificial Life (AL) has a special attractive to com-
puter science and engineering students. The promo-
tion and foster of creativity in problem solving and
the stimulation of spontaneous finding of solutions
to previously unknown problems are important chal-
lenges while teaching. Given the impact of modern
computer games on teenagers and young students, the
time they spend on those games and the skills they de-
velop for abstraction and generation of creative solu-
tions, a game-like competition can encourage students
to individual learning and the development of these
skills by themselves. Thus, computer games may pro-
vide a great source of motivation when teaching artifi-
cial intelligence (AI) and other topics in computer sci-
ence. Furthermore, an informal learning methodology
gives the possibility to freely act in unknown situa-
tions and self learning without any obligations (based
on the free choice of interests), which promotes the
development of responsibility and self management.
The initial model, previous to the contest, was mo-
tivated by a simple and direct connection between
a biological cell and a software object. After that,
a model to reproduce the output of the well-known
prey-predator system modeled by the Lotka-Volterra
equations (Lotka, 1925)(Volterra, 1926) was devel-
oped. Some years later, based on this population
model two new simulations for teaching topics related
with object oriented programming, AI and biological
models have been created.
The first model was a homework requiring the
simulation of microorganisms having an internal arti-
ficial neural network model that sensed the neighbor-
hood for nutrients and decided the next movement.
In this simulation, a sower planted traces of nutri-
ents and the microorganisms evolutionarily learnt the
weights of the neural networks to follow these traces.
After several iterations, all dead microorganisms are
replaced by the offspring, obtained by crossover and
mutations of the alive ones.
The second model was the Artificial Life Con-
test
1
, where students should develop their own strate-
gies of survival, with their own ideas about microor-
1
http://alifecontest.sourceforge.net/
119
Milone D., Stegmayer G. and Beber D. (2009).
ARTIFICIAL LIFE CONTEST - A Tool for Informal Teaching of Artificial Intelligence.
In Proceedings of the First International Conference on Computer Supported Education, pages 119-124
DOI: 10.5220/0001979001190124
Copyright
c
SciTePress
ganisms modelling. The created microorganisms
must compete for survival in a common environment
(with reduced nutrients availability). In this competi-
tion, they have to design and implement an artificial
life form (a software agent), applying their AI and
programming knowledge in a different, perhaps more
attractive way than in a structured class. The simula-
tion environment and its interactions with the agents
are provided, therefore the students may only focus
on defining the agent strategies for survival and how
it decides what action to execute in each interaction
with the environment.
For the contest development, object-oriented pro-
gramming in C++ language is used (Milone et al.,
2003). Students can access the environment source
code (although they cannot modify it) and several ex-
amples of simple agents. Tournaments are organized
periodically using the original environment (provided
by the organizers) and the source code of the students
agents.
The organization of this paper is the following:
Section 2 presents the environment and artificial life
simulation of the contest. Section 3 explains the soft-
ware agents that must survive and interact in the arti-
ficial environment. Section 4 presents some details
regarding winner definition and organization of the
tournaments. Finally, the conclusions and future work
are presented in Section 5.
2 MOTIVATION
There is a historically close relationship between Ar-
tificial Intelligence (AI) and games, such as chess,
backgammon or poker, which have provided chal-
lenge problems for AI research. The use of AI
in games presents an opportunity for AI educators
to motivate students to learn about AI technologies
through interactive learning and simulations. Playing
any game well requires a player to choose a course of
action taking into account the environment (the game
situation) and the likely actions of other competitors
or enemies (oppponents), so as to maximise opportu-
nities for achieving goals (winning the game). Com-
puter games as educational tools also have an intrinsic
motivational factor that encourages curiosity and cre-
ates the impression that the students are in control of
their own learning (Hingston et al., 2006).
There have been reported in literature several ex-
amples of AI teaching with games. In (Chiang, 2007)
the traditional Pacman game has been adapted to pro-
vide student learning motivation for case-based rea-
soning AI technique learning. In (Kim, 2006) a vir-
tual agent platform is presented for teaching agent
systems design through a tournament game. This
work aims at teaching agents in the first year of a
computer science career and, differently from our un-
structured learning approach, the authors use this tool
as part of a formal course and for students evaluation.
In fact, all of these proposals use the game for teach-
ing inside a formal class environment.
Our approach, instead, aims at providing an in-
formal learning methodology to senior students. This
methodology has provided them an interesting oppor-
tunity to exercise the use of their imagination to solve
previously unknown problems through self-learning,
without a formal obligation, which also promotes self
management. In general, the students that participate
in the contest could organize their duties and man-
age their available time, exercising responsibility by
themselves, without it being imposed from external
pressions nor formal structures. In contrast to the
classic approach to teaching AI with an objectivist ap-
proach, and similarly to (Pantic et al., 2005), we are
focused in providing a simulation environment and
a problem that needs to be solved through some AI
technique. Like stated by this author, following a con-
structivist approach, an authentic real-world environ-
ment is provided in which students apply and test their
knowledge and skills.
According to a recent analysis of game-based
teaching and training systems (Martens Alke and
Steffen, 2008) games have a high motivational char-
acter, often missing in traditional computer-based
training systems. According to this analysis, this
work, regarding learning theory, is an example of
training with a microworld, a small world with a
closed environment which functions based on its own
artificial rules.
3 ARTIFICIAL LIFE CONTEST:
THE ENVIRONMENT
The Artificial Life Contest is a competition of soft-
ware agents that have to be designed with the objec-
tive of surviving in an artificial environment. The
agents must move in order to get food, they can re-
produce themselves, they can decide fighting against
another species or, if they have not enough energy, to
run away to avoid dying in a battle.
In the Artificial Life Contest, the environment
represents a Petri dish which contains Agar (with
nutrients) and two different microorganism (MOs)
colonies, which must fight for survival inside this en-
vironment (see Figure 1). The competition model in-
cludes these four classes: Petri, Agar, Colony and
Microorganism, shown in Figure 2. The figure also
CSEDU 2009 - International Conference on Computer Supported Education
120
shows the classes MO 1 and MO 2, which are two
different microorganisms developed by competitors,
from which colonies will be built. The energy and
food for the MOs are managed by the Petri and Agar
classes, which will be explained in detail in the fol-
lowing subsections.
Figure 1: The “real” life environment, then simulated in the
artificial life contest.
class
Petri
- col oni es: Colony
- dx: int
- dy: int
- maxX: int
- maxY: int
- radi us: int
+ createMO(pos, i d, ener) : void
+ moveMO(old, new) : void
+ moveColonies() : void
+ mitosis(pos) : void
Colony
- myMOs: Microorganism
+ l i ve(x, y) : void
+ m ove(old, new) : voi d
+ kill(x, y) : voi d
Microorganism
# id: i nt
# pos: Posi tion
# ene: float
+ author() : string
+ name() : string
+ mitosis(dup) : void
+ move(mov) : void
Agar
- di stN: int
- mxX: int
- mxY: int
- rx: int
- ry: int
- cel l s: Cell
+ m axX() : i nt
+ m axY() : i nt
+ distNutri() : int
+ energy(x, y) : fl oat
+ nutrients(x, y) : fl oat
+ ocupation(x, y) : voi d
Cell
MO_1
# id: int
# pos: Posi tion
# ene: float
+ author() : string
+ name() : string
+ mitosis(dup) : void
+ move(mov) : void
MO_2
# id: i nt
# pos: Posi tion
# en: fl oat
+ author() : string
+ name() : string
+ mitosis(dup) : void
+ move(mov) : void
Figure 2: Artificial Life Contest model.
3.1 The Petri Class
The MOs life takes place at the container class Petri,
where the rules of life are applied. This set of rules
verify the validity of the movements required by ev-
ery MO. The MOs are randomly ordered and then,
from each of them, an action is requested and whether
they want to reproduce themselves or not. After each
agent action, the Agar is updated. The MOs can “see”
during all the simulation an updated version of the en-
vironment, which is totally accessible for them.
According to the rules of the artificial life simula-
tion, the MOs may feed, fight or procreate. The main
rules are the following:
Initially, 50 MOs of each colony are created, with
1000 energy units each.
Figure 3: Artificial Life Contest: graphical user interface.
The colonies are on the right window, inside the Petri dish,
competing on a nutrient distribution given by two bidimen-
sional Gaussians. The window at the bottom indicates the
total energy of each colony.
The MOs are all randomly positioned inside the
Petri dish.
Every MO looses 5 energy units per time unit due
to aging, and it wastes 10 energy units for each
movement.
Every time step, all MOs increase their energy by
feeding with 1% of the nutrients existing in their
current position.
The initial nutrient distribution and the way it
could vary during the competition is chosen by
Petri. There are actually six food distributions and
there is battle for each one of them. For exam-
ple, a bidimensional gaussian mixture distribution
could be selected
G(x, y) =
i
N
i
e
xx
i
i
2
yy
i
i
2
,
where N
i
is the maximum for each gaussian com-
ponent, (x
i
, y
i
) are positions and
i
is related with
each dispersion. This distribution can be seen in
Figure 3 together with the graphical user interface
of the competition. For this particular distribution
case, a colony having a strategy to detect and re-
main in one of the energy peaks would certainly
obtain an important vantage over the other colony.
With respect to allowed agent actions, if a MO
wants to move to a specific position, three possi-
ble situations are possible:
1. The position is empty and it is inside the Petri
dish: Petri allows it and moves the MO.
2. The position is occupied by a MO belonging
to the opposite colony: then the MOs fight and
ARTIFICIAL LIFE CONTEST - A Tool for Informal Teaching of Artificial Intelligence
121
the one whose energy level is higher survives.
The winner does not simply kills the looser, but
an amount of energy is taken which is equal to
the difference of energy between them. If the
looser remains with an energy level minor to
zero, it then dies. After the fight, both MOs
remain in the same previous position and the
winner increments its energy in a 7.5% level re-
garding the looser.
3. Reproduction may be requested, by mitosis (a
process of cell division, which results in the
production of two children from a single par-
ent cell). It could take place if there is a free
adjacent place to put the new MO, and the fa-
ther and the son remain with an energy equal to
the 49% of the father energy.
3.2 The Agar Class
The Agar class acts like a proxy between the agents
and the artificial environment, providing the MOs,
when requested, the perceptions they can use for in-
ternal decision making. It models the food where the
MOs may feed from and, this way, increase their en-
ergy. Agar knows the exact position and energy of
every MO in the Petri dish, and this information is
constantly updated.
The MOs can also ask the Agar about any infor-
mation they may need, that is, the nutrient distribu-
tion, the amount of nutrients on a specific position
(x, y) or the energy and species of a MO located at
this point.
A very simple example of such kind of requests
may be the following:
if (id <> agar.ocupation(myX+1,myY))
{ // to do something with a competitor
// existing at the right of my position
}
if (ene > agar.energy(myX+1,myY))
{ // to take action according to energy
// levels
}
where id and ene are the identifier and the energy of
the MO, respectively.
4 ARTIFICIAL LIFE CONTEST:
THE SOFTWARE AGENTS
In this artificial life model, the software agents rep-
resent microorganisms (MOs) that must live inside a
Petri dish, feeding, reproducing themselves or fight-
ing for survival. Each contestant must develop the
survival algorithm of their MOs that will compete
with other colonies for the exclusivity of the envi-
ronment. The contest provides two basic classes that
model the MOs and their colonies: the Colony class
and the Microorganism class.
The Colony class contains a group of MOs that
belong to the same species (in this case, same par-
ticipant). Its main responsibility is moving the MOs
when Petri requires it. The Microorganism class de-
fines the MOs basic behavior. Starting from this class,
the students must develop their MOs by inheritance,
with their own survival tactics.
The possible actions that a MO may perform to
achieve its survival goal are: eating the food, re-
producing itself though mitosis and fighting against
an enemy colony. Each MO must provide a virtual
method that returns the position where the MO wants
to move to, and consequently making a choice about
feeding and attacking. In addition, MOs must pro-
vide another virtual method to communicate their de-
cisions about mitosis.
Figure 4 shows a very simple example of a com-
petitor MO, named SearchN, because its strategy con-
sists of simply looking for the nearest position with
higher food level. Through agar.nutrients(x,y),
a perception regarding the amount of nutrients exist-
ing in any position is requested. In the example, a
mitosis as simple as: “if the MO has more than 5000
units of energy then divide” is implemented. This MO
is very simple because it only considers the positions
where there are more nutrients, and does not takes
into account enemies positions, nor those of its own
colony.
More developed algorithms may make better use
of the available information to achieve more effective
strategies, such as making mitosis according to the
amount of available nutrients, attacking the contrary
MOs, seeking and remaining in regions having more
food, among others.
5 ARTIFICIAL LIFE CONTEST:
DISCUSSION
The idea of converting the original artificial life model
into a contest was a great motivation and a real chal-
lenge for the students. They arrive to the competition
as contestants, that is to say, developers of microor-
ganisms, as well as developers of the environment.
Each year new contestants arrive and only a few of
them participate more than 2 consecutive years.
About each 2 weeks we organize the “tourna-
ments” where all the participants bring their new re-
leases of microorganisms and “fight” in six “battles”
CSEDU 2009 - International Conference on Computer Supported Education
122
//--------------------------------------------------------
class SearchN: public Microorganism { public:
virtual string name();
virtual string author();
virtual void move(Movement & mov);
virtual void mitosis(bool & dup);
};
//--------------------------------------------------------
string SearchN::name() { return("Search for Nutrients"); }
//--------------------------------------------------------
string SearchN::author() { return("DGD"); }
//--------------------------------------------------------
void SearchN::move(Movement & mov)
{ // the MO will move to any
// of the 8 neighborhood positions having more food
int x_rel, y_rel; // relative testing position
int x_max, y_max; // relative position having more
// nutrients
x_max=0;
y_max=0;
for (x_rel=-1; x_rel<2; x_rel++)
for (y_rel=-1; y_rel<2; y_rel++)
if (agar.nutrients(pos.x+x_rel,pos.y+y_rel) >
agar.nutrients(pos.x+x_max,pos.y+y_max))
{ x_max=x_rel;
y_max=y_rel;
};
mov.dx=x_max;
mov.dy=y_max;
}
// ------------------------------------------------------
void SearchN::mitosis(bool & dup)
{ if (ene>5000) dup=true;
else dup=false;
}
// ------------------------------------------------------
Figure 4: Example of a simple MO-agent code.
for the survival in our common environment. Students
may form groups to design a MO-agent. A tourna-
ment begins and ends with only one source code per
group, but it can be improved during the weeks be-
tween two tournaments.
Each battle is performed on six different food dis-
tributions (shown in Figure 5), such as: an inclinated
plane, a vertical bar or uniform distribution, a ring, a
lattice, a bimodal gaussian and a five steps stair distri-
bution. The colony that dominates the other ones and
accumulates the major living energy is the winner of
the tournament and wins 3 points for the global rank-
ing; the second one obtains 2 points and 1 point is for
the third one.
Open source is a very important philosophical
framework behind all development about computer
science, both for teaching as for academic research
(Sonnenburg et al., 2007). Thus, we promote these
ideas not only by publishing the source code of the
Figure 5: The six nutrient distributions used in the Artificial
Life Contest battles. From top to bottom: inclinated plane,
vertical bar or uniform distribution, ring, lattice, bimodal
gaussian and five steps stair.
environment but also by uploading the source code of
the winner of each tournament (with public access for
all the other participants). At the end of the cham-
pionship, the participant with more points is awarded
with some gift from the organizing Universities and
all the participants explain their strategies to the oth-
ers in a common presentation.
To offer an environment as much unstructured or
informal as possible, we have minimized the rules of
the competition. If there is any situation outside of
what would be expected, the same participants are the
ones who discuss and decide, guided by the teach-
ers, about how to solve the problem. For example,
in principle it would not be allowed something like
ARTIFICIAL LIFE CONTEST - A Tool for Informal Teaching of Artificial Intelligence
123
“hacking” the Petri class. However, if the idea is orig-
inal enough that the remaining participants may learn
from this code and accept it, the method can become
a valid strategy for future tournaments.
Another example of an unexpected situation was
a winner that had encrypted all of his source code,
changing identifiers by sequences of characters.
This way, when his code was made public and avail-
able to all other contestants, nobody could know his
strategies. This situation was submitted to the opin-
ion of all other participants and it was decided that,
if the competitor wanted to continue participating,
he should provide a completely documented source
code.
6 CONCLUSIONS
This paper has described an Artificial Life competi-
tion based on a computer program that simulates an
artificial life environment: a Petri dish where two
colonies of microorganisms must survive. The con-
test model has been explained and exemplified, and
the competition rules have been presented as well.
This didactic tool has generated great enthusiasm
regarding programming and AI techniques among
students. We noted important improvements along
the competitions in many different aspects: abstrac-
tion, codification skills, team work, dedication, in-
novation, creativity when designing and implement-
ing software agents; something that does not gener-
ally happen when teaching with traditional structured
methods.
The publication of the winners source code was a
big motivation for improving other competitors codes,
learning by themselves from the winner strategies.
Some people were more motivated to improve the ar-
tificial simulation environment while others preferred
to focus on more competitive algorithms. Many of
them tried to applied advanced AI techniques, such as
artificial neural networks or genetic algorithms, read-
ing and asking about these subjects to teachers, but
without a formal structure.
We consider that this kind of informal learning
methodology has provided an interesting opportunity
to students to exercise the use of their imagination
to solve previously unknown problems through self-
learning, without a formal obligation, which also pro-
moted self management. In general, the students that
participate in the contest could organize their duties
and manage their available time, exercising responsi-
bility by themselves, without it being imposed from
external pressions nor formal structures.
Among future work we can cite the development
of a new model design, that could provide higher flex-
ibility (through plugins) to generate different kinds of
competitions, for example distinguishing between be-
ginners and advanced students. Also, we are working
to provide a new version of the contest in Java, which
could simplify the multi-platform programming and
would allow to also incorporate pre-compiled C++
MOs, with a more compact and integrated graphical
interface.
REFERENCES
Chiang, A. (2007). Motivate ai class with interactive com-
puter game. Proc. of IEEE Int. Workshop on Digital
Game and Intelligent Toy Enhanced Learning, 1(1).
Hingston, P., Combes, B., and Masek, M. (2006). Teaching
an undergraduate ai course with games and simula-
tion. LNCS, 3942(1):494–506.
Kim, I.-C. (2006). 3d interactive computer games as a ped-
agogical tool. LNCS, 4270(1):536–544.
Lotka, A. J. (1925). Elements of physical biology. Williams
& Wilkins Co., Baltimore.
Martens Alke, D. H. and Steffen, M. (2008). Transactions
on Edutainment I - Game-Based Learning with Com-
puters Learning, Simulations, and Games. Springer.
Milone, D., Beber, D., and Biurrun, J. (2003). Artificial
Life Contests: Encouraging Creativity. In Doblar
´
e,
M., Cerrolaza, M., and Rodr
´
ıguez, H., editors, Pro-
ceedings of the International Congress on Computa-
tional Bioengineering, Zaragoza, Espa
˜
na.
Pantic, M., Zwitserloot, R., and Grootjans, R. J. (2005).
Teaching introductory artificial intelligence using a
simple agent framework. IEEE Transactions on Ed-
ucation, 48(3):382–390.
Sonnenburg, S., Braun, M. L., Ong, C. S., Bengio, S., Bot-
tou, L., Holmes, G., LeCun, Y., Mller, K.-R., Pereira,
F., Rasmussen, C. E., Rtsch, G., Schlkopf, B., Smola,
A., Vincent, P., Weston, J., and Williamson, R. (2007).
The need for open source software in machine learn-
ing. J. Mach. Learn. Res., 8:2443–2466.
Volterra, V. (1926). Variazioni e fluttuazioni del numero
d’individui in specie animali conviventi. Mem. R. Ac-
cad. Naz. dei Lincei. Ser. VI, 2.
CSEDU 2009 - International Conference on Computer Supported Education
124