> Yes. Neither `population' nor `nextGeneration' is
> actually an array; both are references to array objects.
[quoted text clipped - 8 lines]
> are no other references to the upper array, it becomes
> eligible for garbage collection.
Many thanks Eric.
>> Hi,
>>
[quoted text clipped - 33 lines]
> are no other references to the upper array, it becomes
> eligible for garbage collection.
One important point though, is that after 'population = nextGeneration' both
population and nextGeneration refer to the *same* array.
If your CreateNextGeneration() method simply "populates" the array
nextGeneration, then you will also change the data which population refers
to. You need to make sure that CreateNextGeneration() creates a new array.

Signature
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
MS - 28 May 2005 11:38 GMT
>> Yes. Neither `population' nor `nextGeneration' is
>>actually an array; both are references to array objects.
[quoted text clipped - 15 lines]
> nextGeneration, then you will also change the data which population refers
> to. You need to make sure that CreateNextGeneration() creates a new array.
Thanks.
CreateNextGeneration() does create a new local array, nextGeneration, and
fills it with new Genomes. It does some stuff and then finally reassigns
population: 'population = nextGegeration;'.
Cheers,
MS