January 2010


Options: Use Monospaced Font
Show HTML Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
ECJ Evolutionary Computation Toolkit <[log in to unmask]>
Jake Pacheco <[log in to unmask]>
Sat, 23 Jan 2010 02:20:12 -0500
ECJ Evolutionary Computation Toolkit <[log in to unmask]>
text/plain (77 lines)

Thanks very much, I was referring to GP. Does this mean that individuals
form one generation are never carried straight over to another (i.e. they
are always cloned)?

For my application, in clone(), I think i need to do 
bar = new ArrayList();
since i want the array list to be empty at the start of every generation
(you were correct, I do not want them pointing to the same place). So, foo2
and foo3 both are in the new population and and are both

Can foo ever be in the new population as well (say, if the individual it is
a part of is carried over unaltered)? If foo can be in the new population,
is there a way to ensure that is reinitialized? Or, are individuals
always cloned somehow before being placed in the new population? 



On Fri, 22 Jan 2010 18:29:42 -0500, Sean Luke <[log in to unmask]> wrote:

>Jake, I presume you're talking about GP.  GPNodes, GPTrees, and
>GPIndividuals all basically work like this: after a population is
>evaluated, typically the individuals undergo breeding to create new
>individuals, and then are usually eliminated.  Breeding works by
>cloning subtrees, and ultimately nodes, from the old individuals to
>form new individuals.  The clone method used is lightClone(), which
>ultimately calls clone() underneath.
>So let's say you've made got a GPNode called 'foo' which has an
>ArrayList called  'foo' is located in some GPIndividual, and
>the GP system has decided to copy that individual, and the subtree
>where 'foo' is located, to create a new child for the next
>generation.  We call foo.clone().  This creates a new object (call it
>foo2). is pointing to the same ArrayList as now.
>Now we create another new child from foo (foo's lucky!) called foo3.
> and BOTH are pointing to the same ArrayList as
> is.
>This may be what you want, but I'm guessing it's not.  Because now you
>evaluate the new child individual that holds foo2.  It adds something
>to the ArrayList.  When you get around to evaluating the
>individual that has foo3, it ALSO will have that thing added into its
>ArrayList because it's the same ArrayList.  You probably were hoping
>them to have separate ArrayLists is my guess.
>To do that, you override the GPNode clone method for your particular
>GPNode subclass to call super.clone(), and then say something like:
> bar = (ArrayList)(bar.clone());
>Now foo2 and foo3 have their own copies of the ArrayList, different
>from the original one in foo, each storing what had inside it,
>but able to add their own independent stuff without stepping on each
>others' toes.
>On Jan 22, 2010, at 5:13 PM, Jake Pacheco wrote:
>> Specifically, I have a node that is meant to calculate the zero lag
>> exponential moving average of its child's value. This requires the
>> node
>> having access to its own value on the previous evaluation, as well
>> as the
>> child's value for several evaluations back. The way I implemented
>> this, the
>> node stores its value in a variable after calculation, and adds the
>> child's
>> value to an ArrayList. However, I am not sure if these are preserved
>> through
>> to the next evaluation, or, if they are preserved through evaluations,
>> whether they will be empty once the next generation starts.