[galib] GAIntGenome

Fábio Roberto Teodoro fr.teodoro at gmail.com
Fri Sep 12 10:31:17 EDT 2008


I'm using GABin2DecGenome to do this.
It it converts binary representation to float, what allow for decimal
digits. Bellow I paste the function I use to know how many bits I need
for a given interval of decimal numberss.

Hope this help.

        int bitsNeeded(double min, double max, int decDigits) const
        {
                int intervals = int((max - min) * pow(10, decDigits)) +
1;

                // 2^n = intervals, quanto é n?
                // log2(intervals)
                int nBits = int(log2(intervals)) + 1;
                return nBits;
        }

Sex, 2008-09-12 às 14:57 +0100, Simao Soares escreveu:
> Hello,
> 
> I'm new to galib sorry for these questions but a little help will be
> very important.
> I'm using galib with visual studio 2008 (vc9). My task with the galib
> is very simple but i'm having some problems to do that.
> I want my genome to be a integer value (the value must be in a defined
> range), I already defined a function that gives a fitness to the
> integer.
> 
> What is the best genome from the package to this particular problem?
> 
> In vc I'm having some problems giving the objective function to the
> genome " GA2DBinaryStringGenome genome(width, height,Objective);"
> ---> >error C3867: 'Objective': function call missing argument list;
> use '&Objective' to create a pointer to member.
> 
> 
> Thanks in advance,
> 
> -- 
> Simão Soares
> 
> 
> _______________________________________________
> galib mailing list
> galib at mit.edu
> http://mailman.mit.edu/mailman/listinfo/galib




More information about the galib mailing list