Skip to content

Conversation

@tomerf
Copy link
Contributor

@tomerf tomerf commented Oct 1, 2012

GP tree can now define value types to nodes in the tree.
It now support building trees with mixed types, like integers and booleans.

@tomerf
Copy link
Contributor Author

tomerf commented May 25, 2013

Yes, that's exactly what my patch does. I already forgot about it, so now I need to reverse engineer it. Or not, apparently I also posted the modifications and explanation on the pyevolve google group :)
What I do is detect the function prefix by the input/output types and set a different prefix for each combo, e.g.:

ga.setParams(gpi_terminals = ['x', 'y', 'ephemeral:random.randint(-10,10)',
gpii_function_prefix = "gp_i_",
gpbi_function_prefix = "gp_i2b_",
gpbb_function_prefix = "gp_b_")

The first character is the output type and the second is the input type. So, in this example the first prefix is from integer ('i') to integer ('i'), the second is from input integer ('i') to output boolean ('b') and the last is boolean ('b') to boolean ('b').

It is also "invisible" if one doesn't want to define multiple types, since the default type has an empty prefix ('') so it shouldn't break any existing programs that use pyevolve.

I haven't figured what how to mix multiple input types, it's just the basic framework and should be extended. And probably be more user friendly before...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants