Herring optimization solving method, system and storage medium
By using the sardine optimization method, which combines the number of iterations and random numbers to balance the exploration and development phases, the problem of ignoring the influence of the number of iterations in existing metaheuristic algorithms is solved, thus improving the accuracy and efficiency of the algorithm.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- WUYI UNIV
- Filing Date
- 2023-01-09
- Publication Date
- 2026-04-21
AI Technical Summary
Existing metaheuristic algorithms, when balancing the exploration and development phases, neglect the impact of the number of iterations on position updates, leading to reduced algorithm accuracy.
A method for solving sardine optimization is proposed. By considering the impact of the number of iterations on the sardine position update, the method utilizes the global search, defense and local search stages of sardines, and combines random numbers to replace hyperparameters to balance the exploration and development stages.
It improves the accuracy and efficiency of the algorithm, effectively avoids insufficient exploration and development capabilities caused by excessively rapid transition in the middle stage of the algorithm, and improves the solution accuracy.
Smart Images

Figure CN116306768B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of environmental monitoring technology, and in particular to a method, system and storage medium for optimizing sardine solutions. Background Technology
[0002] Metaheuristic algorithms are widely used to solve real-world optimization problems, such as image segmentation, feature selection, task planning, and parameter optimization. Traditional metaheuristic algorithms employ two important search strategies: exploration and exploitation. Exploration refers to the ability to explore the global search space, which is related to avoiding getting trapped in local optima. Unlike exploration, exploitation refers to the ability to explore solutions near the optimal solution. Therefore, a balance needs to be struck between the exploration and exploitation phases. However, existing metaheuristic algorithms, in an attempt to balance the exploration and exploitation phases, only consider the population position during computation, neglecting the impact of the number of iterations on position updates, leading to reduced algorithm accuracy. Summary of the Invention
[0003] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a sardine optimization solution method, system, and storage medium that can consider the impact of the number of iterations on the update position, thereby improving the accuracy of the algorithm.
[0004] To solve the above-mentioned technical problems, the present invention proposes the following technical solution:
[0005] The first aspect of this application provides a method for optimizing sardine calculations, including:
[0006] The monitoring range of the sensor is obtained, and the current position of each sardine is obtained based on the monitoring range and a preset random function.
[0007] The fitness value of each sardine is calculated based on the current location of the sardine population, and the first optimal location of the sardine population is obtained.
[0008] The current stamina of each sardine is calculated based on the current iteration number and the preset iteration number.
[0009] Based on the current physical strength, determine the sardine's current stage;
[0010] The updated position of each sardine is calculated based on the current stage, the current stamina, the current position, and the first optimal position.
[0011] The updated position is used as the updated current position, and the first optimal position is recalculated based on the updated current position to update the updated position until the current iteration number is equal to the preset iteration number. The current position of each sardine in the current iteration is used as the second optimal position.
[0012] The sardine optimization solution method according to the first aspect of this application has at least the following beneficial effects: because the sardine's stamina decreases with the number of iterations, and this application considers the influence of the number of iterations on the sardine's position update, it can calculate the current stamina of each sardine based on the current number of iterations and the preset number of iterations, and determine the current stage of the sardine based on the current stamina, thereby obtaining the updated position of each sardine and the second optimal position of the sardine, thus improving the accuracy of the algorithm.
[0013] According to some embodiments of the first aspect of this application, the calculation of the current stamina of each sardine based on the current iteration number and a preset iteration number includes:
[0014] The current iteration number and the preset iteration number are input into a preset stamina algorithm to obtain the current stamina of each sardine.
[0015] According to some embodiments of the first aspect of this application, the preset physical strength algorithm is as follows:
[0016]
[0017] Wherein, F represents the current stamina of each sardine, iteration represents the current iteration number, maxiteration represents the preset iteration number, rand1 represents the preset first random data, rand2 represents the preset second random value, and rand3 represents the preset third random value.
[0018] According to some embodiments of the first aspect of this application, determining the current stage of the sardine based on the current physical strength includes:
[0019] When the current physical strength is greater than or equal to 1, the sardine's current stage is the global search stage;
[0020] When the current stamina is greater than or equal to 0.5 and less than 1, the sardine's current phase is the defensive phase;
[0021] When the current physical strength is less than 0.5, the sardine's current stage is the local search stage.
[0022] According to some embodiments of the first aspect of this application, when the current stage of the sardine search is a global search stage, the step of calculating the updated position of each sardine based on the current stage, the current stamina, the current position, and the first optimal position includes:
[0023] The current physical strength, the current position, the first optimal position, and the speed of the sardine at the previous moment are input into a preset first global search algorithm to obtain the current speed of each sardine.
[0024] The current velocity and current position are input into a preset second global search algorithm to obtain the updated position of each sardine.
[0025] According to some embodiments of the first aspect of this application, when the sardine is currently in a defensive phase, the step of calculating the updated position of each sardine based on the current phase, the current stamina, the current position, and the first optimal position further includes:
[0026] The current iteration number, the preset iteration number, and the first optimal position are input into a preset defense algorithm to obtain the updated position of each sardine.
[0027] According to some embodiments of the first aspect of this application, the defense algorithm is as follows:
[0028] X(i+1) = P(i) - (S1 + S2);
[0029] Wherein, X(i+1) represents the current position of the sardine, P(i) represents the first optimal position, and S1 represents the first spiral model, which is: S2 represents the second spiral model, which is: The iteration represents the current iteration number, the maxiteration represents the preset iteration number, and the rand4 represents the preset fourth random number.
[0030] According to some embodiments of the first aspect of this application, when the current stage of the sardine search is a local search stage, the step of calculating the updated position of each sardine based on the current stage, the current stamina, the current position, and the first optimal position further includes:
[0031] The first optimal position, the current position, and the preset sardine swarm dimension are input into a preset local search algorithm to obtain the updated position of each sardine.
[0032] A second aspect of this application provides a sardine optimization solution system, comprising:
[0033] At least one processor;
[0034] At least one program;
[0035] The program is stored in the memory, and the processor executes at least one of the programs to achieve the following:
[0036] The sardine optimization solution method as described in any of the first aspects of this application.
[0037] A third aspect of this application provides a computer-readable storage medium storing computer-executable signals for performing:
[0038] The sardine optimization solution method as described in any of the first aspects of this application.
[0039] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0040] Additional aspects and advantages of this application will become apparent and readily understood in conjunction with the following description of the embodiments, in which:
[0041] Figure 1 This is a main flowchart of a sardine optimization solution method provided in an embodiment of this application;
[0042] Figure 2 A sub-flowchart of the sardine optimization solution method provided in one embodiment of this application;
[0043] Figure 3 The main flowchart of the sardine optimization solution method provided in another embodiment of this application is shown.
[0044] Figure 4 A trend diagram of the change in the physical strength of sardines during the iteration process is provided for another embodiment of this application;
[0045] Figure 5 A block diagram of a sardine optimization solution system provided in another embodiment of this application. Detailed Implementation
[0046] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0047] It should be noted that although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown in the flowchart. The terminology in the specification, claims, and the foregoing drawings is used to distinguish similar objects and is not necessarily used to describe a specific order or sequence.
[0048] In the description of this application, the use of "first" and "second" is for the purpose of distinguishing technical features only, and should not be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated or the order of the technical features indicated.
[0049] In the description of this application, unless otherwise expressly defined, terms such as "setup," "installation," and "connection" should be interpreted broadly, and those skilled in the art can reasonably determine the specific meaning of the above terms in this application in conjunction with the specific content of the technical solution.
[0050] Optimization refers to finding the best or ideal solution to problems frequently encountered in a wide range of fields. Generally, artificial intelligence and machine learning, in practical applications, possess discrete and unconstrained properties. It is difficult to find the optimal solution using general branch-and-bound methods, dynamic programming, and other precise optimization methods. Therefore, approximation algorithms have been proposed as a new approach to solving these problems. Approximation algorithms are divided into two main categories: heuristic and metaheuristic. Heuristic algorithms have received less attention due to their tendency to get trapped in local optima. Metaheuristic algorithms, on the other hand, can find acceptable solutions to various complex optimization problems, do not require gradient information, have strong search capabilities, wide applicability, and can well balance solution accuracy and computational cost. Therefore, they are widely used in many real-world optimization problems, such as image segmentation, feature selection, task planning, parameter optimization, and job shop scheduling.
[0051] Metaheuristic optimization algorithms employ two important search strategies: exploration and exploitation. Exploration refers to the ability to explore the global search space, which is related to avoiding getting trapped in local optima. Unlike exploration, exploitation refers to the ability to explore solutions near the optimal solution to improve its accuracy. Therefore, a balance needs to be struck between the exploration and exploitation phases. However, existing metaheuristic algorithms, in an attempt to balance these phases, only consider the population position during computation, neglecting the impact of iteration counts on position updates, leading to reduced algorithm accuracy. Furthermore, some metaheuristic algorithms set numerous hyperparameters, which are manually defined values that require specifying "correct" values based on existing or current experience. However, existing algorithms lack theoretical analysis of these hyperparameters, necessitating modifications to existing algorithms or the development of new algorithms to better address current problems or provide solutions for new ones.
[0052] Based on this, this application proposes a sardine optimization solution method. The sardine optimization algorithm is a newly proposed population-based optimization algorithm. In nature, sardines hunting mainly involves three steps: global prey search, defense, and local prey search. The main function of this algorithm is to find the optimal solution of a function within a certain range. For example, to find the minimum value of f = (x-2)² + (y-2)² in the range [-100, 100], the algorithm can iteratively find that f is minimized when x = 2 and y = 2. In the sardine optimization solution method, each sardine represents a solution. In the early stages of algorithm iteration, the search is dispersed within the search space to find the optimal solution (i.e., the exploration phase); in the later stages of algorithm iteration, the search is conducted near the already found optimal solution (i.e., the local search phase).
[0053] The sardine optimization solution proposed in this application has high convergence accuracy, can effectively balance the exploration and development stages, and uses random numbers within a specified range to replace hyperparameters, thereby reducing the impact of hyperparameters on algorithm performance.
[0054] Reference Figure 1 In the first aspect, embodiments of this application provide a method for optimizing sardines, including but not limited to steps S110, S120, S130, S140, S150, and S160.
[0055] Step S110: Obtain the monitoring range of the sensor, and obtain the current position of each sardine based on the monitoring range and a preset random function;
[0056] Step S120: Calculate the fitness value of each sardine based on the current position of the sardine population to obtain the first optimal position of the sardine population.
[0057] Step S130: Calculate the current stamina of each sardine based on the current iteration number and the preset iteration number;
[0058] Step S140: Determine the current stage of the sardine based on its current stamina;
[0059] Step S150: Calculate the updated position of each sardine based on the current stage, current stamina, current position, and first optimal position.
[0060] Step S160: Use the updated position as the current updated position, recalculate the first optimal position based on the updated current position, and update the updated position until the current iteration number equals the preset iteration number. Use the current position of each sardine in the current iteration as the second optimal position.
[0061] Reference Figure 3 , Figure 3The flowchart below shows the main process of a sardine optimization solution method according to another embodiment of this application. According to one embodiment, the application first needs to obtain the monitoring range of the sensor to determine the upper and lower bounds of the search. Then, the sardine population is initialized based on the upper and lower bounds and a preset random function to obtain the current position of each sardine. It is assumed that the sardine population contains N sardines. After initializing the sardine population, the sardine optimization solution method officially enters the iteration phase. When the current iteration number is less than the preset iteration number, the fitness value of each sardine in the population needs to be calculated based on the current position to find the optimal sardine and obtain its position, which is the first optimal position of the sardine population. After obtaining the first optimal position, the stamina value of the j-th sardine needs to be calculated. If j is greater than N, the current iteration count needs to be reassessed to see if it is less than the preset iteration count. If j is less than N, the current stamina value of each sardine in the population needs to be updated based on the current iteration count and the preset iteration count. After updating the sardine's stamina value, it is necessary to determine whether the sardine is currently in the global search phase, the defense phase, or the local search phase based on the current stamina's range. Different current sardine phases correspond to different methods for calculating the updated sardine position. After obtaining the current sardine phase, the updated position of the j-th sardine needs to be calculated based on the current phase, current stamina, current position, and the first optimal position.
[0062] Specifically, after obtaining the updated position of the j-th sardine, the sardine optimization solution method of this application will enter the next iteration, using the updated position as the current updated position. The first optimal position of the sardine population will be recalculated based on the updated current position. The current stamina of each sardine will be calculated based on the current iteration number and the preset iteration number. The current stage of the sardine will be determined based on the current stamina to further update the updated position of the sardine, and then the next iteration will begin. The above steps are repeated until the current iteration number equals the preset iteration number, at which point the iteration stops, and the second optimal position of the sardine is output. More specifically, the output second optimal position is the optimal position of the sardine obtained in the current iteration, and the second optimal position of the sardine is the optimal solution calculated by the sardine optimization solution method of this application.
[0063] It should be noted that the sardines' stamina decreases with each iteration. Traditional swarm intelligence algorithms do not consider the impact of iteration on the algorithm, thus reducing its accuracy. However, this application considers the impact of the number of iterations on the sardines' position updates. It can calculate the current stamina of each sardine based on the current iteration number and the preset iteration number, and determine the current stage of each sardine based on its current stamina. This allows for the updating of the position of each sardine and the second optimal position of the sardines, thereby improving the accuracy of the algorithm.
[0064] According to another embodiment of this application, when monitoring the water quality of a river, sensors are generally set up at different locations in the river channel. To enable a fixed number of sensors to achieve a larger monitoring range, this application employs a sardine optimization solution method, analogizing the sensors to sardines for calculation, with the distribution of sardines representing the distribution of sensors. First, this application obtains the upper and lower bounds of the monitoring range of the river channel, and based on the upper and lower bounds of the monitoring range and a preset random function, obtains the current position of each sensor in the river channel. Then, it calculates the optimal monitoring range of each sensor to obtain the sensor with the largest current monitoring range. Next, through several iterations, it calculates the optimal distribution state of the sensors to obtain the distribution of all sensor positions that maximizes the monitoring area, i.e., the second optimal position.
[0065] According to another embodiment of this application, the current position of each sardine is X(j) = rand × (UB - LB) + LB, j = 1, 2, ..., N, where X(j) represents the current position of each sardine, rand represents a preset random function, UB represents a preset upper bound of the search space, and LB represents a preset lower bound of the search space. Specifically, assuming the sardine population is in a D-dimensional search space, and the sardine population contains N sardines, then the position of the j-th sardine in the D-dimensional search space is X. j =[x j,1 ,…x j,d ,…x j,D ], where j = 1, 2, ..., N, x j,d This indicates the position of the j-th sardine in the d-th dimension.
[0066] More specifically, this application effectively and intuitively simulates the global search phase, defense phase, and local search phase by simulating the current position of each sardine and the sardines' predation and hunting behavior. Compared with traditional swarm intelligence algorithms, this application also sets up a defense phase between the global search phase and the local search phase, which can effectively avoid insufficient exploration and development capabilities caused by the algorithm's rapid transition in the middle stage, thereby improving the algorithm's accuracy.
[0067] According to another embodiment of this application, weak sardines gather near stronger sardines to obtain food, rather than searching for food on their own. Therefore, after obtaining the current location, this application will also calculate the fitness value of each sardine based on the current location to obtain the optimal location of the sardines, that is, the first optimal location of the sardine population, so as to facilitate the subsequent calculation of the updated location of the sardine population.
[0068] Understandably, the current stamina of each sardine is calculated based on the current iteration number and the preset iteration number, including: inputting the current iteration number and the preset iteration number into the preset stamina algorithm to obtain the current stamina of each sardine.
[0069] Understandably, the default stamina algorithm is as follows: Where F represents the current stamina of each sardine, iteration represents the current iteration number, maxiteration represents the preset iteration number, rand1 represents the preset first random data, rand2 represents the preset second random value, and rand3 represents the preset third random value.
[0070] According to one embodiment of this application, in the sardine optimization algorithm, the sardine's current physical strength represents its strength. If a sardine is strong, it has enough energy to swim further to find food; conversely, if a sardine is severely depleted, it lacks the strength to support long-distance swimming. Therefore, weak sardines generally gather near stronger sardines to obtain food, rather than searching for food themselves. Furthermore, sardines can prevent predation by high-level predators in the ocean food chain, such as dolphins and sharks, by grouping together. Specifically, the sardine's physical strength is related to two factors: firstly, the sardine's own physical strength changes over time; sardines exhibit a decreasing trend in physical strength during hunting, and their physical strength may also drop sharply after a long journey; secondly, the environment also affects the sardine's physical strength. The sardine optimization solution method of this application calculates based on the changes in sardine physical strength, inputting the current iteration number and a preset iteration number into a preset physical strength algorithm to obtain the current physical strength of each sardine.
[0071] Specifically, rand1 and rand3 are random numbers between 0 and 1, which change with each iteration, and rand2 is a random number between -0.1 and 0.1, which also changes with each iteration.
[0072] Understandably, the current stage of the sardine is determined based on its current stamina, including: when the current stamina is greater than or equal to 1, the sardine's current stage is the global search stage; when the current stamina is greater than or equal to 0.5 and less than 1, the sardine's current stage is the defense stage; and when the current stamina is less than 0.5, the sardine's current stage is the local search stage.
[0073] Reference Figure 4 , Figure 4 This application provides a trend diagram of the sardine's stamina during the iteration process, as shown in another embodiment. According to one embodiment of this application, based on the habits of sardines and the principles of the formula, the variable F tends to decrease during the iteration process. Therefore, the sardine optimization solution method of this application can determine the current stage of the sardine based on its current stamina F. Specifically, when the current stamina F is greater than or equal to 1, the sardine will search different areas to explore the location of food, at which point the algorithm enters the global search stage; when the current stamina F is greater than or equal to 0.5 and less than 1, the sardine searches for food near the current area, at which point the algorithm enters the defensive stage, transitioning from the global search stage to the local search stage; when the current stamina F is less than 0.5, the current stamina decreases, and the algorithm enters the local search stage.
[0074] Reference Figure 2 In the first aspect, embodiments of this application provide a method for optimizing sardine solutions, including but not limited to steps S210 and S220.
[0075] Step S210: Input the current stamina, current position, first optimal position and the speed of the sardine at the previous moment into the preset first global search algorithm to obtain the current speed of each sardine.
[0076] Step S220: Input the current velocity and current position into the preset second global search algorithm to obtain the updated position of each sardine.
[0077] According to one embodiment of this application, when the sardine is currently in the global search phase, it will take some time to determine the positions of other members and food, and then swim for a long time before finding food. Therefore, when the sardine is currently in the global search phase, the sardine optimization solution method of this application first inputs the sardine's speed, current position, current stamina, and first optimal position from the previous moment into a preset first global search algorithm to obtain the current speed of each sardine. Specifically, the first global search algorithm is: V(i+1)=r1×V(i)+P(i)-r2×X(i)+F, where V(i+1) represents the sardine's current speed, V(i) represents the sardine's speed from the previous moment, F represents the current stamina, P(i) represents the first optimal position, X(i) represents the sardine's current position, r1 represents a preset first hyperparameter, and r2 represents a preset second hyperparameter. The settings of the first and second hyperparameters should be determined according to the actual calculation situation.
[0078] More specifically, after obtaining the current velocity of each sardine, this application also inputs the current velocity and current position of each sardine into a preset second global search algorithm to obtain the updated position of the sardine. The second global search algorithm is: X(i+1) = X(i) + V(i+1), where X(i+1) represents the updated position of the sardine, X(i) represents the current position of the sardine, and V(i+1) represents the current velocity of the sardine.
[0079] Understandably, when the sardines are in the defense phase, the updated position of each sardine is calculated based on the current phase, current stamina, current position, and first optimal position. This also includes inputting the current iteration number, preset iteration number, and first optimal position into the preset defense algorithm to obtain the updated position of each sardine.
[0080] Understandably, the defense algorithm is: X(i+1) = P(i) - (S1 + S2); where X(i+1) represents the current position of the sardine, P(i) represents the first optimal position, and S1 represents the first spiral model, which is:
[0081] S2 represents the second spiral model, which is as follows: iteration represents the current iteration number, maxiteration represents the preset iteration number, and rand4 represents the preset fourth random number.
[0082] According to one embodiment of this application, to avoid an imbalance between exploration and development capabilities caused by an excessively rapid transition in the mid-term of the algorithm, when the sardine's current stamina value is between 0.5 and 1, the sardine's current stage is a defensive stage, i.e., a transitional stage. In this stage, the sardine performs a rotating flight behavior to approach the leader sardine. A first spiral model and a second spiral model are used to simulate the sardine's rotating flight. Therefore, when the sardine's current stage is a defensive stage, the sardine optimization solution method of this application first calculates the first spiral model and the second spiral model based on the current iteration number, a preset iteration number, a first optimal position, and a preset fourth random value. Specifically, the calculation formula for the first spiral model is: The calculation formula for the second spiral model is: Where iteration represents the current iteration number, maxiteration represents the preset iteration number, P(i) represents the first optimal position, and rand4 represents the fourth random value, and rand4 is a random number with a value range of (0,1).
[0083] Understandably, when the current stage of the sardine search is a local search stage, the updated position of each sardine is calculated based on the current stage, current stamina, current position, and first optimal position. This also includes inputting the first optimal position, current position, and preset sardine swarm dimension into a preset local search algorithm to obtain the updated position of each sardine.
[0084] According to one embodiment of this application, when a sardine's current stamina is less than 0.5, almost all sardines in the population have gathered near the optimal position. At this time, the sardines will attack food, and multiple sardines will gather near the same food. The current stage of the sardine population is a local search stage. Therefore, when the current stage of the sardine population is a local search stage, the sardine optimization solution method of this application first calculates the Lévy flight coefficient based on a preset sardine population dimension, a fifth random number, a sixth random number, and a seventh coefficient. The Lévy flight coefficient is used to improve the performance of the metaheuristic algorithm. Specifically, the formula for calculating the Lévy flight coefficient is: Where Levy(d) represents the Levy flight coefficient, d represents the sardine population dimension, u represents the fifth random number, v represents the sixth random number, and u and v are random numbers in the range (0,1), β represents the seventh coefficient, and σ is calculated using the following formula: Γ represents the gamma function, and β represents the seventh coefficient. In this application, the value of the seventh coefficient is assumed to be 1.5.
[0085] After obtaining the Levy flight coefficient, this application will further calculate the updated position of each sardine based on the Levy flight coefficient, the first optimal position, and the current position of each sardine. Specifically, the formula for calculating the updated position of each sardine is: X(i+1)=P(i)-0.5×(P(i)-X(i))×Levy(d), where X(i+1) represents the updated position of each sardine, P(i) represents the first optimal position, X(i) represents the current position of each sardine, and Levy(d) represents the Levy flight coefficient.
[0086] According to one embodiment of this application, after calculating the updated position of each sardine, if the current iteration count is less than the preset iteration count, it means that the updated position of each sardine obtained at this time is not the optimal position of the sardine group, and iterative calculation needs to be performed again. The updated position is taken as the updated current position, the first optimal position is updated based on the updated current position, and the current iteration count is incremented by one to obtain the updated current iteration count. The current sardine's stamina is updated based on the updated current iteration count, and then the current stage of the sardine is determined based on the current stamina. The updated position of each sardine is calculated based on the current stage of the sardine, the current stamina of the sardine, the current position, and the first optimal position. If the updated current iteration count is still less than the preset iteration count, the above steps need to be repeated to continue iterating. Until the current iteration count equals the preset iteration count, the updated position of each sardine obtained from this iteration is taken as the optimal position of the sardine group, that is, the second optimal position of the sardines. Specifically, the second optimal position of the sardines represents the optimal solution obtained after iterative calculation of the problem to be calculated.
[0087] Secondly, referring to Figure 5 This application provides a sardine optimization solution system, including:
[0088] At least one memory 200;
[0089] At least one processor 100;
[0090] At least one program;
[0091] The program is stored in memory 200, and processor 100 executes at least one program to achieve:
[0092] The sardine optimization solution method according to any embodiment of the first aspect of this application.
[0093] The processor 100 and the memory 200 can be connected via a bus or other means.
[0094] Memory 200, as a non-transitory readable storage medium, can be used to store non-transitory software instructions and non-transitory instructions. Furthermore, memory 200 may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. It is understood that memory 200 may optionally include remotely located memories 200 relative to processor 100, which can be connected to processor 100 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0095] The processor 100 executes non-transient software instructions, commands, and signals stored in the memory 200 to perform various functional applications and data processing, thereby implementing a sardine optimization solution method according to the first aspect of the above embodiment.
[0096] The non-transient software instructions required to implement the sardine optimization solution system of the above embodiments are stored in the memory 200. When executed by the processor 100, a sardine optimization solution method according to the first aspect of this application is executed, for example, the method described above. Figure 1 Method steps S110 to S160 in the text Figure 2 Method steps S210 to S220.
[0097] Thirdly, embodiments of this application provide a computer-readable storage medium storing computer-executable signals for execution:
[0098] A sardine optimization solution method according to any embodiment of the first aspect of the application.
[0099] For example, execute the above description. Figure 1 Method steps S110 to S160 in the text Figure 2 Method steps S210 to S220.
[0100] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0101] Based on the above description of the embodiments, those skilled in the art will understand that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable signals, data structures, instruction modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible by a computer. Furthermore, as is known to those skilled in the art, communication media typically contain computer-readable signals, data structures, instruction modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0102] The embodiments of this application have been described in detail above with reference to the accompanying drawings. However, this application is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of this application.
Claims
1. A sardine optimization solving method, characterized by, The sardine optimization solution method describes the use of sensors at different locations in the river to monitor water quality. To enable a fixed number of sensors to achieve a larger monitoring range, the sensors are compared to sardines for calculation, and the distribution of sardines is equivalent to the distribution of sensors. The sardine optimization solution method includes: The monitoring range of the sensor is obtained, and the current position of each sardine is obtained based on the monitoring range and a preset random function. The fitness value of each sardine is calculated based on the current location of the sardine population, and the first optimal location of the sardine population is obtained. The current stamina of each sardine is calculated based on the current iteration number and the preset iteration number. Based on the current physical strength, determine the sardine's current stage; The updated position of each sardine is calculated based on the current stage, the current stamina, the current position, and the first optimal position. The updated position is used as the updated current position, and the first optimal position is recalculated based on the updated current position to update the updated position until the current iteration number is equal to the preset iteration number. The current position of each sardine in the current iteration is used as the second optimal position. The calculation of the current stamina of each sardine based on the current iteration number and the preset iteration number includes: The current iteration number and the preset iteration number are input into the preset stamina algorithm to obtain the current stamina of each sardine; The preset physical strength algorithm is as follows: ; Wherein, F represents the current stamina of each sardine, iteration represents the current iteration number, maxiteration represents the preset iteration number, rand1 represents the preset first random data, rand2 represents the preset second random value, and rand3 represents the preset third random value.
2. The sardine optimization solving method according to claim 1, characterized in that, Determining the sardine's current stage based on its current physical strength includes: When the current physical strength is greater than or equal to 1, the sardine's current stage is the global search stage; When the current stamina is greater than or equal to 0.5 and less than 1, the sardine's current phase is the defensive phase; When the current physical strength is less than 0.5, the sardine's current stage is the local search stage.
3. The sardine optimization solving method according to claim 2, characterized in that, When the current stage of the sardine search is a global search stage, the updated position of each sardine is calculated based on the current stage, the current stamina, the current position, and the first optimal position, including: The current physical strength, the current position, the first optimal position, and the speed of the sardine at the previous moment are input into a preset first global search algorithm to obtain the current speed of each sardine. The current velocity and current position are input into a preset second global search algorithm to obtain the updated position of each sardine.
4. The sardine optimization solving method according to claim 2, characterized in that, When the sardine is currently in a defensive phase, the step of calculating the updated position of each sardine based on the current phase, current stamina, current position, and the first optimal position further includes: The current iteration number, the preset iteration number, and the first optimal position are input into a preset defense algorithm to obtain the updated position of each sardine.
5. The sardine optimization solving method according to claim 4, characterized in that, The defense algorithm is as follows: ; Wherein, the X(i+1) represents the current position of sardines, the P(i) represents the first optimal position, the represents the first spiral model, and the first spiral model is: , the represents the second spiral model, and the second spiral model is: , the iteration represents the current iteration number, the maxiteration represents the preset iteration number, and the rand4 represents the preset fourth random number.
6. The sardine optimization solving method according to claim 2, wherein, When the current stage of the sardine search is a local search stage, the step of calculating the updated position of each sardine based on the current stage, the current stamina, the current position, and the first optimal position further includes: The first optimal position, the current position, and the preset sardine swarm dimension are input into a preset local search algorithm to obtain the updated position of each sardine.
7. A sardine optimization solving system characterized by, include: At least one memory; At least one processor; At least one program; The program is stored in the memory, and the processor executes at least one of the programs to implement the sardine optimization solution method as described in any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable signals for performing the sardine optimization solution method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Mobile robot path planning method based on whale optimization algorithm
CN109765893A
Analog circuit fault diagnosis method based on SFO optimization depth extreme learning machine
CN114330194A