ECJ-INTEREST-L Archives

February 2017

ECJ-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Proportional Font
Show HTML Part by Default
Condense Mail Headers

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

Print Reply
Sender:
ECJ Evolutionary Computation Toolkit <[log in to unmask]>
Date:
Wed, 22 Feb 2017 09:50:28 -0500
Reply-To:
ECJ Evolutionary Computation Toolkit <[log in to unmask]>
Subject:
MIME-Version:
1.0
Message-ID:
In-Reply-To:
Content-Type:
multipart/mixed; boundary=94eb2c04725e7e6f7205491fa0ef
From:
"BARI, ATM GOLAM" <[log in to unmask]>
Parts/Attachments:
text/plain (4 kB) , text/html (15 kB) , Capture.PNG (85 kB)
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

On Wed, Feb 22, 2017 at 9:11 AM, Eric 'Siggy' Scott <[log in to unmask]> wrote:

> What exactly are you doing in your VectorCrossoverPipeline.produce()
> method?  If you are still pulling individuals from the source, then your
> population might be being affected by the TournamentSelection object.
>
> 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'.
>
> Siggy
>
> On Wed, Feb 22, 2017 at 8:44 AM, Atm Golam Bari <[log in to unmask]> wrote:
>
>> Hi,
>> I was just understanding how ECJ generational loop works. So, I disabled
>> the cross over using chunk-size = genome size, override produce(....) of
>> ec.vector.breed.VectorCrossoverPipeline and did not do any mutation
>> there. So, I expect the old and new individuals should be same throughout
>> the run. I am getting ok that part.
>>
>> >>But the index of the old individuals does not match with the index of
>> new individuals. Say individual [10, 20] has index 0 at old population but
>> it gets different index (say index 3) in new population.
>> >> I understand that newPop inside ec.simple.SimpleBreeder is the array
>> that holds new population and state.population.subpops[subpopulation].individuals[]
>> holds the old population at any time.
>>
>> Would you please let me know whether I am missing. Here is the part of
>> parameter file (attached file name : Capture.PNG) .
>> Thanks for your time,
>> agb
>>
>>
>
>
> --
>
> Ph.D student in Computer Science, George Mason University
> CFO and Web Director, Journal of Mason Graduate Research
> http://mason.gmu.edu/~escott8/
>



-- 
-Bari


ATOM RSS1 RSS2