# [Paradiseo-help] Problem of front by front crowding distance calculation

Ven 2 Juil 05:13:38 CEST 2010

```Hi,
Maybe the second sorting is to sort in the same front,does it?
How about changing the code to "std::sort(&sortedptrpop[a],
sortedptrpop.end(), cmp2);"?

Best regards,
Jyun-Yan Cheng.

> HI,
> But, when I print the front depth before the code and after the code.(the
> attached pic)
> I found the rank(fitness) change.
> Does it not affect the following crowding distance calculation?
>
>
> Best regards,
> Jyun-Yan Cheng
>
>
>
> 寫道：
>
> Hello,
>> In fact, the population is not sorted according to one objective. It's a
>> vector of pointers that is sorted. This is used to set the crowding
>> distance values.
>> The only explanation that the crowding distance of the individuals
>> contained in the final population is close to infinity is that it
>> contains a small number of solutions only. This is also related to the
>> ranges of the objective values.
>>
>> Best regards,
>>
>>
>>
>> 程鈞彥 a e'crit :
>> > Hi, I found something strange.
>> >
>> > The following code==>
>> >
>> > moeoOneObjectiveComparator < MOEOT > objComp(obj);
>> > moeoPtrComparator<MOEOT> cmp2( objComp );
>> > std::sort(sortedptrpop.begin(), sortedptrpop.end(), cmp2);
>> >
>> > will sort the pop according to one objective.
>> >
>> > However, this code also disarranges the pareto front relationship.
>> > I don't know if I misunderstood something.
>> >
>> > Thanks.
>> >
>> > Best regards,
>> > Jyun-Yan Cheng.
>> >
>> >
>> > 2010/7/1 程鈞彥 <cgm7487 at gmail.com <mailto:cgm7487 at gmail.com>>
>> >
>> >     Hi, I used the oeoFrontByFrontCrowdingDiversityAssignment class to
>> >     calculate crowding distance.
>> >
>> >     However, I find that the crowding distance of my final
>> >     non-dominance set are almost Infinity.
>> >
>> >     I have no idea why the problem happened. Could you please give me
>> >     some suggestion of the problem?
>> >
>> >
>> >     Best Regards,
>> >     Jyun-Yan Cheng
>> >
>> >
>> > ------------------------------------------------------------------------
>> >
>> > _______________________________________________