January 2005


Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sean Luke <[log in to unmask]>
Reply To:
ECJ Evolutionary Computation Toolkit <[log in to unmask]>
Thu, 6 Jan 2005 20:46:27 -0500
text/plain (51 lines)
On Jan 6, 2005, at 7:04 PM, Elena Popovici wrote:

>        I am trying to implement a version of 2 populations
> co-evolution where
> during one generation only one population goes through evaluation and
> breeding (e.g. have one pop run for 10 generation while keeping the
> other one frozen, then vice versa and so on). I've updated my custom
> evaluator to evaluate only one population per generation.
>        Do I need to write my own custom breeder to have only one of the
> populations breeding in each generation or is there some other simpler
> way to hack this?

Hi, Elena.  That is of course a very common form of coevolution, so we
should probably add some feature to ECJ to make this trivial.  At any
rate, I think the easiest way to do it is to modify the breeder so that
it only breeds one subpopulation at a time.  That's pretty easy.  If
you're using SimpleBreeder, it'd look something like this.  Change:

                 x += bp.produce(1,upperbound-x,x,subpop,

                          if (shouldSkipSubpop(subpop,state))  // you implement this method
                                        newpop.subpops[subpop].individuals[x] =
                                x += bp.produce(1,upperbound-x,x,subpop,

... or something like that.  I'm just writing off the top of my head,
so there could be a bug there.

You could also create a SelectionMethod subclass which returns each
subpopulation member in turn.  Then you'd create a BreedingPipeline
subclass which selects which source it's going to use based on whether
the generation is even or odd.  On one source you hang your normal
breeding pipeline, and in the other source you hang your
SelectionMethod.  In SelectionMethod.prepareToProduce() you can reset
your internal counter to 0 again so it starts at the beginning of the
population.  If you do that, be sure to only run in single-thread
breeding mode.