% -------------------------------------------------
% Citation details:
% Alireza Askarzadeh, Anovel metaheuristic method for solving constrained
% engineering optimization problems: Crow search algorithm, Computers &
% -------------------------------------------------
format long; close all; clear all; clc
pd=10; % Problem dimension (number of decision variables)
N=20; % Flock (population) size
AP=0.1; % Awareness probability
fl=2; % Flight length (fl)
[x l u]=init(N,pd); % Function for initialization
xn=x;
ft=fitness(xn,N,pd); % Function for fitness evaluation
mem=x; % Memory initialization
fit_mem=ft; % Fitness of memory positions
tmax=5000; % Maximum number of iterations (itermax)
for t=1:tmax
num=ceil(N*rand(1,N)); % Generation of random candidate crows for following (chasing)
for i=1:N
if rand>AP
xnew(i,:)= x(i,:)+fl*rand*(mem(num(i),:)-x(i,:)); % Generation of a new position for crow i (state 1)
else
for j=1:pd
xnew(i,j)=l-(l-u)*rand; % Generation of a new position for crow i (state 2)
end
end
end
xn=xnew;
ft=fitness(xn,N,pd); % Function for fitness evaluation of new solutions
for i=1:N % Update position and memory
if xnew(i,:)>=l & xnew(i,:)<=u
x(i,:)=xnew(i,:); % Update position
if ft(i)<fit_mem(i)
mem(i,:)=xnew(i,:); % Update memory
fit_mem(i)=ft(i);
end
end
end
ffit(t)=min(fit_mem); % Best found value until iteration t
min(fit_mem)
end
ngbest=find(fit_mem== min(fit_mem));
g_best=mem(ngbest(1),:); % Solutin of the problem
没有合适的资源?快使用搜索试试~ 我知道了~
【智能优化算法】Crow Search Algorithm matlab代码 上传.zip
共3个文件
m:3个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 94 浏览量
2022-10-16
10:06:38
上传
评论
收藏 1KB ZIP 举报
温馨提示
1.版本:matlab2019a,不会运行可私信 2.领域:【智能优化算法】 3.内容:Crow Search Algorithm matlab代码 4.适合人群:本科,硕士等教研学习使用
资源推荐
资源详情
资源评论
收起资源包目录
【智能优化算法】Crow Search Algorithm matlab代码 上传.zip (3个子文件)
init.m 270B
fitness.m 130B
CrowSearchAlgorithm.m 2KB
共 3 条
- 1
资源评论
天天Matlab科研工作室
- 粉丝: 3w+
- 资源: 7259
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功