Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Artificial intelligence 遗传算法轮盘赌轮选择_Artificial Intelligence_Selection_Genetic Algorithm_Roulette Wheel Selection - Fatal编程技术网

Artificial intelligence 遗传算法轮盘赌轮选择

Artificial intelligence 遗传算法轮盘赌轮选择,artificial-intelligence,selection,genetic-algorithm,roulette-wheel-selection,Artificial Intelligence,Selection,Genetic Algorithm,Roulette Wheel Selection,我在理解算法时遇到问题。这是在网上看到的最流行的一个 for all members of population sum += fitness of this individual end for for all members of population probability = sum of probabilities + (fitness / sum) sum of probabilities += probability end for loop until new p

我在理解算法时遇到问题。这是在网上看到的最流行的一个

for all members of population
  sum += fitness of this individual
end for

for all members of population
  probability = sum of probabilities + (fitness / sum)
  sum of probabilities += probability
end for

loop until new population is full
  do this twice
    number = Random between 0 and 1
       for all members of population
          if number > probability but less than next probability 
             then you have been selected
       end for
      end
  create offspring
end loop


for all members of population
  probability = sum of probabilities + (fitness / sum)
  sum of probabilities += probability
end for
^^^这篇文章特别使我困惑。什么是“概率之和”甚至“概率”在一个群体中的个体的上下文中?这些价值观与个人在《盗梦空间》中的价值观相似吗?

关键在于

probability = sum of probabilities + (fitness / sum)

概率
是对个体生育后代机会的衡量;轮盘赌轮盘上的切片大小。概率之和是轮盘赌轮的总大小。 每个人的
概率是其适应度的函数


我在试图理解算法时发现了一些帮助。

这是一段非常模糊的代码

在第二个代码块中,
概率
是附加到人口中每个成员的变量,
概率之和
是整个人口的全局变量

现在,轮盘赌的比喻是说,整个人口可以表示为一个轮盘赌,人口中的每个成员在轮盘赌中都有一个与其相对适合度成比例的部分。这段代码是在做这个比喻背后的肮脏工作——不再是轮子上的楔子,而是用线段[0,1]上的比例间隔来表示成员,这是表示概率的惯常方式

要做到这一点,从技术上讲,每个成员都需要两个数字,一个开始,一个结束。但是第一个成员的起始值是0;第二个成员的起点是第一个成员的终点;依此类推,直到最后一个成员结束时为1

这就是代码所做的<代码>概率之和
从0开始,在第一次循环中,
概率
是你直觉上认为的。它正在标记第一个成员的端点。然后更新“概率之和”。第二次循环时,“概率”是你直觉上认为的。。。被“概率之和”转移了,就是这样


因此,第一个循环是求和适应值,作为规范化的前奏。第二个循环,就是你要问的,是在单位时间间隔内规范化和安排这些规范化的概率。第三个(最复杂的)循环是选取两个随机数,将它们与两个种群成员匹配,然后进行交配。(请注意,假设这些成员采用类似数组的格式,以便您可以根据您滚动的随机数顺序检查它们的端点。)

那么,为什么算法要将概率之和添加到(适合度/和)中,以获得每个成员的概率……概率应该是(适合度/和)仪式
if number > probability but less than next probability 
         then you have been selected