Print

Print


I see: you need an iterator.

I just did a commit with some changes to GPNode and GPNodeGatherer which adds and iterator function and rearranges some things.  Hope I didn't break anything.  I believe it works properly, try it out on SVN.

Sean

On Mar 3, 2014, at 6:12 PM, Raymond Shpeley <[log in to unmask]> wrote:

> List just returns the tree. I know ECJ does this but I was looking for a means of 
> getting the equivalent of a depth 1st traversal of the leafs without the nodes. I 
> found that eventually in gpsemantics. 
> 
> One of the problems I had was in setting up a function to return the leafs. In 
> gpsemantics, SemanticJ.java defined a join. I had already given up on the idea 
> of the three list functions in favour of one join function. SemanticNode.java 
> doesn't look at the children, which was one of the things I found confusing 
> from the other examples.
> 
> I haven't gotten to testing this yet, but I think that part should work well 
> enough now. 
> 
> Not what I was looking for, but passing a list of data between nodes sounds 
> interesting...
> 
> What has that been used for?
> 
> -- ray
> 
> On Mon, 3 Mar 2014 16:37:05 -0500, Sean Luke <[log in to unmask]> wrote:
> 
>> On Mar 1, 2014, at 1:05 AM, Raymond Shpeley <[log in to unmask]> 
> wrote:
>> 
>>> This is probably painfully obvious to most... How do I create a Koza list 
> function?
>>> Koza had Listx, with x being the arity of the function. I'll use this for testing 
> only
>>> and at this time it will be fed by ERC terminals as Sean previously 
> suggested.
>>> 
>>> I'll create 3 list functions, List16, List17, List18, and an ERC with an integer 
> range
>>> of 1-26, to create trees which return either 16, 17, or 18 ints in a list. That 
> list
>>> will be checked for conflict constraints, ie if 6 then not 7, producing 32 
> unique
>>> individuals. I realise Koza needed the Listx function because he was using 
> Lisp,
>>> I'm just wondering how this is normally done.
>> 
>> I don't know what you're referring to by a listx function -- this just be a Koza 
> III thing; at any rate, not normally used in GP.
>> 
>> If you want to pass a list of data between nodes, this can be done, just set 
> up a pointer for it in your GPData object.
>> 
>> Sean