我正在用 C++ 编写一个小型遗传算法框架。我的染色体被编码为位串,其中每个基因都有预定的大小。每条染色体在位串中一个接一个地存储它的基因。现在,我正在寻找实现交叉运算符。
My question is, when choosing a point after which to insert bits from the other chromosome, do I do this on a gene boundary or do I just treat the chromosome as a string of bits, and ignore the division into genes? 换句话说,我是将最小的可交换单元视为一个基因还是一个位元?