Print

Print


Hi Sean,

I tried to compile both Uniform.java and GPTreeConstraints.java but I
am getting errors like this:

GPTreeConstraints.java:94: cannot find symbol
symbol  : variable treeConstraintRepository
location: class ec.gp.GPInitializer

(GPTreeConstraints)(((GPInitializer)state.initializer).treeConstraintRepository.put(name,this));
                                 ^
GPTreeConstraints.java:154: constraints() in ec.gp.GPNode cannot be
applied to (ec.gp.GPInitializer)
             for (int
y=0;y<i[x].node.constraints(initializer).childtypes.length;y++)

I have checked GPInitializer, but I couldn't find these fields. Did
you change GPInitializer as well? If that is the case, could you send
me a copy?

> Seems to work fine.  Here are the files.  Try java ec.Evolve -file
> noerc.params

Anyway, I have tried your example with standard ECJ (with only the
error line in GPTreeConstraints changed), and I get these results:

Processing GP Tree Constraints
Determining Tree Sizes
Set: 0 Type: 0 Size: 1 num: 1
Set: 0 Type: 0 Size: 2 num: 1
Set: 0 Type: 0 Size: 3 num: 5
Set: 0 Type: 0 Size: 4 num: 9
Set: 0 Type: 0 Size: 5 num: 49
Set: 0 Type: 1 Size: 1 num: 0
Set: 0 Type: 1 Size: 2 num: 0
Set: 0 Type: 1 Size: 3 num: 0
Set: 0 Type: 1 Size: 4 num: 0
Set: 0 Type: 1 Size: 5 num: 0
Set: 0 Type: 2 Size: 1 num: 1
Set: 0 Type: 2 Size: 2 num: 1
Set: 0 Type: 2 Size: 3 num: 1
Set: 0 Type: 2 Size: 4 num: 5
Set: 0 Type: 2 Size: 5 num: 9
Compiling Distributions
Exception in thread "main" java.lang.ArithmeticException: Distribution
has all zero probabilities
         at
ec.util.RandomChoice.organizeDistribution(RandomChoice.java:139)
         at
ec.util.RandomChoice.organizeDistribution(RandomChoice.java:111)
         at ec.gp.build.Uniform.preprocess(Uniform.java:283)
         at ec.gp.build.Uniform.setup(Uniform.java:199)
         at ec.gp.GPTreeConstraints.setup(GPTreeConstraints.java:160)
         at
ec.gp.GPTreeConstraints.setupConstraints(GPTreeConstraints.java:125)
         at ec.gp.GPInitializer.setup(GPInitializer.java:63)
         at ec.EvolutionState.setup(EvolutionState.java:324)
         at
ec.simple.SimpleEvolutionState.run(SimpleEvolutionState.java:63)
         at ec.Evolve.main(Evolve.java:424)

So I guess your changes are needed.

Anyway, the number of trees reported with my params file (only 1 for
type 0. size 3, and only 1 for type 1, size 1) are definitely strange.
I will try to check what the problem is meanwhile. What exactly does
the number of trees mean? Is the number of possible permutations for
that size and type?

Best regards,

Artur Matos