0

I'm trying to use fitness/function sharing on a minimization function. I'm using the standard definition of the sharing function found here which then divides the fitness by the niche count. This will lower the fitness, proportional to the amount of individuals in its niche. However, in my case the lower the fitness the more fit the individual is. How can I make my fitness sharing function increase the fitness proportionally to the amount of individuals in its niche?

Here's the code:

def evalTSPsharing(individual, radius, pop):
    individualFitness = evalTSP(individual)[0]
    nicheCount = 0
    for ind in pop:
        distance = abs(individualFitness - evalTSP(ind)[0])
        if distance < radius:
            nicheCount += (1-(distance/radius))
    return (individualFitness/nicheCount,)

I couldn't find a non-pdf of the paper, but here's a picture of the relevant parts. Again, this is from the link above.

Fitness Sharing

4

1 回答 1

0

问题已经两年了,但我会试一试:您可以尝试用乘法替换niche_count除法惩罚,即:

individualFitness * nicheCount

代替:

individualFitness / nicheCount
于 2017-08-03T16:49:57.110 回答