Print

Print


Thanks for the fast response. I think you're right. I got confused by
looking at the example programs like lawnmower etc.

There, the ADF only takes terminals as argument. So the ADFs there are all
"pre-terminals".
Like I said, what I want is an ADF that accepts a function as argument. Like
depicted here:
http://www.cs.bham.ac.uk/~txs/teaching/2001/EC/gp-adf/slide9.html
http://www.cs.bham.ac.uk/~txs/teaching/2001/EC/gp-adf/slide12.html

I've changed my params file so that the argument of the ADF takes a specific
function as argument. It works, however I get some errors when running this:

-------------------
WARNING:
There is no argument terminal for argument #0 for the node ADF0[1] in
individual pop.subpop.0.species.ind
WARNING:
There is no argument terminal for argument #1 for the node ADF0[1] in
individual pop.subpop.0.species.ind
WARNING:
There is no argument terminal for argument #2 for the node ADF0[1] in
individual pop.subpop.0.species.ind
WARNING:
There is no argument terminal for argument #0 for the node ADF0[1] in
individual pop.subpop.0.species.ind
WARNING:
There is no argument terminal for argument #1 for the node ADF0[1] in
individual pop.subpop.0.species.ind
WARNING:
There is no argument terminal for argument #2 for the node ADF0[1] in
individual pop.subpop.0.species.ind
ONCE-ONLY WARNING:
A GPNodeBuilder has been requested at least once to generate a one-node tree
with a return value type-compatable with a certain type; but there is no
NON-TERMINAL which is type-compatable in this way.  As a result, the
algorithm was forced to use a TERMINAL, making the tree larger than
requested, and exposing more child slots to fill, which if not carefully
considered, could recursively repeat this problem and eventually fill all
memory.
ONCE-ONLY WARNING:
class ec.gp.koza.HalfBuilder can't find a terminal type-compatable with nil
-------------------

I suppose my way of working now is the correct one, here's what I put in my
params file:
gp.fs.1.func.2 = ec.app.my_prog.functions.If #is simply a function
gp.fs.1.func.2.nc = if-constraint #defined above
gp.fs.1.func.2.arg = 0 # meaning it's ARG0

When I run this, I don't see an 'If', I only see 3 arguments where the
arguments have the same constraints as those of 'If'. So I suppose when I
see an individual with ADF0[1] it means the name If got replaced with
ADF0[1], that's all? If so, that's what I need.


Now, I still have one problem. The ADF tree gets out of control. It becomes
way too big eventhough I try to limit the max-depth


Also, this doesn't seem to work:
gp.tc.0.init.max-depth = 3
gp.koza.half.max-depth = 3

it gives the following error:

-------------------
FATAL ERROR:
The Max Depth for a KozaBuilder must be at least 1.
PARAMETER: gp.tc.0.init.max-depth
     ALSO: gp.koza.half.max-depth
-------------------
Removing these lines will result in trees of max-depth 17 as by default.
A quick search revealed that other have had the same problem, they solved it
by using an 'hack', i.e. by using pop.subpop.0.species.pipe.source.0.maxdepth