9

n 変数の関数を最大化するための遺伝的アルゴリズムを実装しようとしています。ただし、問題は、フィットネス値が負になる可能性があり、選択中に負の値を処理する方法がわからないことです。この記事を読みました 遺伝的アルゴリズムの線形フィットネススケーリングは負のフィットネス値を生成します が、負のフィットネス値がどのように処理され、スケーリング係数 a と b がどのように計算されたかは明確ではありません。

また、記事から、ルーレット盤の選択は正のフィットネス値に対してのみ機能することを知っています. 大会選考も同じですか?

4

5 に答える 5

8

負の値がある場合は、母集団内で最小のフィットネス値を見つけて、その逆をすべての値に追加しようとすることができます。こうすることで、負の値はなくなりますが、フィットネス値の差は変わりません。

于 2013-04-24T08:16:02.723 に答える
6

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.

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.

于 2013-04-24T10:59:10.937 に答える