Please Help Me!

Rishi Roy rishi_roy at hotmail.com
Tue Jan 30 19:26:43 EST 2001


I'm trying to use a 2DArrayAlleleGenome and use and GAAlleleSetArray 
together and I CANNOT do it.  What I want is 2 lists of 256 integer elements 
each.  For all of the even elements in both lists, I want the range of them 
to be from 0-255.  For all of the even elements I want to range to be from 
0-16.  To test this I used a optimize function that maximized the total 
array, ie the measure of fitness is the sum of all of the elements in the 
array (I normalize each element to take into accont the fact that one set 
maxes at 16 and the other at 256).  My problem is that instead of getting 
two lists that go 15 255 15 255 15 255...  I either get 15 15 15 15... or 
255 255 255... for the end result.  I'm guessing my error happens in this 
Allele set array setting, but I cant figure out how to change it so that it 
works.  This is the code in question:

  int count = 0;
  int temp1 [256];
  for (count = 0; count <256; count ++)
  {
	  temp1[count] = count;
  }
  int temp2 [16];
  for (count = 0; count <16; count ++)
  {
	  temp2[count] = count;
  }
  GAAlleleSet<int> lsb (256, temp1);
  GAAlleleSet<int> msb (16, temp2);
  GAAlleleSetArray<int> alleles;
  for (count = 0; count <512; count ++)
  {
	  int asd = count % 2;
	  if (asd != 0)
	  {
		  alleles.add (lsb);
	  }
	  else
	  {
		  alleles.add (msb);
	  }
  }

I've changed the number of elements in the array from 1, 2, 256, and 512 and 
none of those are working.  If anyone can suggest soemething or provide me 
of a workng example I WOULD GREATLY APPRECIATE IT.  I need help as soon as 
possilbe, so PLEASE HELP.  Thanks.

Rishi Roy
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com





More information about the galib mailing list