I'm working on a GP project for my masters thesis and I wish to
implement within ECJ a system described by Angeline and Pollack in this
paper:  , pages 3-6 which they
name GLiB.

Basically, it involves (in their case, randomly) picking snippets of
code out and replacing that with a function (and the process can
reverse, replacing a function name with the body of the function).  It
differs from Koza style ADF, as far as I can tell (if I don't
understand things correctly regarding ADF, please correct me), in the
following ways, though these may not be the only differences:

1) The argument list of ADF is predefined vs. GLiB constructs the
argument list at runtime.
2) Each member of the population using ADF "sees" it's own version of
each function name vs. GLiB where the function library (so to speak) is
globally visible to each member.

So... I'm attempting to think this through before starting to write any
code (what a concept), and I wanted to get some input from people more
intimate with ECJ internals than I.

A few questions:

a) Looking at the class doc for GPFunctionSet, it looks like it's
really designed to be setup once at initialization via parameter files,
given the methods.  Would it be a tricky endeavor to manipulate a
GPFunctionSet programmatically during simulation?  Is my best option to

b) Given the listed differences between GLiB functions and ADF, would
subclassing or reusing much of the ADF code result in a mess?
Basically, would I be better off starting from scratch as to how a GLiB
function is executed?  If starting from scratch I was thinking of using
BCEL ( to create GPNodes on the fly,
but I've never used BCEL before so I don't know how feasible this is.

My completely naive thought was to simply run all this from an external
program which analyzes the population (ecj output) outputs java files
and param files (with funcset and node constraints), invokes javac, and
then ecj (for a couple of generations the output the population) then
go through the whole cycle again until termination criteria are
achieved. That would avoid digging too deeply into the ECJ internals,
but it also strikes me as extremely expensive.

I realize all the source is there for the reading, but I wanted to get
some advice before diving in, rather than perhaps stumbling down the
wrong path and wasting time.

I hope this doesn't sound too crazy.