Assuming you want to use ECJ for both your GP and GA, and it's truly a
*nested* GA (a whole GA run when evaluating a single individual), you
should be able to do it something like this:
-1. Make a special subclass of Initialializer, which you will use.
0. Make a global integer gaRandomOffset in your Initializer, starting
1. At the beginning of your GP run -- during Initializer's setup
perhaps, load and store somewhere (in the Initializer) a
ParameterDatabase which holds the parameters for your GA runs. Let's
say it's called 'database'. You can get
a parameter database easily with new ParameterDatabase(filename).
2. On evaluation, call
EvolutionState state2 = Evolve.initialize(state.initializer.database,
3. You'll need to stash YOUR EvolutionState in state2 somewhere so
state2's Problem can find it -- or hack globals up somehow.
4. Then call
You may want to modify the startFresh method (or create another one) so
it doesn't do state.output.close(); at the very end, as that'll close
stdout while your original EvolutionState is still using it.
5. Do your post-hoc analysis, then
state2 = null; // let gc
On Sep 19, 2005, at 3:07 PM, Arjan Seesing wrote:
> I'm going to use a nested GA inside my GP run. So to evaluate my GP
> programs, I'm first going to run a small GA run on a some extra data
> to be able to evaluate the individuals.
> My question is what would be the easiest way to call ECJ with the
> lowest overhead possible.
> I've been looking at the Console app which starts ECJ itself, but it's
> all so correlated to the gui, it is impossible to use the code there.
> I will be using the parameter database to pass data to the inner GA
> but I haven't decided how to pass data back.
> Some hints would be appreciated!