混沌映射初始化种群之Logistic映射
Logstic混沌映射初始化种群
Step 1:
随机生成一个\(d\)维向量\({X_0}\),向量的每个分量在0-1之间。
Step 2:
利用Logistic映射生成N个向量。Logistic映射如下:
\[X_{i+1}=\mu{X_{i}.*(1-X_{i})}
\]
Step 3:
将\(X\)的每个分量载波到变量的取值区间上
参数设置
Lb = -100; % 搜索空间下界
Ub = 100; % 搜索空间上界
N_iter = 1000; % 最大迭代次数
n_pop = 30; % 种群个数
d = 2; % 种群维度
利用混沌映射初始化种群
Z = zeros(n_pop, d);
% 随机生成一个d维向量
Z(1, :) = rand(1, d);
% 利用logistic生成n_pop个向量
for i=2:n_pop
Z(i,:) = 4.0*Z(i-1,:).*(1-Z(i-1,:));
end
% 将z的各个分量载波到对应变量的取值区间
pop = zeros(n_pop, d);
for i=1:n_pop
pop(i,:) = Lb + (Ub - Lb)*Z(i,:);
end
figure
scatter(pop(:,1), pop(:,2), 'r*');
box on
Logistic map的第二种写法:
particlePosition(1,:) = random('Uniform',-100, 100, 1, 2);
particlePosition(1,:) = (particlePosition(1,:) + 100)/200; %这是归一化处理
for i=1:49
particlePosition(i+1,:) = 4*particlePosition(i,:).*(1 - particlePosition(i,:));
end
particlePosition = particlePosition.*200 - 100;
figure
scatter(particlePosition(:,1), particlePosition(:,2));
box on
随机初始化种群
particlePosition = random('Uniform',-100, 100, 50, 2);
figure
scatter(particlePosition(:,1), particlePosition(:,2), 'r*');
box on