Print

Print


Thanks Sean for your response. Would you please provide your valuable advice.

I am modifying the old population inside produce() of mutator pipeline . If I print the new population's individuals inside evaluate() method of next generation then I can see that the modified individuals are inside new population. 

#. I want to revert the parent individual's genome inside mutation pipeline but outside produce() method (say its name setBetter), if the child is inferior in some logic. That's why, I save the parent genome 
before mutation takes place inside produce(). If I revert some parents inside (setBetter), still I get those child individuals in next gernation's evaluate() method. I am curious why is that revert is not reflected
in new population? How can I access the Breerder's array of individuals from Mutator Pipeline?

# I modify the whole population inside produce of Mutator pipeline. After that I overload finishProducing to wait until I get the calculation of parent and child. finishProducing() calls setBetter which either revert or keep the child.
Do I still need to access Simple Breeder's array of individuals?

I am not getting the clue where I am missing. I understand the breeding pipeline (Figure 3.3 inside owner's manual) and the flow of generational EA (Figure 1.1) in ecj, I guess. But can't find the missing dot.

Thanks for your time.
-Bari



On Thu, Oct 20, 2016 at 5:12 PM, Sean Luke <[log in to unmask]> wrote:
This isn't how ECJ's breeding pipelines work.  A pipeline is a stream of objects.  One end of the stream is a SELECTION METHOD which selects an individual from the *old* population and passes it forward.  This individual is then continued forward through various mutators and crossover operators etc. until it is finally handed to the Breeder, which puts the individual in a *new* population.  The new and old populations are different, with different arrays.

It seems that you've got some kind of code which is modifying the old population in-place.  As a result the new individual will never appear in the new population because nobody put it there.

Sean

On Oct 18, 2016, at 7:04 PM, Atm Golam Bari <[log in to unmask]> wrote:

> I am writing a variant of mutation class as described in Tutorial 2.
> All the individuals are mutated and sent to another custom class for evaluation.
> Then produce(...) method is returned. However, I override finishProducing(...) that waits until
> all the evaluation results of parent and child individuals are obtained.
>
> As soon as the evaluation of a parent and its child individual is available, it requires to
> put either parent or child in corresponding individual index ie. in q index using the following
> method inside mutation class.
>
> But, I never get the original(parent) individual in q index though I set
> parents genome there.  I can't understand where I am missing.
>
> public static void setBetterOne(someobject which has q, parent[q] genome and child[q] genome)
> {
>  Individual ind = ((Individual)(state.population.subpops[0].individuals[someobj.q]));
>  IntegerVectorIndividual indiv = (IntegerVectorIndividual)ind;
>  if (parent is better)
>      indiv.genome[x] = parent[q]'s genome
>  else
>     indiv.genome[x] = child[q]'s genome
> }
>
>
> I understand that "ind" in above method provides the reference of q'th individual of subpopulation 0?
> So, now if I change the genome of ind here then why can't I see that change on next step ie. evaluate() method
> of problem class or the selection methods?
>
> Thanks in advance,
> -Bari



--
-Bari