boundary problems with GARealGenome

Jason Ku tsesunku at Princeton.EDU
Tue Apr 3 23:56:14 EDT 2001


Sorry, my mistake on the negative numbers.  But now I am trying to use a
real number genome on (0,0.001] but I keep on getting genome values of
0.  Has anyone else experienced this problem, and if so, how did you get
around it?  Thanks.

This is my code:
GARealAlleleSet allele(0,1e-3, GAAllele::EXCLUSIVE,
GAAllele::INCLUSIVE);
GARealGenome genome(length, allele, objective);
GASimpleGA ga(genome);


Jason

>I'm having problems controlling the boundary values of real genomes:
>
>GARealAlleleSet allele(0,1e-3); /* i want each gene to have value
between
>0 and 0.001 */
>GARealGenome genome(length, allele, objective);
>GASimpleGA ga(genome);
>
>In my objective function, I'm printing out the value of each gene and I
am
>getting negative numbers.  Am I creating the genome correctly above?
If
>not, what is the proper way to create a genome where every gene can
have a
>value between 0 and 0.001?
>
>Thanks.
>
>Jason





More information about the galib mailing list