Bionic swarm intelligence optimization algorithm is a hot issue in recent years. Its main idea is to study or imitate the social behavior of creatures living in groups in nature and construct a random search method. At present, there are two kinds of algorithms: ACO and PSO. Some research results show that bionic swarm intelligence optimization algorithm provides new ideas and methods for many application fields. In 2005, Indian scholars K.N.Krishnanand and D.Ghose proposed a new Swarm intelligence Optimization algorithm, Glowworm Swarm Optimization (GSO) algorithm, at the IEEE Swarm Intelligence Conference. In 2009, Xin-She Yang, a Cambridge scholar, proposed the Firefly Algorithm (FA) based on the luminous behavior of fireflies in nature. Since these two firefly algorithms were put forward, scholars from all over the world have studied, improved and applied them. After several years of development, firefly algorithm has a good application prospect in continuous space optimization process and some production scheduling. GSO and FA have similar aspects, but there are some differences in the concrete implementation. This paper introduces and analyzes these two algorithms and their improved algorithms.

GSO algorithm

In THE GSO algorithm, each artificial firefly walks in the solution space, and these fireflies are equipped with fluorescence and have their own line-of-sight range, called local-decision range. Their brightness is related to the target value at which they are located. The brighter the firefly is, the better its position is, that is, it has a better objective function value. Fireflies will look for the set of neighbors within the decision domain. In the set, the brighter the neighbor, the more attractive it is, will attract the firefly to move in this direction. The flight direction of each time will change with the different neighbors selected. In addition, the size of the decision-making domain was affected by the number of neighbors. When the density of neighbors was lower, the decision-making radius of fireflies would increase to find more neighbors. As the density of neighbors increases, its decision radius shrinks. Eventually, most fireflies gather in multiple locations to reach the extreme point. To put it simply, GSO algorithm mainly includes four stages: firefly deployment (initialization), fluorescein update, location update and decision radius update.

7.1.1 Flash mode

Over time, fireflies have evolved to control light emission in a variety of ways to produce different mating signals. They produce different signals by changing the following parameters:

  • Glowing colors;
  • Luminosity;
  • Male flare and female flare – phase difference;
  • Duration of each flash;
  • Number of flashes per cycle;
  • Flash time;
  • A sequence of continuous luminous or flashing pulses.

Kaipa and Ghose (2017) used different examples to describe these flashing patterns, such as using the Lampyrus firefly, a common firefly in Europe, where only females have the ability to emit light. She writhes in the grass, sweeping light from one direction to the other to attract the attention of wandering male fireflies. For the lamorustenebrosus fireflies, both males and females are luminescent, but the female is wingless and, similar to Lampyrus, uses light to attract mates. In some species, females use different patterns, such as long flashes of light, that are not completely extinguished during the interval. When the males can sense the pattern from 10 feet away, they fly toward the female. These flashing patterns are species-specific. In the species Photinus, for example, males initiate mating by crawling on the ground, emitting a variety of lights and observing signals from nearby females. In Photinus Consanguineus, the male emits two flashes, the male pauses, then emits two more flashes, and he repeats the pattern. After a second flash from the male, the female responds within a second. In Photinus Castus, the males emit long flashes of light, which the females immediately respond to. Although p. Consanguineus and P. Castus are very similar in structure, they are considered different species based on their luminous patterns. Although they often fly together, they don’t interbreed, but they are considered different species based on their luminous patterns, but they often fly together.

Group mate

One thing all of the species mentioned above have in common is that whoever is attracting the other, male or female, needs a constant line of sight so they can pick up the signal and respond. In areas of visual clutter, such as mangrove swamps in Southeast Asia, it’s not easy to get such uninterrupted sight. Thus, species found in these areas do not select individuals for mating. Instead, the fireflies stay in groups in trees or caves, so that the wandering fireflies can easily find mates. If there is no initial group, fireflies may form a nuclear cluster through mutual light attraction. There is competition in the formation of these groups, which leads to more than one larger group, and these larger groups further attract smaller nuclei nearby because they have a higher average light emission, meaning a higher likelihood of finding a mate.

Firefly swarm optimization algorithm

For the behavior of fireflies and fireflies, Krishnanand and Ghose (2005) [1] proposed Glowworm Swarm Optimization (GSO), which has been applied in many applications. Originally, GSO was developed to provide solutions to numerical optimization problems rather than to determine global optimality, but thanks to GSO’s decentralized decision making and mobility protocols, it has made more contributions in areas such as robotics.

Initially inspired by fireflies, GSO randomly distributes a group or group of agents in a random search space, and the agents interact with each other through other behavioral mechanisms that do not exist in their natural counterparts. The basic work of the algorithm is based on the following three mechanisms:

  1. Fitness Broadcast Fireflies have a pigment called luciferin that makes them glow. The content of luciferin in fireflies determines their fitness for location in the target space.
  2. Positive trending fireflies are attracted to their brighter neighbors, so they start moving toward them. When there are multiple such neighbors, it uses a probabilistic mechanism to select one.
  3. Adaptive neighborhood Each firefly uses an adaptive neighborhood to identify its neighbors, defined by a local decision domain with variable range RDI, bounded by a hard-limited perceptual range RS (0< RDI < RS). An appropriate heuristic can be used here to tune THE RDI. The movement of fireflies depends entirely on local information, and each firefly will choose a neighbor whose luciferin value is greater than its own and move toward it. These movements, based on available local information and selective neighbor interactions, enable firefly populations to aggregate into disjoint subgroups that move towards and meet on multiple optimal values of a given multi-peak function.

algorithm

Although the algorithm is interpreted to find multiple optimal solutions for multimodal functions, it can be used to minimize the problem with simple modifications. Initially, GSO placed fireflies randomly in the search space so that they were well distributed. Each firefly starts out with zero luciferin. The unit period of the algorithm includes fluorescein update stage, movement stage and neighborhood update stage, as shown in Figure 1.

FIG. 1 GSO algorithm flow

clc; clear; close all; %% Problem Definition model=CreateModel(); model.n=3; % number of Handle Points CostFunction=@(x) MyCost(x,model); % Cost Function nVar=model.n; % Number of Decision Variables VarSize=[1 nVar]; % Size of Decision Variables Matrix VarMin.x=model.xmin; % Lower Bound of Variables VarMax.x=model.xmax; % Upper Bound of Variables VarMin.y=model.ymin; % Lower Bound of Variables VarMax.y=model.ymax; % Upper Bound of Variables %% GSO Parameters MaxIt=50; % Maximum Number of Iterations nPop=100; % Population Size (Swarm Size) w=1; % Inertia Weight wdamp = 0.98; % anaesthetist Weight Damping Ratio C1 =1.5; % Personal Learning Coefficient c2=1.5; % Global Learning Coefficient %RANGE range_init = 5.0; Range_boundary = 50.2; %LUCIFERIN luciferin_init = 25; Luciferin_decay = 0.4; Luciferin_enhancement = 0.6; %Neighbors k_neigh = 20; Beta = 0.5; step_size = 5; %% Initialization % Create Empty Glowworm Structure empty_glowworm.Position=[]; empty_glowworm.range=[]; empty_glowworm.luciferin=[]; empty_glowworm.Cost=[]; empty_glowworm.Sol=[]; empty_glowworm.neighbors=[]; empty_glowworm.Best.Position=[]; empty_glowworm.Best.Cost=[]; empty_glowworm.Best.Sol=[]; % Initialize Global Best GlobalBest.Cost=inf; % Create glowworms Matrix glowworm=repmat(empty_glowworm,nPop,1); % Initialization Loop for i=1:nPop % Initialize Position if i > 1 glowworm(i).Position=CreateRandomSolution(model); else % Straight line from source to destination xx = linspace(model.xs, model.xt, model.n+2); yy = linspace(model.ys, model.yt, model.n+2); glowworm(i).Position.x = xx(2:end-1); glowworm(i).Position.y = yy(2:end-1); end % Initialize luciferin glowworm(i).luciferin.x=repmat( luciferin_init , 1 , nVar); glowworm(i).luciferin.y=repmat( luciferin_init , 1 , nVar); %Initialize range glowworm(i).range.x = repmat( range_init , 1 , nVar); glowworm(i).range.y = repmat( range_init , 1 , nVar); neighbors = []; % Evaluation [glowworm(i).Cost, glowworm(i).Sol]=CostFunction(glowworm(i).Position); % Update Personal Best glowworm(i).Best.Position=glowworm(i).Position; glowworm(i).Best.Cost=glowworm(i).Cost; glowworm(i).Best.Sol=glowworm(i).Sol; % Update Global Best if glowworm(i).Best.Cost<GlobalBest.Cost GlobalBest=glowworm(i).Best; end end % Array to Hold Best Cost Values at Each Iteration BestCost=zeros(MaxIt,1); for it=1:MaxIt for i=1:nPop % x Part % Update luciferin %disp(glowworm(i).luciferin.x); glowworm(i).luciferin.x = (1-luciferin_decay).*glowworm(i).luciferin.x + luciferin_enhancement.*(glowworm(i).Cost/10); %disp(glowworm(i).luciferin.x); For p = 1:nVar glowworm(I).range. Y (p) = min(range_boundary, Max (0.1,glowworm(I).range (beta*(k_neigh-size(neighbors.y,1))))); end %disp(glowworm(i).range.y); % Evaluation [glowworm(i).Cost, glowworm(i).Sol]=CostFunction(glowworm(i).Position); % Update Personal Best if glowworm(i).Cost<glowworm(i).Best.Cost glowworm(i).Best.Position=glowworm(i).Position; glowworm(i).Best.Cost=glowworm(i).Cost; glowworm(i).Best.Sol=glowworm(i).Sol; end % Update Global Best if glowworm(i).Best.Cost<GlobalBest.Cost %disp(glowworm(i).luciferin); GlobalBest=glowworm(i).Best; end end % Update Best Cost Ever Found BestCost(it)=GlobalBest.Cost; % Show Iteration Information if GlobalBest.Sol.IsFeasible Flag=' *'; else Flag=[', Violation = ' num2str(GlobalBest.Sol.Violation)]; end disp(['Iteration ' num2str(it) ': Best Cost = ' num2str(BestCost(it)) Flag]); % Plot Solution figure(1); PlotSolution(GlobalBest.Sol,model); Pause (0.01); end %% Results figure; plot(BestCost,'LineWidth',2); xlabel('Iteration'); ylabel('Best Cost'); grid on;Copy the code

Complete code or simulation consultation QQ1575304183