Something wrong with GABin2DecGenome!

Cristina Malheiro Silva l35572 at
Fri Sep 19 13:09:32 EDT 1997

Hello, Everybody!

I'm using GABin2DecGenome and I have this awkward problem:

  I'm trying to set my phenotype with a float (that I know is
representable by the phenotype) but the encoder converts my value to the
previous value. To be more precise, I have a mim of 1, a max of 2 and I'm
using 2 bits. Trying to set 1.666667 (1+2/3) the encoder thinks that the
best approximation is 1.33333 instead of 1.666667. On the other hand,
having a min of 2 and a max of 3, trying to set 2.666667 (2+2/3) the
encoder sets the right value: 2.666667.
  I think this is a bug because I'm setting the value that is already in
the phenotype - xpto.phenotype( i, xpto.phenotype( i )). But perhaps, the
mistake is mine.

Any clues will be of a great help.


More information about the galib mailing list