Tuesday, 6 May 2008

Bug in TinyGP Java Code

Sander Land found a bug in the constructor "tiny_gp" of the TinyGP system described in appendix B: the "x" array is initialized (lines 345-346) after the population is (line 344), causing invalid fitness evaluations during the initialization of the population, thereby wasting the first generation. The mistakes has been fixed in the code available here. Many thanks Sander (and apologies to all users).

2 comments:

  1. i've tried the new code. and i'm having problem with GENERATIONS variable.

    i can't change the value of the variable easily, while in the old code it can be done easily.

    for example, i want to use 200 generations (so i change the value of variable to 200, from default GENERATIONS = 100), and then the result shows that there's only 100 generations (default value)

    ReplyDelete
  2. Hi Sanny, I'm not sure I understand your point. As explained in the original post, the bug fix involved simply moving one line down a couple of lines. The GENERATIONS variable wasn't affected. So, I suspect you did not recompile the java code after you made your change. I hope this helps. -- Riccardo

    ReplyDelete