June 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
Artur Matos <[log in to unmask]>
Reply To:
ECJ Evolutionary Computation Toolkit <[log in to unmask]>
Thu, 9 Jun 2005 19:25:24 +0900
text/plain (131 lines)
(Sorry, in my previous posting I forgot to add the subject line, and
also the tree ASCII diagram got garbled. I am posting the corrected
version now)

Hi to all,

I am trying to use ECJ's strongly-typed GP implementation, but I am
having some issues with it. Currently, I
am trying to evolve trees that look like this:

                           |                       |
                         Seq               Weight
                           |                        |
              ---------------               --------------------
              |             |               |                   |
           Weight  Weight        0.32            0.54
              |              |
    -----------          -------------
   |          |          |           |
0.1     0.93     0.5       0.2

Basically, there are 4 types of nodes: "Par", "Seq", "Weight", and
Ephemeral Random Constants (represented by the numbers
in the leaves). In this representation, the top node must always be an
instance of either "Par", "Seq", or "Weight"; the leaves must
always be ERCs. "Par" and "Seq" children must always be instances of
either "Par", "Seq", or "Weight"; only "Weight" has ERCs (and
can only have ERCs) as children. (In case you are familiar with it,
this is just a simplified version of Gruau's cellular encoding model.)

To model this, I have tried to define my parameter file like this.
First I defined two atomic types, "edge" for the regular type
(returned by "Par","Seq", and "Weight"), and "real" for the ERCs:

gp.type.a.size = 2
gp.type.s.size = 0 = edge = real

I defined my GP individuals with only one tree, returning the "edge"
datatype at the topmost node:

pop.subpop.0.species.ind.numtrees = 1
pop.subpop.0.species.ind.tree.0 = = tc0 = 1 = = tc0 = f0 = edge

And defined 3 node constraints. nc0 is used for the ERCs, nc1 for
"Par" and "Seq"; nc2 for "Weight":

-------------------------------------------------------------------------------------- = = nc0 = real = 0 = = nc1 = edge = 2 = edge = edge = = nc2 = edge = 2 = real = real

Therefore my function set is like this:

gp.fs.0.size = 4
gp.fs.0.func.0 = org.amatos.evodevo.growthmodels.cellularencoder.Par = nc1
gp.fs.0.func.1 = org.amatos.evodevo.growthmodels.cellularencoder.Seq = nc1
gp.fs.0.func.2 = org.amatos.evodevo.growthmodels.cellularencoder.Weight = nc2
gp.fs.0.func.3 =
org.amatos.evodevo.growthmodels.cellularencoder.WeightERC = nc0

Now, when I try to run ECJ with these params, I get the following
error message:

In function set f0 for the GPTreeConstraints tc0, no terminals are
given with the return type edge which is required by other functions
in the function set.
In function set f0 for the GPTreeConstraints tc0, no *nonterminals*
are given with the return type real which is required by other
functions in the function set.  This may or may not be a problem for

I really don't understand why in this case ECJ requires terminals
returning edges (and conversely non-terminals returning reals).
Shouldn't ECJ
be able to generate trees even without these nodes defined? Is this
related to the GPNodeBuilder used? or do I need to separate my
functions into
2 different function sets?

Best regards,

Artur Matos.