A list,

The cuckoo (cuckoo) is a very fascinating bird, not only can they produce a variety of sounds or calls, but also can reproduce in different ways. The Ani Cuckoo and Guira Cuckoo in the Cuckoo family place their eggs in the nests of other birds, from which the Cuckoo’s eggs are completely dependent on the care of the host bird. This is nestparasitizing.

If the host bird finds the egg is not theirs, it either throws the egg away or abandons the nest, and the host bird builds a new nest. To prevent this from happening, female cuckoos have evolved to mimic the color and texture of their host eggs, thereby reducing the likelihood of being abandoned. Eggs will also be distributed in different nests to reduce the chance of egg loss. If the cuckoo’s egg is not recognized, it will usually hatch before the host egg and kick the other eggs out of the nest so that they can get a greater share of the food. Some cuckoo chicks even mimic the calls of their host chicks.

One benefit of nest parasitism is that parents do not need to invest in nesting or feeding their young. They can spend more time hunting and reproducing. Over time, natural selection has enabled both host birds and cuckoos to evolve, so that the most suitable bird from each generation survives. This breeding behavior of the cuckoo is one of the best models of coevolution and is the basis for a recently developed optimization technique called cuckoo search.

2. Artificial cuckoo search Cuckoo search is a novel swarm based optimization technique proposed by Xin-she Yang and Suash Deb (2009)[2], which is inspired by the nest-parasitical behavior of cuckoos and the Levy Flight behavior of some birds and fruit flies.

The cuckoo algorithm is based on three rules [3] : each cuckoo lays an egg one at a time and places it in a randomly selected nest; The best nests with the best quality eggs go into the next generation; The number of host nests available is fixed, and the host finds cuckoo eggs with probability pa∈(0,1). In this case, the host may destroy the egg or abandon the old nest to build a new one. Before going further into the algorithm, let’s discuss some mathematical terms and functions.

2.1 Random Variable The output of any random phenomenon is a random variable and is represented by X. If a random variable takes only different values, say 1,2, then it is discrete; If it can take any value in an interval, then it’s continuous. These are usually expressed as areas under the curve or integrals. The probability that the random variable X is on A set of outcomes, A, is the area between A and under this curve, the total area under this curve has to be 1, and it shouldn’t have A negative value for any member of set A. Such a curve is called a density curve.

2.2 Random Walk A random walk (denoted SN) is the sum of a series of random steps, each of which is expressed by a random variable Xi:The length of a random walk can be fixed or variable (depending on the step size).

2.2.1 Power Law When the relative change of one quantity leads to the relative change of two quantities in proportion, the power law (proportional law) needs to be applied. The general form of the power law distribution is:Where X and Y are target variables, α is law exponent, and k is constant.

2.3 Herviside functions (step functions) are usually expressed in terms of H or θ and are used to express piecewise constant functions or generalized functions. As a piecewise function:

The Levy distribution is a stable continuous probability distribution of a non-negative random variable and can be expressed in the following simple way:

Where µ is the minimum step size and γ is the scale parameter.

6.2.4.1 Levy Flight Levy flight is a random walk with a Levy distribution of step size, expressed as follows:Where beta is an index.

Ii. Source code

% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % CLSCS algorithm core - % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % function [ keepglobal] = Cuckoo_search( popsize,pa,xMin,xMax,iter_max,dim,fun ) LB=xMin*ones(1,dim);
     UB=xMax*ones(1,dim);
     u=3; % chaos coefficient fitness= INF *ones(popsize,1); % Initial fitness value % Random initial valuefor i=1:popsize, nest(i,:)=LB+(UB-LB).*rand(size(LB)); End % to get the optimal solution [fbest bestnest, nest, fitness] = get_best_nest (nest nest, fitness, fun); keepglobal(1)=fbest;
    
    fprintf('Run = %d Save_Nr_best = %e\n'.1, fbest); %% starts the loopfor i=2New_nest =get_cuckoos(nest,bestnest,LB,UB,iter_max, I); New_nest = DCXF (popsize,new_nest,fun); [f_min,best,nest,fitness]=get_best_nest(nest,new_nest,fitness,fun); % Find and randomly select NEW_NEST = empty_INFO (Nest,LB,UB, PA, Iter_max, I, FITNESS); [f_min,best,nest,fitness]=get_best_nest(nest,new_nest,fitness,fun); % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % for the optimal position of particle swarm chaos optimization (y1,:)=(best-xMin)/(xMax-xMin); % Map the optimal position to the domain of the Logistic equation [0.1]
      fitness_c(1)=func(y(1,:),fun); 
        for t=1:popsize- 1% After M iterations of the Logistic equation, the chaotic sequence is obtainedfor e=1:dim
                 y(t+1,e)=u*y(t,e)*(1-y(t,e)); 
            end
              y(t+1, :)=xMin+(xMax-xMin)*y(t+1, :); % Invert the chaotic sequence into the original solution space fitness_c(t+1)=func(y(t+1,:),fun); % Calculate the fitness value of feasible solution sequence of chaos variable end [ybestFitness ybestindex]=min(fitness_c); % To find the optimal feasible solution vector of chaosif ybestfitness<f_min
            f_min=ybestfitness;
            best=y(ybestindex,:);
        end
        function [fit] = func(x, fun)
%benchmark functions

% Developed by: Dr. Mahamed G.H. Omran ([email protected]) 12-May- 2011.
% Modified and improved by: Maurice Clerc (15-May- 2011.)

% x is a D-dimensional vector representing the solution we want to evalaute
% fun is the indix of the function of interest
% fit is the fitness of x (i.e. fit = f(x))

D = length(x);

switch(fun)
%     case {1.2.3.4.5.6.7.8.9.10.11.12.13.14}, % CEC'05 functions
        % NOTE:
        % For these functions to work, you need to include the following
        % lines in your file:
        % global  initial_flag
        % initial_flag = 0;
        % In addition, vector x should be x(1,D) where D is the problem's
        % dimension
%         fit = benchmark_func(x, fun);
    case {1}, % Sphere function
        fit = sum(x.^2);
    case {2}, % Rastrigin
        fit = 10*D + sum(x.^2 - 10*cos(2.*pi.*x));
    case {3}, %Step
        fit = sum(floor(x + 0.5). ^2);
    case {4}, %Rosenbrock
        f = 0;
        for i = 1:1:D- 1
            f = f + 100*((x(i+1) - x(i)^2) ^2) + (1 - x(i))^2;
        end
        fit = f;
    case {5}, %Ackley
       fit = - 20*exp(0.2*sqrt(sum(x.^2)/D)) - exp(sum(cos(2*pi .*x))/D) + 20 + exp(1);
    case {6}, %Griewank
        sum1 = 0;
        prod1 = 1;
        for i = 1:1:D
            sum1 = sum1 + (x(i)^2/4000);
            prod1 = prod1*cos(x(i)/sqrt(i));
        end
        fit = sum1 - prod1 + 1;
    case {7}, %Salomon
        fit = -cos(2*pi*sqrt(sum(x.^2))) + 0.1*sqrt(sum(x.^2)) + 1;
    case {8}, %Quartic function
        sum1 = 0;
        for i = 1:1:D
            sum1 = sum1 + i*x(i)^4;
        end
        fit = sum1 + rand();
    case {9}, %Alpine
        sum1 = 0;
        for i=1:1:D
            sum1 = sum1 + abs(x(i)*sin(x(i)) + 0.1*x(i));
        end
        fit = sum1;
   case {10}, %Six Hump Camel bsck
        fit = 4*x(1). ^2 - 2.1*x(1). ^4 + (1/3)*x(1). ^6 + x(1)*x(2) - 4*x(2) ^2 + 4*x(2). ^4;
    case {11}, % Branin
        fit = (x(2) - (5.1/ (4*pi^2))*x(1) ^2+5*x(1)/pi- 6) ^2+10* (1- 1/ (8*pi))*cos(x(1)) +10;
    case {12}, % Shubert
        sum0 = 0;
        sum1 = 0;
        for j=1:1:5
            sum0 = sum0 + j*cos((j+1)*x(1) + j);
            sum1 = sum1 + j*cos((j+1)*x(2) + j);
        end
        fit = sum0*sum1;
    case {13}, % Easom
        fit = -cos(x(1)) *cos(x(2)) *exp(-((x(1) - pi)^2 + (x(2) - pi)^2));
    case {14}, % Shekel function
% Matlab Code by A. Hedar (Nov. 23.2005).
% The number of variables n = 4
% The parameter m should be adjusted m = 5.7.10.
% The default value of m = 10.
% 
m = 10;
a = ones(10.4);
a(1, :) =4.0*a(1, :); a(2, :) =1.0*a(2, :); a(3, :) =8.0*a(3, :); a(4, :) =6.0*a(4, :);for j = 1:2;
   a(5.2*j- 1) = 3.0; a(5.2*j) = 7.0; 
   a(6.2*j- 1) = 2.0; a(6.2*j) = 9.0; 
   a(7,j)     = 5.0; a(7,j+2) = 3.0;
   a(8.2*j- 1) = 8.0; a(8.2*j) = 1.0;
   a(9.2*j- 1) = 6.0; a(9.2*j) = 2.0;
   a(10.2*j- 1) =7.0; a(10.2*j)= 3.6;
end
c(1) = 0.1; c(2) = 0.2; c(3) = 0.2; c(4) = 0.4; c(5) = 0.4;
c(6) = 0.6; c(7) = 0.3; c(8) = 0.7; c(9) = 0.5; c(10) =0.5;
s = 0;
for j = 1:m;
   p = 0;
   for i = 1:4
      p = p+(x(i)-a(j,i))^2;
   end
   s = s+1/(p+c(j));
end
fit = -s;

    otherwise,
        error('No such function');
        fit = - 1;
end

% fit=abs(fit-opt_f);

end

Copy the code

Third, the operation result

Fourth, note

Version: 2014 a