% For more information see %'Multiobjective cuckoo search for design optimization Xin-She Yang, Suash Deb' % Coded by Hemanth Manjunatha on Nov 13 2015 % This code returns 'n' levy flight steps % Note: 1< beta < 2 n=5; beta=1.5; close all num = gamma(1+beta)*sin(pi*beta/2); % used for Numerator den = gamma((1+beta)/2)*beta*2^((beta-1)/2); % used for Denominator sigma_u = (num/den)^(1/beta);% Standard deviation m = 2;% Change the value to get levy steps in higher dimension u = random('Normal',0,sigma_u^2,n,m); v = random('Normal',0,1,n,m); z = u./(abs(v).^(1/beta));
% Sample plotting [x,y] = deal(zeros(n,1)); x(1) = 1; y(1) = 1; for i = 1:n x(i+1) = x(i) + z(i,1); y(i+1) = y(i) + z(i,2); end line(x,y) end
Mental Math: How to Develop a Mind for Numbers, Rapid Calculations and Creative Math Tricks (Including Special Speed Math for SAT, GMAT and GRE Students)