how to select values of alpha beta and gamma values in firefly algorithm
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
hi
i hope everyone is fit and fine. i am writing a matlab program in which i have to bring three variable on to particular target. for that i use firefly algorithm. here three variables (p1,p2,p3) are taken and there values are (10,15,20) and at the end of iteration all will be (50,50,50), but unfortunately the response which is desired is not obtain. i think the issues is of the proper selection of alpha beta and gamma. can any body help me in this regard i will be highly thankful
Regards Mudasir
clc
clear
p1=10;
p2=15;
p3=20;
t=50;
b0=1;
gamab=1; %initial
gamae=1.1; %final
alphab=0.5
alphae=0.3
for i=1:1000
d1=t-p1;
r1=sqrt((d1)^2);
d2=t-p2;
r2=sqrt((d2)^2);
d3=t-p3;
r3=sqrt((d3)^2);
gama=gamab+((gamae-gamab)*i)/50;
alpha=alphab+((alphae-alphab)*i)/50;
c=gama^r1;
b1=b0*exp(-c)
d=gama^r2;
b2=b0*exp(-d)
e=gama^r3;
b3=b0*exp(-e)
A=[b1 b2 b3];
B=[p1 p2 p3];
J=max(A)
[m1 n1]=size(B);
for y=1:n1
if A(1,y)== J;
gbestx=B(1,y)
else
end
end
p1=p1+(b1*(gbestx-p1))+alpha*(rand-0.5)
p2=p2+(b2*(gbestx-p2))+alpha*(rand-0.5)
p3=p3+(b3*(gbestx-p3))+alpha*(rand-0.5)
end
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!