How is the number of totalBits, required, computed?

Viewed 172

Using GeneticSharp, I started working on some optimizations in order to lower the computational power, required. For that purpose I try to lower the totalBits but it does not seem apparent how the required number bits is computed given

  • precision of input variable and
  • possible variable range.

Can someone please comment on how the total number bits, required, are computed. Ideally I want to set the totalBits parameter as function of chosen precision and value range.

Thanks

1 Answers

The four arguments of FloatingPointChromosome's constructor are:

  • The minimum values of numbers inside the chromosome.
  • The maximum values of numbers inside the chromosome. It means the maximum number that a chromosome can represent (solution).
  • The total bits used to represent each number. For example, if your maximum value is 998, so 10 bits is what you need.

GeneticSharp will warn you if you try to use a total bits that cannot hold a number inside your floating point chromosome.

  • The number of fraction (scale or decimal) part of the number.

More info: https://github.com/giacomelli/GeneticSharp/issues/42

Related