Print

Print


I found at least a workaround here: I can look at updateFitness. On  
the first batch of evaluations, updateFitness[0] is true and  
updateFitness[1] is false. On the second pass, vice versa.

If there's a better way, let me know...

Peter Drake
http://www.lclark.edu/~drake/



On May 20, 2008, at 8:00 AM, Peter Drake wrote:

> This solves problem 2, but not problem 1.
>
> I added this line to my evaluate() method:
>
> state.output.message("Evaluating " + ind[0].hashCode() + " vs " +  
> ind[1].hashCode());
>
> When I ran the program (with one generation), I got this:
>
> Evaluating 341584759 vs 202290185
> Evaluating 341584759 vs 26376435
> Evaluating 54843991 vs 202290185
> Evaluating 54843991 vs 26376435
> Evaluating 341584759 vs 202290185
> Evaluating 54843991 vs 202290185
> Evaluating 341584759 vs 26376435
> Evaluating 54843991 vs 26376435
>
> In terms of the notation below, it appears that the program did:
>
> aC
> aD
> bC
> bD
> aC
> bC
> aD
> bD
>
> Is there a way to avoid the second batch of redundant comparisons?
>
> Thanks,
>
> Peter Drake
> http://www.lclark.edu/~drake/
>
>
>
> On May 19, 2008, at 11:20 PM, Liviu Panait wrote:
>
>> The individuals from the two populations will be sent in order:  
>> the first individual (individuals[0]) is from the first  
>> population, while the second one (individuals[1]) is from the  
>> second population.  Hope that solves both problems.
>>
>> Liviu.
>>
>> On May 19, 2008, at 8:50 AM, Peter Drake wrote:
>>
>>> I have two coevolving subpopulations. As I understand it,  
>>> evaluation is handled by the evaluate() method in (my class that  
>>> implements) GroupedProblemForm. For example, if population 0 has  
>>> individuals a and b and population 1 has individuals C and D,  
>>> this method will be called with the following pairs of arguments:
>>>
>>> aC
>>> aD
>>> bC
>>> bD
>>> Ca
>>> Cb
>>> Da
>>> Db
>>>
>>> I have two problems:
>>>
>>> 1) I would rather not evaluate both aC and Ca. Is there a way to  
>>> avoid this?
>>>
>>> 2) I see no way to tell whether the first individual passed to  
>>> evaluate is from population 0 or 1. Since my problem is  
>>> asymmetric, I need this information for evaluation. Is there a  
>>> way to find it, or do I need to redefine some of the coevolution  
>>> stuff?
>>>
>>> Peter Drake
>>> http://www.lclark.edu/~drake/
>>>
>>>
>>>
>>
>