boundary problems with GARealGenome
vijay G kovvali
vkovvali at lycos.com
Wed Apr 4 11:09:24 EDT 2001
Well, in my case I have about 10 values which make my genome, and
this is what I do:
GARealAlleleSetArray MyBounds;
for(int i=0; i<10; ++i)
{
GARealAlleleSet allele(0,1e-3, GAAllele::EXCLUSIVE,
GAAllele::INCLUSIVE);
MyBounds.add(allele);
}
GARealGenome MyGenome (MyBounds, ObjectiveFunc);
GASimpleGA ga(MyGenome);
This works for me.
Vijay
--
On Tue, 03 Apr 2001 23:56:14
Jason Ku wrote:
>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
>
>
Get 250 color business cards for FREE! at Lycos Mail
http://mail.lycos.com/freemail/vistaprint_index.html
More information about the galib
mailing list