Multi-policy improved mayfly algorithm based on memory mechanism
Patent Information
- Application Number
- PCT/CN2024/092786
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-03-08
- Filing Date
- 2024-05-13
- Publication Date
- 2025-10-02
AI Technical Summary
The existing Mayfly algorithm has the problems of low execution efficiency, low solution quality and weak population synergy in UAV task allocation, and cannot balance the relationship between global search and local development.
An improved mayfly algorithm based on a multi-strategy memory mechanism is adopted. The population is initialized by cubic chaos map, and the ε-greedy strategy and memory population update strategy are combined to enhance the global and local search capabilities and improve the synergy between populations.
The solution accuracy and efficiency of UAV task allocation are improved, the convergence time is shortened, unnecessary searches are avoided, and the stability and search capability of the algorithm are enhanced.
Smart Images

Figure CN2024092786_02102025_PF_FP_ABST
Abstract
Description
A multi-strategy improved mayfly algorithm based on memory mechanism
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on March 8, 2024, with application number 202410264841.7 and invention name “A Multi-Strategy Improved Mayfly Algorithm Based on Memory Mechanism”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present invention belongs to the field of swarm intelligence algorithms, and in particular relates to a multi-strategy improved mayfly algorithm based on a memory mechanism. Background Art
[0003] With the rapid development of unmanned systems, drones (UAVs) have been widely used in modern warfare. Their high maneuverability and flexibility have made them a crucial weapon in the military. However, as mission demands increase, individual UAVs are limited in terms of energy, detection range, and payload capacity. To more effectively accomplish complex missions, multiple heterogeneous UAVs must collaborate. Therefore, mission planning for multi-UAV coordinated operations is a crucial issue and has attracted considerable research attention.
[0004] Mission planning, based on battlefield situational awareness and mission analysis, aims to plan forces according to mission requirements. Mission planning primarily encompasses two aspects: task allocation and path planning. Task allocation addresses the "correspondence" between drones and missions, determining the mapping relationship between drones and targets, as well as the timing of drone mission execution. In the case of multiple drones, task allocation aims to assign multiple drones to a set of mission sequences, maximizing mission execution efficiency at minimal cost. Path planning is the process of designing or generating a path between a series of locations while meeting internal or external constraints such as maximum linear velocity, maximum angular velocity, operational safety, time, and environmental variables.
[0005] According to the literature Zervoudakis K, Tsafarakis SA mayfly optimization algorithm[J].Computers&Industrial Engineering,2020,145:106559, the Mayfly Algorithm (MA) is a new intelligent algorithm proposed based on the flight and mating behaviors of female and male mayflies. It has strong local convergence and full development capabilities. A previous literature (Zhou D,Kang Z,Su X,et al.An enhanced Mayfly optimization algorithm based on orthogonal learning and chaotic exploitation strategy[J].International Journal of Machine Learning and Cybernetics,2022,13(11):3625-3643.) integrated two effective strategies into the basic Mayfly algorithm to enhance the algorithm performance. First, orthogonal learning is applied to increase the diversity of primary male mayfly operators, guiding them to move more stably rather than oscillating. Second, chaotic development is introduced to form new positions for offspring, improving search capabilities. This paper addresses the problems of the mayfly algorithm and proposes an improved mayfly algorithm that combines the gray wolf optimization algorithm (MA-GWO). The mayfly algorithm incorporates the Levy flight strategy and the hunting mechanism of the gray wolf optimization algorithm to achieve complementary advantages. To improve the diversity and performance of the mayfly algorithm (MA), this paper adopts a mutation strategy within the MA process. This strategy uses adversarial learning (OBL) and Cauchy mutation strategies to mutate the global optimal solution, and uses an artificial mutation operator in the offspring population. This paper addresses the low convergence efficiency and insufficient search capabilities of existing mayfly algorithms and proposes an improved version of the mayfly algorithm, the golden annealing crossover mutation mayfly algorithm (GSASMA).
[0006] Although the above improved algorithm has been proven to be effective, it still has problems such as low execution efficiency and low solution quality. In addition, the synergy between populations is weak and it is impossible to balance the relationship between global search and local development.
[0007] Summary of the Invention
[0008] In order to solve the above problems, the present invention proposes an improved Mayfly Algorithm (MMA) based on the memory mechanism, aiming to improve the global search capability and local search capability of the algorithm, so as to better solve the UAV task allocation problem.
[0009] The technical solution is as follows:
[0010] A multi-strategy improved mayfly algorithm based on memory mechanism is applied to MMA to solve the UAV task allocation problem. The specific process includes:
[0011] S1: Determine the basic parameters of the UAV task allocation problem; the basic parameters include map size, UAV flight speed, target point location, and UAV location;
[0012] S2: Determine the influencing parameter values of the Mayfly algorithm; the influencing parameter values include inertia weight, dance coefficient, and social positive attraction coefficient;
[0013] S3: using chaos initialization to randomly generate mayfly positions, obtaining the task allocation scheme corresponding to each mayfly position through decoding, and obtaining the corresponding fitness value according to the scheme;
[0014] S4: Constructing a memory population based on a memory mechanism; the memory population includes a positive memory population and a negative memory population; calculating the probability of each mayfly joining the positive memory population, generating a positive memory population, and generating a negative memory population through the positive memory population;
[0015] S5: Integrate the ε-greedy strategy into the mayfly position update formula and update the mayfly position;
[0016] S6: Sort the male and female mayflies according to their fitness values and cross them, and calculate the fitness values of the newly generated mayflies through the decoding function;
[0017] S7: Performing Gaussian mutation on the newly generated mayfly individuals and calculating the fitness values of the mutated individuals; distributing these mutated individuals into male and female mayfly populations, and replacing individuals with poor fitness with individuals with better fitness to maintain the population size unchanged; wherein the smaller the fitness value, the better;
[0018] S8: Sort the forward and reverse memory populations generated in the previous iteration according to similarity; determine whether the mayfly with the greatest similarity in the current forward memory population is consistent with the mayfly with the highest fitness, and update the original reverse memory population using the reverse memory population update strategy; update the forward and reverse memory populations;
[0019] S9: Determine whether the termination condition is met. If so, the process stops; otherwise, return to S4.
[0020] Furthermore, the chaos initialization is specifically to initialize MA using cubic chaos map, and the initialization function is:
[0021] Obtain the fitness value y(n) through the above initialization function, and use Y in is the number of floats; y(n+1) is the position information of the n+1th float.
[0022] Furthermore, in step S3, the decoding method is a decoding method based on one-dimensional vector position information, which aims to reasonably allocate N tasks to M drones, and realize the allocation of tasks and determination of the drone execution order by iterating the position information X;
[0023] The specific steps are as follows:
[0024] S301 input information:
[0025] Number of drones: M (assuming there are M drones available);
[0026] Number of tasks: N (a total of N tasks need to be assigned to drones for execution);
[0027] Position information vector X: a one-dimensional vector of length N, whose element values range from 0 to M;
[0028] S302 Assignment Tasks:
[0029] In this step, the position information vector X is first rounded down, that is, the real value is converted into an integer to obtain the drone number assigned to each task, X i =j means that the i-th task is assigned to the j-th UAV for execution, thereby assigning N tasks to M UAVs to ensure that each task is executed;
[0030] S303 Determine the execution order of multiple tasks:
[0031] For those drones assigned multiple tasks, the sizes of their original data (real values before rounding) in the position information vector X are compared, and the order of multi-task execution is sorted according to the size of the original data in the position information vector X. The drones with larger original data are executed first. This ensures that the drones execute their multiple tasks in a certain order, thereby optimizing the task execution efficiency.
[0032] Furthermore, in step S4, the method for generating the positive memory population specifically includes: constructing an initial positive memory population OM while initializing the mayflies, calculating the fitness value Y of each mayfly i , and the similarity H between each mayfly and the best mayfly individual i , thereby determining the probability P of each mayfly joining the positive memory population OM,i ,
[0033] Specifically: using the fitness value Y i The absolute value of the difference between the two is used to express the similarity H between each mayfly individual in the population and the best individuali , the calculation formula is as follows: H i =|Y i -Y lead | (2)
[0034] Where i is the size of the mayfly population, Y i represents the fitness value of the mayfly, Y lead Represents the fitness value of the best individual.
[0035] Furthermore, in step S4, the method for generating the reverse memory population specifically includes: defining the reverse memory population as RM, the position of each reverse memory mayfly is generated by relying on the forward memory mayfly, and the reverse memory population is kept updated synchronously with the forward memory population;
[0036] The various dimensions of the reverse memory ephemera The calculation formula is as follows:
[0037] Among them, max _ rm d Represents the maximum value of the reverse memory mayfly in d dimension, min _ rm d represents the minimum value of the reverse memory mayfly in d dimension, It is the value of the forward memory ephemera corresponding to the reverse memory ephemera.
[0038] Furthermore, a new population update strategy is set based on the constructed positive memory population and reverse memory population; a dynamic memory population update factor β is set m , memory population replacement update R m Only remember the mayfly, the calculation formula is as follows:
[0039] Among them, the random number within rand∈(0,1), ω and ρ are constant coefficients, n is the mayfly population, and t is the number of iterations.
[0040] Furthermore, the method of the new population update strategy specifically includes:
[0041] After each iteration is completed, the new similarity H is calculated for the forward memory population and reverse memory population generated in the previous iteration. i , and according to the similarity H i Sort by size;
[0042] Determine the current fitness Y i The highest similarity H between the mayfly and the positive memory population iAre the largest mayflies the same?
[0043] If they are the same, the memory population is not introduced;
[0044] If they are different, select the similarity H in the positive memory population i The largest front R m Only the mayfly is replaced and R is randomly selected from the original population. m Only mayflies, using the reverse memory population with the largest similarity R m Only the mayfly performs position updates;
[0045] After each population update, the forward and reverse memory populations are updated.
[0046] Furthermore, in step S5, the ε-greedy strategy includes:
[0047] Set a probability ε (0 < ε < 1). When the subject makes a decision, it explores unknown behaviors with a small probability ε. In addition, it selects the action with the highest value from the previous actions with a probability of 1-ε.
[0048] The specific improvement process includes the following steps: assign a random probability P to mayfly i i , and set the probability ε, where ε increases from 0.1 to 0.9 with the number of iterations; when P is satisfied i ≥ε, mayfly i is given a larger inertia weight, which increases its step size and makes its global search ability stronger; when P i When ε<ε, the mayfly is given a smaller inertia weight, which reduces its step size and makes the local search ability stronger. As the number of iterations increases, ε gradually increases, and most mayflies have stronger local search ability, while other mayflies have larger inertia coefficients. Since each mayfly has a random probability, they can have larger or smaller inertia weights during the iteration process. The formula is as follows:
[0049] Among them, ε min is 0.1, ε max is 0.9; iter is the current number of iterations, MaxIter is the maximum number of iterations, g is the inertia weight of mayfly i, g l is the larger inertia weight; g s is the smaller inertia weight. i is the random probability of mayfly i.
[0050] The beneficial effects of the present invention are as follows: the multi-strategy improved mayfly algorithm based on the memory mechanism described in the present invention uses a cubic chaotic map to initialize the mayfly population so that the population is evenly distributed in the solution space, thereby improving the early global search capability; secondly, the present invention introduces a greedy strategy to enhance the early global search capability and the later local search capability in an adaptive manner; finally, the present invention adds a memory mechanism to increase the synergy between populations, thereby accelerating the convergence speed and avoiding unnecessary searches.
[0051] Figures in the specification
[0052] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and detailed embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be derived from these drawings without inventive effort. Among them:
[0053] Figure 1 is a schematic diagram of the initial coordinate points in this application;
[0054] Figure 2 is a graph a showing the fitness values of each algorithm;
[0055] Figure 3 is a diagram of the task allocation results;
[0056] Figure 4 is a graph b showing the fitness value of each algorithm. DETAILED DESCRIPTION
[0057] To make the objectives, technical solutions, and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the present invention and are not intended to limit the present invention. The multi-strategy improved mayfly algorithm based on a memory mechanism is further described below with reference to Figures 1-4.
[0058] A multi-strategy improved mayfly algorithm based on memory mechanism. The technical solution is as follows:
[0059] 1. Chaos initialization.
[0060] In the original MA, the positions of the mayflies are generated through random initialization, which results in uneven distribution of their positions and reduces the accuracy of the solution. However, chaotic sequences based on chaos theory have characteristics such as pseudo-randomness and boundary properties. Therefore, many researchers have proposed various algorithms for embedding chaotic sequences. The advantages of chaotic mapping are as follows:
[0061] (1) Chaotic mapping has better randomness and uniformity: Compared with ordinary random functions, chaotic mapping has better randomness and uniformity, which can better ensure the uniform distribution of the positions of mayflies, thereby improving the solution accuracy of the algorithm.
[0062] (2) Chaotic mapping has better boundary properties: the value range of chaotic mapping is usually [0,1] or [-1,1], which can well meet the boundary restrictions of the solution space, thus avoiding the problem of the mayfly position exceeding the solution space.
[0063] (3) Chaotic mapping has better stability: Chaotic mapping has an iterative calculation process, which can generate more complex random sequences in the process of continuous iteration, thereby improving the stability and convergence speed of the algorithm.
[0064] Among many chaotic maps, cubic mapping has better performance. Therefore, the present invention uses cubic chaotic mapping to initialize MA. The initialization function is as follows:
[0065] 2. Implement the ε-greedy strategy.
[0066] The ε-greedy strategy achieves a balance between exploration and exploitation based on probability. It sets a probability ε (0 < ε < 1). When the agent makes a decision, it explores unknown actions with a small probability ε. Furthermore, it selects the action with the highest value from previous actions with a probability of 1-ε. The ε-greedy strategy aims to execute all possible actions in a given state, thus ensuring continuous exploration.
[0067] The specific improvement process is as follows: assign a random probability P to mayfly i i , and set the probability ε, where ε increases from 0.1 to 0.9 with the number of iterations. i ≥ε, ephemera i is given a larger inertia weight, which increases its step size and makes its global search capability stronger. i When ε is less than ε, the mayflies are given a smaller inertia weight, which reduces their step size and makes their local search ability stronger. Since ε is small in the early stages of the iteration, most mayflies have stronger global search capabilities. At the same time, other mayflies will search in the local space, which can significantly explore the possibility of the optimal solution in the local space. As the number of iterations increases, ε gradually increases. As ε becomes larger in the later stages, most mayflies have stronger local search capabilities. At the same time, other mayflies have a larger inertia coefficient. It enables them to jump out of the local space to find a new space, thereby reducing the possibility of falling into the local optimal solution. Since each mayfly has a random probability, they can have a larger or smaller inertia weight during the iteration process. The mathematical formula is as follows:
[0068] The minimum value of ε is 0.1, and the maximum value of ε is 0.9; iter is the current number of iterations, MaxIter is the maximum number of iterations, g is the inertia weight of mayfly i, and g l is the larger inertia weight; g sis the smaller inertia weight. i is the random probability of mayfly i.
[0069] 3. Population update strategy based on memory mechanism.
[0070] The population update strategy includes the forward memory population OM update strategy and the reverse memory population RM update strategy.
[0071] The traditional Mayfly algorithm does not save the memory during the search process. At the same time, in order to increase the synergy between populations, it is proposed to build a memory population based on the memory mechanism, including a positive memory population and a reverse memory population. The absolute value of the fitness value difference is used to represent the similarity between the population individual and the best individual. The calculation formula is as follows: H i =|Y i -Y lead | (4)
[0072] Among them, Y i represents the fitness value of the mayfly, Y lead Represents the fitness value of the best individual.
[0073] (Ⅰ) Forward memory population OM update strategy.
[0074] When the mayfly is initialized, the initial forward memory population OM is constructed, the cubic chaos map is initialized, and the fitness value Y of each mayfly is calculated. i and similarity H i (i is the size of the mayfly population), thereby determining the probability P of each mayfly joining the positive memory population OM,i , the specific formula is as follows:
[0075] In traditional memory mechanisms, the memory population is updated after each iteration. However, because the differences between individuals between iterations are minimal, updating each time results in an excessively high update frequency, making most individuals in the memory population relatively similar, potentially containing a lot of redundant information and resulting in poor population diversity. To address this issue, a forward memory population is employed to reduce the frequency of individual updates, thereby improving the algorithm's efficiency and accuracy.
[0076] (II) Reverse memory population RM update strategy.
[0077] Previous literature has demonstrated from probability statistics that the reverse population and the evolving population have the same probability of fitting to the optimal solution, so the mayflies in the reverse population and the mayflies in the forward population have the same probability of finding the optimal solution. The reverse memory population is defined as RM, where the position of each reverse memory mayfly is generated by the forward memory mayfly, and the reverse and forward memory populations are kept updated synchronously. The calculation formula is as follows:
[0078] Among them, max _ rm d and min _ rm d represent the maximum and minimum values of the reverse memory mayfly in d dimension respectively, It is the corresponding positive memory mayfly.
[0079] According to the above constructed positive memory population and reverse memory population, a new population update strategy is set, and the dynamic memory population update factor β is set. m , memory population replacement update R m Only remember the mayfly, the calculation formula is as follows:
[0080] In formulas (7) and (8): Random numbers within rand∈(0,1), ω and ρ are constant coefficients, n is the mayfly population, and t is the number of iterations.
[0081] The specific method of the reverse memory population RM update strategy is: after each iteration is completed, recalculate the similarity H between the forward and reverse memory populations generated in the previous iteration i , and sort them by similarity. If the current fitness Y i If the highest mayfly is the same as the one with the highest similarity in the positive memory population, the memory population will not be introduced. If they are different, the top R with the highest similarity in the positive memory population will be selected. m Only the mayfly is replaced and R is randomly selected from the original population. m Only mayflies, using the reverse memory population with the highest similarity R m Only the position of the mayfly is updated. Finally, the forward and reverse memory populations are updated after each population update.
[0082] This method can ensure the diversity of individuals in the memory population and improve the algorithm's search accuracy and efficiency. Using similarity as a criterion for selecting memory mayflies makes individuals in the memory population more representative and avoids the problem of information redundancy.
[0083] In summary, the process of solving the UAV task allocation problem with the improved MMA is as follows:
[0084] Step 1: Determine the parameter values of the UAV task allocation problem, including map size, UAV flight speed, target point and UAV location, etc.
[0085] Step 2: Determine the parameter values of the Mayfly algorithm, including inertia weight, dance coefficient, and social positive attraction coefficient.
[0086] Step 3: Use formula (1) to initialize chaos and randomly generate the positions of mayflies. Use the decoding function to obtain the task allocation plan corresponding to each mayfly position, and then obtain the fitness value according to the plan. Use formula (5) to calculate the probability of each mayfly joining the positive memory population and generate the positive memory population. Generate the reverse memory population from the positive memory population.
[0087] Step 4: Integrate the ε-greedy strategy into the mayfly position update formula and update the mayfly position. For details, refer to formula (2) and formula (3).
[0088] Step 5: Sort the male and female mayflies by fitness value and cross them, and calculate the fitness value of the newly generated mayfly individuals through the decoding function. The smaller the fitness value, the better the fitness.
[0089] Step 6: Perform Gaussian mutation on the newly generated mayfly individuals and calculate their fitness. These mutated individuals are then distributed to the male and female populations, and individuals with better fitness are used to replace those with poor fitness to maintain the population size.
[0090] Step 7: The forward and reverse memory populations generated in the previous iteration are sorted according to the similarity H i Sort by size. Determine whether the current mayfly with the highest fitness is consistent with the mayfly with the greatest similarity in the positive memory population, and update the original reverse memory population using the reverse memory population update strategy. Update the positive and reverse memory populations.
[0091] Step 8: Determine whether the termination condition is met. If so, stop; otherwise, return to Step 4.
[0092] 1. Evaluation indicators.
[0093] In combat scenarios, drones often need to gather intelligence and information about the enemy in enemy territory to effectively strike targets. Once this comprehensive intelligence is gathered, they can then conduct precision strikes against the enemy. To maximize efficiency, the order in which each drone performs its missions must be rationally arranged. To avoid wasting resources, drones should be minimized whenever possible, ensuring that the fewest drones possible are used to execute the mission effectively. After completing their mission, drones must return to their starting point for recovery.
[0094] 2. Description of the problem.
[0095] Assuming that the total number of mission areas is N and the number of drones is M, each sub-task area can be simplified to a point T. When a drone reaches the point directly above the point at a certain flight altitude, it is considered to have reached the area. These points constitute a mission set T = {T1, T2, T3, ..., T N}, by reasonably allocating task areas to reduce the transfer of UAVs between areas, that is, to ensure that the total cost of all UAVs is minimized, the multi-UAV task allocation problem can be converted into MTSP for solution.
[0096] MTSP is a further extension of TSP. In MTSP, the task sequence corresponding to the UAV can be expressed as Indicates the last mission point of drone a, k a Indicates the number of tasks that UAV a needs to perform.
[0097] (1) Constraints.
[0098] Each mission requires a drone to perform, so:
[0099] At the same time, the flight distance of each drone cannot exceed the prescribed maximum flight distance:
[0100] (2)Objective function.
[0101] In practical applications, when a drone performs a search mission, it often takes off from outside the mission area and then visits the mission area in sequence, visiting each mission area only once. After completing the last mission, the drone returns to the starting position. The path cost P corresponding to drone a is a for:
[0102] in, It means that drone a starts from the starting point s a Go to the first mission point T1 a distance; Indicates that UAV a is from the mission point Return to starting point a distance; Indicates that UAV a is from the mission point arrive The distance calculation formula is as follows:
[0103] At the same time, each mission point requires a drone to perform the mission, but not every drone needs to perform the mission. Therefore, each drone must have a startup cost B a .
[0104] Taking the total path cost and startup cost of all UAVs as the minimum optimization goal, the objective function minP is established sum :
[0105] 3. Decoding method.
[0106] This paper designs a "decoding function based on one-dimensional vector position information." This method aims to rationally allocate N tasks to M drones, and iterates the position information X to achieve task allocation and determine the execution order of the drones.
[0107] The steps of the decoding method are described as follows:
[0108] (1) Input information:
[0109] Number of drones: M (assuming there are M drones available).
[0110] Number of tasks: N (a total of N tasks need to be assigned to drones for execution).
[0111] Position information vector X: a one-dimensional vector of length N, whose elements range from 0 to M.
[0112] (2) Assign tasks:
[0113] First, the position information vector X is rounded down to convert the real value into an integer. i = j indicates that the i-th task is assigned to the j-th drone. This gives the drone number assigned to each task. Thus, N tasks can be assigned to M drones, ensuring that each task is executed.
[0114] (3) Determine the execution order of multiple tasks:
[0115] For drones assigned multiple tasks, compare their raw data (real values before rounding) in the position information vector X. The order in which multiple tasks are executed is sorted based on the raw data in the position information vector X, with the ones with the largest raw data being executed first. This ensures that drones execute their multiple tasks in a certain order, thus optimizing task execution efficiency.
[0116] This decoding method transforms the task allocation problem into a one-dimensional vector and, combined with iterative and floor-rounding operations on position information, rationally allocates N tasks to M drones and determines the order in which the drones execute multiple tasks. This decoding method allows for more efficient drone task allocation, improving task execution efficiency and overall system performance.
[0117] 4. Experimental results.
[0118] To verify the effectiveness of MMA in solving UAV task allocation, a simulation comparison of MMA, MA, and PSO is performed. The population size is set to 20 and the number of iterations is set to 200. A two-dimensional map is set as shown in Figure 1, with a total of 8 UAVs and 20 target points.
[0119] The convergence curves of each algorithm are shown in Figure 2:
[0120] Figure 2 shows that the optimal total cost decreases continuously during the iterations, and the improved MMA algorithm reaches convergence after approximately 30 iterations. In the early stages of the algorithm, due to the ε-greedy strategy, the jump step size is large, resulting in a fast optimization speed. Later, the jump step size is small, making it prone to falling into local optima. However, under the influence of the memory strategy, the algorithm converges quickly to the global optimal solution, demonstrating the feasibility of the improved algorithm for solving task allocation problems and its rapid convergence speed. The comparison curves show that neither the PSO nor the MA algorithm achieves the same high solution accuracy as the MMA algorithm. Therefore, the improved MMA algorithm outperforms the comparison algorithms in terms of convergence speed and optimization capability.
[0121] The task allocation results are shown in Figure 3. From the simulation results, we can see that through coding design and feasibility verification, UAVs and tasks can be effectively matched, and all allocation results meet the task constraints and optimization index constraints.
[0122] In addition, in order to fully reflect the feasibility of MMA and eliminate the impact of the problem scale, the number of drones and tasks are changed to 20 drones and 60 tasks.
[0123] The convergence curves of each algorithm are shown in Figure 4:
[0124] As shown in Figure 4, the improved MMA algorithm reached the optimal solution in 90 iterations, converging faster than the traditional MA and PSO algorithms and achieving better solution accuracy. This demonstrates that the improved MMA algorithm also performs well in large-scale UAV task allocation.
[0125] The two problems with different specifications were run 20 times each, and the algorithm running time was recorded, as shown in Table 1:
[0126] Table 1 Comparison of different task assignment problems
[0127] As shown in the table, the proposed MMA algorithm has a relatively good convergence speed for both medium-scale and complex UAV task allocation problems. This is consistent with the results of the algorithm test, demonstrating its effectiveness.
[0128] The above description is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with the technical field, within the technical scope disclosed in the present invention, who makes equivalent replacements or changes based on the technical solutions and concepts of the present invention, should be covered by the scope of protection of the present invention.
Claims
1. A multi-strategy improved mayfly algorithm based on memory mechanism, characterized in that: The improved Mayfly algorithm is applied to MMA to solve the UAV task allocation problem. The specific steps are as follows: S1: Determine the basic parameters of the UAV task allocation problem; the basic parameters include map size, UAV flight speed, target point location, and UAV location; S2: Determine the influencing parameter values of the Mayfly algorithm; the influencing parameter values include inertia weight, dance coefficient, and social positive attraction coefficient; S3: using chaos initialization to randomly generate mayfly positions, obtaining the task allocation scheme corresponding to each mayfly position through decoding, and obtaining the corresponding fitness value according to the scheme; S4: Constructing a memory population based on a memory mechanism; the memory population includes a positive memory population and a negative memory population; calculating the probability of each mayfly joining the positive memory population, generating a positive memory population, and generating a negative memory population through the positive memory population; S5: Integrate the ε-greedy strategy into the mayfly position update formula and update the mayfly position; S6: Sort the male and female mayflies according to their fitness values and cross them, and calculate the fitness values of the newly generated mayflies through the decoding function; S7: Performing Gaussian mutation on the newly generated mayfly individuals and calculating the fitness values of the mutated individuals; distributing these mutated individuals into male and female mayfly populations, and replacing individuals with poor fitness with individuals with better fitness to maintain the population size unchanged; wherein the smaller the fitness value, the better; S8: Sort the forward and reverse memory populations generated in the previous iteration according to similarity; determine whether the mayfly with the greatest similarity in the current forward memory population is consistent with the mayfly with the highest fitness, and update the original reverse memory population using the reverse memory population update strategy; update the forward and reverse memory populations; S9: Determine whether the termination condition is met. If so, the process stops; otherwise, return to S4.
2. The multi-strategy improved mayfly algorithm based on memory mechanism according to claim 1, characterized in that: The chaos initialization specifically uses cubic chaos mapping to initialize MA, and the initialization function is: Obtain the fitness value y(n) through the above initialization function, and use Y i express.
3. The multi-strategy improved mayfly algorithm based on memory mechanism according to claim 1, characterized in that: In step S3, the decoding method is a decoding method based on one-dimensional vector position information. The decoding method reasonably allocates N tasks to M drones. The task allocation and drone execution order are determined by iterating the position information X. The specific steps are as follows: S301 input information: Number of drones: M, assuming there are M drones available; Number of tasks: N, there are N tasks that need to be assigned to drones for execution; Position information vector X: a one-dimensional vector of length N, whose elements range from 0 to M; S302 Assignment Tasks: First, the position information vector X is rounded down, that is, the real value is converted into an integer to obtain the drone number assigned to each task, X i =j means that the i-th task is assigned to the j-th UAV for execution, thereby assigning N tasks to M UAVs to ensure that each task is executed; S303 Determine the execution order of multiple tasks: For drones assigned multiple tasks, the sizes of their raw data in the position information vector X are compared, and the order of multi-task execution is sorted according to the size of the raw data in the position information vector X. The tasks with larger raw data are executed first, so as to ensure that the drones execute their multiple tasks in a certain order, thereby optimizing the task execution efficiency.
4. The multi-strategy improved mayfly algorithm based on memory mechanism according to claim 1, characterized in that: In step S4, the method for generating the positive memory population specifically includes: constructing an initial positive memory population OM while initializing the mayflies, calculating the fitness value Y of each mayfly i , and the similarity H between each mayfly and the best mayfly individual i , thereby determining the probability P of each mayfly joining the positive memory population OM,i .
5. The multi-strategy improved mayfly algorithm based on memory mechanism according to claim 4, characterized in that: Using the fitness value Y i The absolute value of the difference between the two is used to express the similarity H between each mayfly individual in the population and the best individual i , the calculation formula is as follows: H i =|Y i -Y lead | (2) Where i is the size of the mayfly population, Y i represents the fitness value of the mayfly, Y lead Represents the fitness value of the best individual.
6. The multi-strategy improved mayfly algorithm based on memory mechanism according to claim 4, characterized in that: In step S4, the method for generating the reverse memory population specifically includes: defining the reverse memory population as RM, the position of each reverse memory mayfly is generated by relying on the forward memory mayfly, and the reverse memory population is kept updated synchronously with the forward memory population; The various dimensions of the reverse memory ephemera The calculation formula is as follows: Among them, max_rm d Represents the maximum value of the reverse memory mayfly in d dimension, min_rm d represents the minimum value of the reverse memory mayfly in d dimension, It is the value of the forward memory ephemera corresponding to the reverse memory ephemera.
7. The multi-strategy improved mayfly algorithm based on memory mechanism according to claim 4, characterized in that: Set a new population update strategy based on the constructed forward memory population and reverse memory population; set the dynamic memory population update factor β m , memory population replacement update R m Only remember the mayfly, the calculation formula is as follows: Among them, the random number within rand∈(0,1), ω and ρ are constant coefficients, n is the mayfly population, and t is the number of iterations.
8. The multi-strategy improved mayfly algorithm based on memory mechanism according to claim 7, characterized in that: The method of the new population update strategy specifically includes: After each iteration is completed, the new similarity H is calculated for the forward memory population and reverse memory population generated in the previous iteration. i , and according to the similarity H i Sort by size; Determine the current fitness Y i The highest similarity H between the mayfly and the positive memory population i Are the largest mayflies the same? If they are the same, the memory population is not introduced; If they are different, select the similarity H in the positive memory population i The largest front R m Only the mayfly is replaced and R is randomly selected from the original population. m Only mayflies, using reverse memory to identify similar The largest rear R m Only the mayfly performs position updates; After each population update, the forward and reverse memory populations are updated.
9. The multi-strategy improved mayfly algorithm based on memory mechanism according to claim 1, characterized in that: In step S5, the ε-greedy strategy includes: Set a probability ε (0<ε<1), when the subject makes a decision, it explores unknown behaviors with a small probability ε; in addition, it selects the action with the greatest value from previous actions with a probability of 1-ε.
10. The multi-strategy improved mayfly algorithm based on memory mechanism according to claim 9, characterized in that: The specific improvement process of the ε-greedy strategy includes the following steps: assigning a random probability P to the mayfly i i , and set the probability ε, where ε increases from 0.1 to 0.9 with the number of iterations; when P is satisfied i ≥ε, mayfly i is given a larger inertia weight, which increases its step size and makes its global search ability stronger; when P i When ε<ε, the mayfly is given a smaller inertia weight, which reduces its step size and makes the local search ability stronger. As the number of iterations increases, ε gradually increases, and most mayflies have stronger local search ability, while other mayflies have larger inertia coefficients. Since each mayfly has a random probability, they can have larger or smaller inertia weights during the iteration process. The formula is as follows: Among them, ε min is 0.1, ε max is 0.9; iter is the current number of iterations, MaxIter is the maximum number of iterations; g is the inertia weight of mayfly i; g l is the larger inertia weight; g s is the smaller inertia weight; P i is the random probability of mayfly i.