因此,如果我使用以下方法在遗传算法中实现交叉:
Input: Two strings of n bits x and y
Output: Two strings of n bits x' and y'
并像这样应用交叉运算符:
随机选择一个交叉站点(以相等的概率),将每个字符串分成两个非零长度的子字符串:
x = [x1, x2];
y = [y1, y2]
和:
x1.length = y1.length
输出生成为:
x' = [x1, y2]
y' = [y1, x2]
鉴于您从
(x1, y1) = ((1 0 1 0) (1 1 1 1))
指定哪些4 bit strings
是仅通过交叉获得的可能值。
那么这是对的吗?
0 1 0 1
我认为将它们加在一起是正确的,但我对此有点迷茫。