遗传算法处理负适应性值 [英] genetic algorithm handling negative fitness values

查看:213
本文介绍了遗传算法处理负适应性值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试实现遗传算法以最大化n个变量的函数.但是,问题在于适应度值可能为负,并且我不确定在选择时如何处理负值.我阅读了这篇文章遗传算法中的线性适应度缩放会产生负数适合度值 但我不清楚如何处理负适应度值以及如何计算缩放因子a和b.

I am trying to implement genetic algorithm for maximizing a function of n variables. However the problem is that the fitness values can be negative and I am not sure about how to handle negative values while doing selection. I read this article Linear fitness scaling in Genetic Algorithm produces negative fitness values but it's not clear to me how the negative fitness values were taken care of and how scaling factors a and b were calculated.

此外,从该文章中,我知道轮盘赌选择仅适用于正健身值.选择锦标赛也一样吗?

Also, from the article I know that roulette wheel selection only works for positive fitness value. Is it the same for tournament selection as well ?

推荐答案

比赛选择不受此问题影响.它只是比较总体大小为n的统一采样子集的适应度值,并选择具有最佳值的适应度值.当然,这仍然意味着,如果您不重复采样,那么最差的n-1个人将永远不会被选中.如果您重复采样,就有机会被选中.

Tournament selection is not affected by this problem. It simply compares the fitness values of a uniformly sampled subset of size n of the population and takes the one with the best value. Still of course this means that, if you sample without repetition then the worst n-1 individuals will never get selected. If you sample with repetition they have a chance of being selected.

与比例选择一样:不适用于负适应性值.您只能对适应度值应用窗口"或缩放",在这种情况下它们将再次起作用.

As with proportional selection: It doesn't work with negative fitness values. You can only apply "windowing" or "scaling" of your fitness values in which case they work again.

我曾经编写过一些作为C#IEnumerable扩展方法的采样方法是SampleProportional和SampleProportionalWithoutRepetition扩展方法.它们是GPL许可下的HeuristicLab的一部分.

I once programmed some sampling methods as extension methods for C#'s IEnumerable among them is a SampleProportional and SampleProportionalWithoutRepetition extension method. They're part of HeuristicLab under GPL license.

这篇关于遗传算法处理负适应性值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆