Thanks a lot for your reply.
What exactly are you doing in your VectorCrossoverPipeline.produce() method?
- Nothing. I just put it as it is.(see the param file please)
I put chunk-size = genome-size in the param file which I understand does not execute the loop inside defaultCrossover() responsible for respective crosssover type operation. As a result, no cross-over.
If you are still pulling individuals from the source, then your population might be being affected by the TournamentSelection object.
- why it should be affected if I just pull the individuals from the source (may be pipeline or selection method) and do nothing operation on them but forward only. This is what I am exactly doing.
If you want the operators to do truly nothing to the population, I believe (after just glancing at ECJ's code) you can do true cloning by having your produce() method call Breeder.reproduce() and setting the 'produceChildrenFromSource' parameter to 'false'.
- Is not that an extra work... produce() inside ec.vector.breed.VectroCrossooverPipeline() and ec.vector.Breed.VectorMutationPipeline() gets the individuals from their source and stick them into inds[q] location. So, if I want to do "nothing" in that individuals , Ill forward them as they are. Please let me correct if I am wrong. Please see the attached output. I get the individuals untouched but their indexes are not same from old to new population.
Please see the produce() method for mutator class below. I just point old individual as parent and new individual as child whose ie. q value index are same. But when this produce() hands over all the individuals to the breeder, the individuals remain intact but their indexes does not match.
public int produce(final int min,
final int max,
final int start,
final int subpopulation,
final Individual[] inds,
final EvolutionState state,
final int thread) {
int n = sources[0].produce(min,max,start,subpopulation,inds,state,thread);
if (!state.random[thread].nextBoolean(likelihood))
return reproduce(n, start, subpopulation, inds, state, thread, false);
if (!(sources[0] instanceof BreedingPipeline))
for(int q=start;q<n+start;q++)
inds[q] = (Individual)(inds[q].clone());
if (!(inds[start] instanceof IntegerVectorIndividual))
state.output.fatal("OurMutatorPipeline didn't get an IntegerVectorIndividual." +
"The offending individual is in subpopulation " + subpopulation + " and it's:" + inds[start]);
IntegerVectorSpecies species = (IntegerVectorSpecies)(inds[start].species);
IntegerVectorIndividual child, parent;
for(int q=start;q<n+start;q++) { //Iterates single time
//System.out.println("q " +q + " Individual Length " +inds.length);
child = (IntegerVectorIndividual)inds[q];
parent = (IntegerVectorIndividual)state.population.subpops[subpopulation].individuals[q];
System.out.println("Before Mutation, "+ " child Individual : "+child.genotypeToStringForHumans() + " parent Individual : " +parent.genotypeToStringForHumans());
for(int x=0;x<child.genome.length;x++) { //Does mutation
break;
//dummy
}
System.out.println("After Mutation, "+ " child Individual : "+child.genotypeToStringForHumans() + " parent Individual : " +parent.genotypeToStringForHumans());
parent.evaluated=false;
}
return n;
}
-agb