October 2008


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
Cem Safak SAHIN <[log in to unmask]>
Reply To:
ECJ Evolutionary Computation Toolkit <[log in to unmask]>
Wed, 1 Oct 2008 12:50:04 -0400
text/plain (184 lines)
Hi there,

I am bechmarking three different GA libraries (ECJ, JGAP, and GALib 
(C++)). The parameter file, the fitness function, and the my mutation 
function are at the end of this email. The length of chromosome is 600 and 
subpopulation size is 20. I am using default crossover function (source 0 
and source 1 --> FitProportionateSelection). Fitness function is 
Kozafitness (it is easier for me to solve minimization problems).
The other two libraries converge around 20,000 iterations. However, ECJ 
converges after 90,000 iterations. If I 

I wanna learn your instincts about convergence rate. Isn't it too slow? 
(Whether, I am coding something wrong or someone has the similar 
convergence rate problem for fitness value) 

Note: I am using my own mutation function because the bit selected for 
mutation should be changed from a value in the predefined vector.

Thanks in advance,

-----------FITNESS FUNCTION-----------------------------------
fitness = 0;
for (i<genome.length){
    fitness += (value of genome  (1/genome.length x i))2

----------PARAMETERS FILE---------------------------------------

parent.0     = simple.params

verbosity     = 0

stat       = ec.GALIB.ES1.MyStat

eval.problem               = ec.GALIB.ES1.MyGAs

pop.subpop.0.breeder      = ec.Simple.SimpleBreeder

pop.subpop.0.species.pipe     = 

pop.subpop.0.species.pipe.source.0    = 
pop.subpop.0.species.pipe.source.0.source.0   =
pop.subpop.0.species.pipe.source.0.source.1   =
pop.subpop.0.species.pipe.source.0.toss = false

pop.subpop.0.species    = 
pop.subpop.0.species.min-gene   = 0.0f
pop.subpop.0.species.max-gene   = 1.0f

pop.subpop.0.species.ind   = 
pop.subpop.0.species.genome-size  = 600
pop.subpop.0.species.crossover-type  = one
pop.subpop.0.species.crossover-prob  = 0.9  =

breed.elite.0     = 1

pop.subpop.0.size     = 20

pop.subpop.0.file = initPop.params

generations      = 100000

function.delay     = false

pop.subpop.0.species.mutation-prob  = 0.002

seed.0      = time

pop.subpop.0.duplicate-retries  = 0

---------------------- MY MUTATION----------------------
package ec.GALIB.ES1;

import ec.BreedingPipeline;
import ec.EvolutionState;
import ec.Individual;
import ec.util.Parameter;
import ec.vector.FloatVectorIndividual;
import ec.vector.FloatVectorSpecies;
import ec.vector.VectorDefaults;

public class MyMutation extends BreedingPipeline{

 public static final String P_MUTATION = "mutate";
 public static final int NUM_SOURCES = 1;
 public RandomGenerator rg = new RandomGenerator();
 public int numSources() {
  // TODO Auto-generated method stub
  return NUM_SOURCES;
 public int produce(final int min, final int max, final int start, 
final int subpopulation,
   final Individual[] inds, final EvolutionState 
state, final int thread){
  // TODO Auto-generated method stub
  int n=sources[0].produce(min, max, start, subpopulation, 
inds, state, thread);
  Parameter myBase = new Parameter("function");
  if (!(sources[0] instanceof BreedingPipeline)){
   for (int q=start;q<n+start;q++){
    inds[q]=(Individual) inds[q].clone();
  //initialize random number generator
  FloatVectorSpecies s = (FloatVectorSpecies)(inds
  FloatVectorIndividual ind;
  for(int q=start;q<start+n;q++){
   ind = (FloatVectorIndividual)inds[q];
   if (s.mutationProbability>0.0){
    if (state.random[thread].nextBoolean
    int a = state.random[0].nextInt(600);

  return n;

 public Parameter defaultBase() {
  // TODO Auto-generated method stub
  return VectorDefaults.base().push(P_MUTATION);
 public class RandomGenerator{
  int type = 0; // 0-->Gaussian, 1-->Cauchy
  int thread;
  EvolutionState state;
  float GetRandom(float a){
   float rnum = 0.0f;
   int k = state.random[thread].nextInt(9);
   rnum = ES_Java_1._chromosomes[(int)a][k];
   /*if (type == 0){
    rnum = err*(float)state.random
   return rnum;
  void SetState(final EvolutionState s){
   state =s;
  void SetThread(final int t){
   thread = t;