%P199_8 GA
clc;
clear;
pop_size=100;%种群大小
m=42;%每个个体的基因数目
m1=21;%每个个体中x1占的位数
m2=21;%每个个体中x2占的位数
%产生初始种群
for j=1:pop_size
for i=1:m
num=randperm(2)-1;
str_num(j,i)=dec2bin(num(1));%随机产生的二进制数,pop_size个,每个m位
end
end
delta=10;
cc=0;%迭代次数
while delta>0.01%for qq=1:500%大循环
for j=1:pop_size
for i=1:m
if i<=m1
str_num1(j,i)=str_num(j,i);
else
str_num2(j,i)=str_num(j,i);
end
end
SHOW FULL COLUMNS FROM `jrk_downrecords` [ RunTime:0.001727s ]
SELECT `a`.`aid`,`a`.`title`,`a`.`create_time`,`m`.`username` FROM `jrk_downrecords` `a` INNER JOIN `jrk_member` `m` ON `a`.`uid`=`m`.`id` WHERE `a`.`status` = 1 GROUP BY `a`.`aid` ORDER BY `a`.`create_time` DESC LIMIT 10 [ RunTime:0.091357s ]
SHOW FULL COLUMNS FROM `jrk_tagrecords` [ RunTime:0.001161s ]
SELECT * FROM `jrk_tagrecords` WHERE `status` = 1 ORDER BY `num` DESC LIMIT 20 [ RunTime:0.001293s ]
SHOW FULL COLUMNS FROM `jrk_member` [ RunTime:0.001054s ]
SELECT `id`,`username`,`userhead`,`usertime` FROM `jrk_member` WHERE `status` = 1 ORDER BY `usertime` DESC LIMIT 10 [ RunTime:0.003653s ]
SHOW FULL COLUMNS FROM `jrk_searchrecords` [ RunTime:0.001328s ]
SELECT * FROM `jrk_searchrecords` WHERE `status` = 1 ORDER BY `num` DESC LIMIT 5 [ RunTime:0.004211s ]
SELECT aid,title,count(aid) as c FROM `jrk_downrecords` GROUP BY `aid` ORDER BY `c` DESC LIMIT 10 [ RunTime:0.016246s ]
SHOW FULL COLUMNS FROM `jrk_articles` [ RunTime:0.001288s ]
UPDATE `jrk_articles` SET `hits` = 2 WHERE `id` = 16322 [ RunTime:0.017348s ]