swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

population increasing in gademo (Breeder 2.1)?


From: Norberto Eiji Nawa
Subject: population increasing in gademo (Breeder 2.1)?
Date: Mon, 08 May 2000 15:35:20 +0900

Hello:

The number of chromosomes in gademo (the demo that comes with Breeder
2.1, the genetic algorithm library) increases in two individuals at
every generation in my Linux box (that is, if I understood correctly
how the demo works).

The population growth is due to "leaks" in the control variables of a
series of _for_ loops in method newGeneration (PopSwarm.m). The loops
look all like this
 
for ( i = 0; i < popSize*mating; i ++ ) {

where i and popSize (100, in gademo) are _unsigned_ and mating (0.1)
is a _float_. In gademo, the loop above ends when i == 11, though the
expected behavior would be to finish when i == 10.

New individuals are generated in newGeneration by means of these _for_ 
loops, so for every additional iteration, an additional new member is
added to the population. In long runs, the performance degradation is
visible.

Adding a cast like this

for ( i = 0; i < (int)(popSize*mating); i ++ ) {

apparently solves the problem.

Now, I am wary to say that this is a Breeder's bug (tried to inquire
the author of Breeder but got no answer so far). Could it be the
compiler? I am using gcc-2.95.1/Linux 2.2.9

Thanks a lot in advance,

Eiji

--
Norberto EIJI Nawa 
ATR International - Information Sciences Division
2-2-2 Hikari-dai, Seika-cho, Soraku-gun, Kyoto 619-0288
JAPAN
web: http://www.hip.atr.co.jp/~xnawa/
phone: +81 774-95-2660  fax: +81 774-95-1008 

& 

Dept. of Systems Science - Graduate School of Informatics
Kyoto University
JAPAN
email: address@hidden


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]