提交 7402afc6 编写于 作者: 丁劲犇's avatar 丁劲犇 😸

增加随机性

上级 8e2856a6
#include <iostream>
#include <iostream>
#include <random>
#include <cassert>
#include <vector>
......@@ -91,12 +91,17 @@ int main(int /*argc*/, char* /*argv*/[])
data[i][j] = e() % 2;
int best[8] = {12,445,17,2314,3033,1273,2289,4987};
//Best rows,重量一致,但是排齐
for (int i = 0; i <R ; ++i)
for (int j = 0; j < 8; ++j)
data[i][best[j]] = 0;
for (int i = 0; i <R/2 ; ++i)
{
int r = e() % R;
for (int j = 0; j < 8; ++j)
{
data[i][best[j]] = 1;
data[i][best[j]+R/2] = 0;
data[r][best[j]] = 1;
}
}
//种群1024
const int S = 1024;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册