Path planning method based on improved genetic annealing algorithm
By improving the genetic annealing algorithm and combining it with region partitioning and adaptive temperature adjustment, the path planning is optimized, solving the problems of path travel direction and smoothness, and improving the accuracy and stability of path planning.
Patent Information
- Application Number
- CN202510328926.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-20
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2045-03-20
AI Technical Summary
Existing path planning algorithms do not consider the direction of travel and the smoothness of the path, which may result in too many sharp angles in the planned path, affecting the stability of the robotic arm during movement and the quality of the coating.
An improved genetic annealing algorithm is adopted, which divides the region to be planned into regions, allowing only the start or end point of the same region in the chromosome. Combined with an improved fitness function and an adaptive temperature adjustment strategy, cyclic annealing is performed to optimize path planning.
It improves the accuracy and stability of path planning, reduces the turning rate, ensures path smoothness, and shortens the planned path distance.
Smart Images

Figure CN120244949B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of path planning, specifically relating to a path planning method based on an improved genetic annealing algorithm. Background Technology
[0002] Currently, many experts and scholars both domestically and internationally are dedicated to the research of path planning algorithms. Commonly used optimization algorithms include genetic algorithms, ant colony optimization, immune algorithms, particle swarm optimization, and artificial potential field methods. In practical spraying path planning scenarios, traditional models do not consider the path travel direction or the overall path smoothness. Therefore, the planned path may contain too many sharp angles, causing the robotic arm to reach singular values and become unable to move. Furthermore, traditional genetic algorithms are often used to solve this problem, but these methods have weak local search capabilities and are prone to premature convergence. This leads to a significant deviation between the path planning results generated by this model and the actual optimal path, thus affecting the efficiency of the spraying operation and the final spraying quality. Summary of the Invention
[0003] This invention provides a path planning method based on an improved genetic annealing algorithm to solve the problems of current path planning not considering path direction, path smoothness, and low accuracy and stability.
[0004] According to a first aspect of the present invention, a path planning method based on an improved genetic annealing algorithm is provided, comprising:
[0005] Step S100: Divide the area to be planned into n regions and initialize m populations, such that each population's chromosome includes n genes, each gene corresponds to the start or end point of different regions, only the start or end point of the same region is allowed within a chromosome, and each chromosome corresponds to one path, where n and m are both integers greater than 1.
[0006] Step S200: For each chromosome in the m populations, determine the improved fitness of the chromosome corresponding to the current path, and retain the corresponding chromosome according to the magnitude of the improved fitness. The improved fitness is determined based on the length of the current path corresponding to the chromosome, the length of the longest path and the length of the shortest path among the paths corresponding to each chromosome, and the number of obtuse angles in the current path.
[0007] Step S300: Using the retained chromosomes as the initial input sequence, perform cyclic annealing operations on each chromosome in the input sequence based on the improved annealing algorithm to obtain the final solution corresponding to each chromosome. The temperature and input sequence on which each annealing operation is based are determined by the difference in improved fitness between the old solution and the new solution before and after the previous annealing operation.
[0008] Step S400: Compare the improved fitness of each retained chromosome with the improved fitness of each final solution to determine the planned path.
[0009] Optionally, it also includes: establishing a set of area points, a set of paths, a set of path lengths, and a set of path angles. The set of area points is the set of the start and end points of each area. The set of paths is the set of paths between any two points in the set of area points. The set of path lengths includes the length of each path in the set of paths, where the length of a path is 0 when the two endpoints of the path are the start and end points of the same area. The set of path angles is the set of angles between the upper and lower road segments and the angle weights for each intermediate point on each path in the set of paths. When the angle is greater than 90 degrees, the angle weight between the upper and lower road segments is 1, and when the angle is less than or equal to 90 degrees, the angle weight between the upper and lower road segments is 0.
[0010] Optionally, the following steps can be used to determine the fitness of the improvement:
[0011] Step S1: Based on the set of path lengths, determine the path corresponding to each chromosome to be analyzed. For each chromosome to be analyzed, obtain the length of the longest path, the length of the shortest path, and the length of the current path corresponding to that chromosome.
[0012] Step S2: Determine the normalized value of the current path length based on the length of the longest path, the length of the shortest path, and the length of the current path;
[0013] Step S3: Determine the normalized value of the number of obtuse angles in the current path based on the angle weights in the path angle set used to represent the number of obtuse angles in the current path;
[0014] Step S4: Determine the improved fitness of the current path, i.e. the improved fitness of the chromosome, based on the normalized value of the length of the current path and the normalized value of the number of obtuse angles in the current path.
[0015] Optionally, in step S2, the normalized length value of the current path is determined according to the following formula. :
[0016]
[0017] in Indicates the length of the current path. This represents the length of the longest path. This represents the length of the shortest path. This indicates the number of genes on each chromosome;
[0018] In step S3, the normalized value of the number of obtuse angles in the current path is determined according to the following formula. :
[0019]
[0020] in The weight of the included angle used to represent the number of obtuse angles in the current path;
[0021] In step S4, the improved fitness of the current path is determined according to the following formula. :
[0022]
[0023] in and They represent and The weight.
[0024] Optionally, in step S200, the chromosomes to be analyzed are: each chromosome in m populations; in step S300, the chromosomes to be analyzed are: the chromosomes corresponding to each old solution and each new solution before and after each annealing operation.
[0025] Each gene in each chromosome is represented by a different numerical value, each value representing a region, and the value is encoded using an integer method.
[0026] Optionally, step S300 specifically includes:
[0027] Step S10: Set the initial temperature Threshold ε, first counter i, second counter j, first sensitivity value u, second sensitivity value v, where i and j are both integers with an initial value of 0;
[0028] Step S20: Anneal each chromosome in the input sequence at the corresponding temperature to obtain new solutions corresponding to each chromosome. Calculate the improved fitness of each new solution. Use the retained chromosomes as the initial input sequence and the initial solution for the annealing operation. For each new solution, determine whether the difference in improved fitness between the old solution and the new solution before and after the annealing operation is less than 0. If it is less than 0, accept the new solution; if it is greater than or equal to 0, accept the new solution according to the corresponding probability of the annealing operation. The initial probability is a set value. Execute step S30.
[0029] Step S30: Determine whether the annealing cycle termination condition has been met. If so, use the new solution and the remaining old solution as the final solution corresponding to each chromosome; otherwise, use the new solution and the remaining old solution as the input sequence for the next annealing operation and execute step S40.
[0030] Step S40: For each new solution after the annealing operation, determine whether the absolute value of the difference between the improved fitness of the old solution and the new solution before and after the annealing operation is greater than the threshold ε. If so, increment the first counter i by 1 and execute step S50; otherwise, increment the second counter j by 1 and execute step S50.
[0031] Step S50: Determine whether the first counter i is greater than the first sensitive value u. If yes, then increase the temperature; otherwise, proceed to step S60.
[0032] Step S60: Determine whether the second counter j is greater than the second sensitive value v. If yes, clear the first counter i and the second counter j to zero. Otherwise, cool the temperature. Return to step S20.
[0033] Optionally, step S10 further sets the number of annealing cycles L, the heating coefficient β, and the cooling coefficient α, where L is an integer with an initial value of 0; step S60, before returning to execute step S20, further includes: increasing the number of annealing cycles L by 1.
[0034] Whether the cycle end condition is met in step S30 includes: determining whether the temperature has reached the set value and / or whether the number of annealing cycles L has reached the set value.
[0035] Optionally, in step S20, the corresponding probability for:
[0036]
[0037] in This represents the difference in fitness between the old and new solutions before and after the annealing operation. This indicates the temperature on which the annealing operation was based.
[0038] Optionally, step S400 specifically includes: after completing the cyclic annealing operation, for each chromosome in the initial input sequence, comparing the improved fitness of the chromosome with the improved fitness of its final solution, and selecting the chromosome with the larger improved fitness as the new chromosome;
[0039] Determine whether the path planning termination condition has been met. If so, use the path corresponding to the chromosome with the highest improved fitness among the new chromosomes as the planned path; otherwise, return to step S200.
[0040] Optionally, prior to step S300, the remaining chromosomes may be subjected to selection, crossover, and mutation operations.
[0041] The beneficial effects of this invention are:
[0042] 1. This invention abstracts the start and end points of each region into two genes, allowing only the same start or end point of a region to exist within each chromosome. This ensures that the chromosome includes not only length information but also the direction information of each region, thus avoiding confusion during decoding. 2. This invention improves the fitness function in the genetic algorithm, making the chromosome's fitness related to the length and number of obtuse angles of its current path, as well as the minimum and maximum path lengths in the population. This reduces the turning rate of the planned path, ensures the smoothness of the planned path, and shortens the planned path distance. 3. This invention performs cyclic annealing on each chromosome based on an improved annealing algorithm. The temperature and input sequence used in each annealing operation are determined by the improved fitness difference between the old and new solutions before and after the previous annealing operation. This invention proposes an adaptive temperature adjustment strategy based on changes in the objective function value to improve the annealing operation, thereby preventing premature convergence and improving the accuracy and stability of path planning.
[0043] 2. This invention uses integers to encode different regions, so that the values corresponding to each gene in each chromosome are different and are integers, which is more effective for combinatorial optimization problems;
[0044] 3. Before performing the annealing operation, the present invention first performs selection, crossover and mutation operations on each of the retained chromosomes, which can further improve the diversity of chromosomes and the probability of inheriting excellent genes, thereby improving the accuracy of path planning. Attached Figure Description
[0045] Figure 1 This is a flowchart of an embodiment of the path planning method based on the improved genetic annealing algorithm of the present invention. Detailed Implementation
[0046] To enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, and to make the above-mentioned objectives, features and advantages of the embodiments of the present invention more apparent and understandable, the technical solutions in the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0047] In the description of this invention, unless otherwise specified and limited, it should be noted that the term "connection" should be interpreted broadly. For example, it can be a mechanical connection or an electrical connection, or it can be a connection between two internal components. It can be a direct connection or an indirect connection through an intermediate medium. Those skilled in the art can understand the specific meaning of the above term according to the specific circumstances.
[0048] See Figure 1 This is a flowchart illustrating an embodiment of the path planning method based on the improved genetic annealing algorithm of the present invention. The method may include the following steps:
[0049] Step S100: Divide the area to be planned into n regions and initialize m populations, such that each population's chromosome includes n genes, each gene corresponds to the start or end point of different regions, only the start or end point of the same region is allowed within a chromosome, and each chromosome corresponds to one path, where n and m are both integers greater than 1.
[0050] In this embodiment, a zigzag trajectory is planned for each area to obtain the starting point and ending point of each area. The method may further include: establishing a set of area points, a set of paths, a set of path lengths, and a set of path angles. The set of area points is the set of starting points and ending points of each area. The set of paths is the set of paths between any two points in the set of area points. The set of path lengths includes the length of each path in the set of paths. When the two endpoints of the path are the starting point and the ending point of the same area, the length of the path is 0. The set of path angles is the set of angles between the upper and lower segments and the angle weights for each intermediate point on each path in the set of paths. When the angle is greater than 90 degrees, the angle weight of the upper and lower segments is 1. When the angle is less than or equal to 90 degrees, the angle weight of the upper and lower segments is 0.
[0051] The area to be planned can be the workpiece area. The starting point and ending point of each area can be abstracted as two cities. Two cities in the same area form a city cluster. There are a total of 2n cities. Establish a path planning model (e.g., the Generalized Traveling Salesman Model (SGTSP)). ,in It is a set of city clusters (i.e., a set of points in a region). Let E be the set of city points in any city cluster, and let W be the set of paths between any two city points in the city cluster set (path set). Let W be the length of each path in the path set E. If the two endpoints of the path come from the same city cluster, the length of the path is 0; otherwise, it is the actual distance between the two cities. The path angle set U is the angle between the upper and lower road segments and the set of angle weights for each intermediate point on each path in the path set. When the angle is greater than 90 degrees, the angle weight between the upper and lower road segments is 1; when the angle is less than or equal to 90 degrees, the angle weight between the upper and lower road segments is 0.
[0052] Traditional path planning population initialization methods cannot guarantee the orientation within a region, potentially leading to decoding confusion. To address this issue, this invention abstracts the start and end points of each region as two genes, ensuring that only the same region's start or end point is allowed within each chromosome. This allows the chromosome to include not only length information but also the orientation information of each region, thus preventing decoding confusion. Each gene in each chromosome is represented by a distinct numerical value, with each value representing a region, and these values are encoded using integers. This invention uses integers to encode different regions, ensuring that the values corresponding to each gene in each chromosome are different and integers, which is more effective for combinatorial optimization problems.
[0053] Step S200: For each chromosome in the m population, determine the improved fitness of the chromosome corresponding to the current path, and retain the corresponding chromosome according to the magnitude of the improved fitness. The improved fitness is determined based on the length of the current path corresponding to the chromosome, the length of the longest path and the length of the shortest path among the paths corresponding to each chromosome, and the number of obtuse angles in the current path.
[0054] In genetic algorithms, the fitness function is typically used to measure the quality of each individual chromosome in the population, and whether an individual chromosome can be defined as an elite individual is also determined by the fitness function. In traditional industrial robot path planning, the fitness function is usually defined as the derivative of the path length represented by the individual. However, in robot motion, the turning angle of the robotic arm is prone to reaching singular values, reducing efficiency. Therefore, this invention proposes an improved fitness function. Specifically, the improved fitness can be determined according to the following steps:
[0055] Step S1: Based on the set of path lengths, determine the path corresponding to each chromosome to be analyzed. For each chromosome to be analyzed, obtain the length of the longest path, the length of the shortest path, and the length of the current path corresponding to that chromosome. In step S200, each chromosome to be analyzed is a chromosome in each of the m populations.
[0056] Step S2: Determine the normalized length value of the current path based on the lengths of the longest path, the shortest path, and the current path. In this embodiment, the normalized length value of the current path can be determined using the following formula. :
[0057]
[0058] in Indicates the length of the current path. This represents the length of the longest path. This represents the length of the shortest path. This indicates the number of genes on each chromosome.
[0059] Step S3: Determine the normalized value of the number of obtuse angles in the current path based on the angle weights used to represent the number of obtuse angles in the current path from the set of path angles. In this embodiment, the normalized value of the number of obtuse angles in the current path can be determined according to the following formula. :
[0060]
[0061] in The included angle weight is used to represent the number of obtuse angles in the current path.
[0062] Step S4: Determine the improved fitness of the current path, i.e., the improved fitness of the chromosome, based on the normalized value of the current path length and the normalized value of the number of obtuse angles in the current path. In this embodiment, the improved fitness of the current path can be determined according to the following formula. :
[0063]
[0064] in and They represent and The weight.
[0065] This invention improves the fitness function in the genetic algorithm, making the fitness of a chromosome related to the length and number of obtuse angles of its current path, as well as the minimum and maximum path lengths in the population. This reduces the turning rate of the planned path, ensures the smoothness of the planned path, and shortens the planned path distance.
[0066] After determining the improved fitness of each chromosome in m populations, the improved fitness of each chromosome can be sorted in descending order, and then the chromosomes with the highest corresponding proportion (e.g., 30%) can be retained.
[0067] Step S300: Using the retained chromosomes as the initial input sequence, perform cyclic annealing operations on each chromosome in the input sequence based on the improved annealing algorithm to obtain the final solution corresponding to each chromosome. The temperature and input sequence on which each annealing operation is based are determined by the improved fitness difference between the old solution and the new solution before and after the previous annealing operation.
[0068] In the annealing algorithm, when the change value of the objective function decreases too rapidly within a certain range, it may be necessary to maintain a higher temperature to search more solution space. To prevent a fixed cooling strategy from causing the algorithm to converge prematurely in certain situations, this invention proposes an adaptive temperature adjustment strategy based on the change in the objective function value to improve the simulated annealing operation. Specifically, step S300 may include:
[0069] Step S10: Set the initial temperature The threshold ε, the first counter i, the second counter j, the first sensitivity value u, and the second sensitivity value v are all integers with an initial value of 0.
[0070] In this step, you can also set the number of annealing cycles L, the heating coefficient β, and the cooling coefficient α, where L is an integer with an initial value of 0.
[0071] Step S20: Anneal each chromosome in the input sequence at the corresponding temperature to obtain new solutions corresponding to each chromosome. Calculate the improved fitness of each new solution. Use the retained chromosomes as the initial input sequence and the initial solution for the annealing operation. For each new solution, determine whether the difference in improved fitness between the old and new solutions before and after the annealing operation is less than 0. If it is less than 0, accept the new solution; if it is greater than or equal to 0, accept the new solution according to the corresponding probability of the annealing operation. The initial probability is a set value. Execute step S30. Specifically, when calculating the improved fitness of each old and new solution, the chromosomes to be analyzed in the improved fitness calculation step are: the chromosomes corresponding to each old and new solution before and after each annealing operation.
[0072] The corresponding probability in step S20 for:
[0073]
[0074] in This represents the difference in fitness between the old and new solutions before and after the annealing operation. This indicates the temperature on which the annealing operation was based.
[0075] Step S30: Determine whether the annealing cycle termination condition has been met. If so, use the accepted new solution and the remaining old solution as the final solution corresponding to each chromosome; otherwise, use the accepted new solution and the remaining old solution as the input sequence for the next annealing operation, and execute step S40. Whether the cycle termination condition has been met in this step may include: determining whether the temperature has reached a set value and / or whether the number of annealing cycles L has reached a set value.
[0076] Step S40: For each new solution after the annealing operation, determine whether the absolute value of the difference between the improved fitness of the old solution and the new solution before and after the annealing operation is greater than the threshold ε. If so, increment the first counter i by 1 and execute step S50; otherwise, increment the second counter j by 1 and execute step S50.
[0077] Step S50: Determine whether the first counter i is greater than the first sensitive value u. If yes, then increase the temperature; otherwise, proceed to step S60.
[0078] Step S60: Determine whether the second counter j is greater than the second sensitive value v. If yes, clear the first counter i and the second counter j to zero. Otherwise, cool the temperature. Return to step S20.
[0079] This invention performs cyclic annealing on each chromosome based on an improved annealing algorithm. The temperature and input sequence for each annealing operation are determined by the difference in improved fitness between the old and new solutions before and after the previous annealing operation. It can be seen that this invention proposes an adaptive temperature adjustment strategy based on the change of objective function value to improve the annealing operation, thereby preventing the algorithm from converging too early and improving the accuracy and stability of path planning.
[0080] Step S400: Compare the improved fitness of each retained chromosome with the improved fitness of each final solution to determine the planned path. Step S400 may specifically include: after completing the cyclic annealing operation, for each chromosome in the initial input sequence, compare the improved fitness of that chromosome with the improved fitness of its final solution, and select the chromosome with the higher improved fitness as the new chromosome; determine whether the path planning termination condition has been met; if so, take the path corresponding to the chromosome with the highest improved fitness among the new chromosomes as the planned path; otherwise, return to step S200. The path planning termination condition may include a preset number of iterations or a convergence condition.
[0081] Additionally, prior to step S300, selection, crossover, and mutation operations can be performed on the retained chromosomes. During the selection operation, a roulette wheel selection algorithm can be used: first, the population fitness and the fitness of each individual in the population are calculated. Then, the fitness of a single individual is divided by the population fitness to obtain a ratio value k between 0 and 1. This ratio value k is equivalent to the area occupied by that individual in the "roulette wheel." A value q is then randomly generated. If q is between 0 and k, the individual is retained without crossover or mutation; otherwise, crossover and mutation are performed. The ratio and its corresponding area represent the probability of the individual being selected; a higher fitness level means a higher probability of retention.
[0082] Crossover involves exchanging and combining portions of genes from two (or more) selected parent individuals to produce new offspring. This scheme uses a single-point crossover method, randomly determining a crossover point in the individual's encoding string, and then exchanging portions of genes from the two parent individuals after (or before) the crossover point. Mutation involves randomly altering certain genes of an individual. Its purpose is to introduce new gene combinations to maintain population diversity. This scheme randomly selects a gene from an individual with probability and randomly perturbs it within selectable nodes to obtain new individuals.
[0083] Before performing the annealing operation, this invention first performs selection, crossover, and mutation operations on the retained chromosomes, which can further improve chromosome diversity and the probability of inheriting superior genes, thereby improving the accuracy of path planning.
[0084] As can be seen from the above embodiments, this invention abstracts the start and end points of each region into two genes, allowing only the same start or end point of a region to exist within each chromosome. This allows the chromosome to include not only length information but also the direction information of each region, thus avoiding confusion during decoding. This invention improves the fitness function in the genetic algorithm, making the fitness of a chromosome related to the length and number of obtuse angles of its corresponding current path, as well as the minimum and maximum path lengths in the population. This reduces the turning rate of the planned path, ensures the smoothness of the planned path, and shortens the planned path distance. This invention performs cyclic annealing on each chromosome based on an improved annealing algorithm. The temperature and input sequence used in each annealing operation are determined by the improved fitness difference between the old and new solutions before and after the previous annealing operation. It can be seen that this invention proposes an adaptive temperature adjustment strategy based on the change of the objective function value to improve the annealing operation, thereby preventing the algorithm from converging too early and improving the accuracy and stability of path planning.
[0085] Other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of the invention are indicated by the following claims.
[0086] It should be understood that the present invention is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is defined solely by the appended claims.
Claims
1. A path planning method based on an improved genetic annealing algorithm, characterized in that, The method comprises the following steps: Step S100, dividing a region to be planned into n sub-regions, initializing m populations, so that each population has a chromosome comprising n genes, each gene corresponding to a start point or an end point of a different sub-region, only a start point or an end point of the same sub-region being allowed to exist in one chromosome, and each chromosome corresponding to a path, n and m being integers greater than 1; Step S200, determining, for each chromosome in the m populations, an improved fitness of the chromosome corresponding to a current path, and retaining the corresponding chromosome according to the size of the improved fitness, wherein the improved fitness is determined according to a length of the current path corresponding to the chromosome, a length of the longest path and a length of the shortest path in the paths corresponding to the chromosomes, and an obtuse angle number in the current path; Step S300, taking the retained chromosomes as initial input sequences, and performing cyclic annealing operations on each chromosome in the input sequences based on an improved annealing algorithm to obtain final solutions respectively corresponding to the chromosomes, wherein a temperature and an input sequence for each annealing operation are determined according to a difference between improved fitnesses of old and new solutions before and after a previous annealing operation of the annealing operation; Step S400, comparing the improved fitnesses of the retained chromosomes and the improved fitnesses of the final solutions to determine a planned path.
2. The path planning method based on the improved genetic annealing algorithm according to claim 1, characterized in that, The method further comprises the following steps: establishing a sub-region point set, a path set, a path length set and a path angle set, the sub-region point set being a set of start points and end points of the sub-regions, the path set being a set of paths between any two points in the sub-region point set, the path length set comprising lengths of the paths in the path set, wherein the length of a path is 0 when the two end points of the path are the start point and the end point of the same sub-region, and the path angle set being a set of angle weights of an angle between an upper path segment and a lower path segment for each intermediate point on each path in the path set, the angle weight of the upper and lower path segments being 1 when the angle is greater than 90 degrees, and the angle weight of the upper and lower path segments being 0 when the angle is less than or equal to 90 degrees.
3. The path planning method based on the improved genetic annealing algorithm according to claim 2, characterized in that, The improved fitness is determined according to the following steps: Step S1, determining a path corresponding to each chromosome to be analyzed according to the path length set, and obtaining, for each chromosome in the chromosomes to be analyzed, a length of the longest path, a length of the shortest path and a length of a current path in the determined path; Step S2, determining a length normalization value of the current path according to the length of the longest path, the length of the shortest path and the length of the current path; Step S3, determining a normalization value of an obtuse angle number in the current path according to an angle weight in the path angle set for representing the obtuse angle number in the current path; Step S4, determining an improved fitness of the current path, i.e. the improved fitness of the chromosome, according to the length normalization value of the current path and the normalization value of the obtuse angle number in the current path.
4. The path planning method based on the improved genetic annealing algorithm according to claim 3, characterized in that, The length normalized value of the current path is determined in step S2 according to the following formula : wherein denotes the length of the current path, denotes the length of the longest path, denotes the length of the shortest path, denotes the number of genes per chromosome; The normalized value of the number of obtuse angles in the current path is determined in step S3 according to the following formula : wherein an included angle weight for representing the number of obtuse angles in the current path; The improved fitness of the current path is determined in step S4 according to the following formula : wherein and respectively represent and the weight of.
5. The path planning method based on the improved genetic annealing algorithm according to claim 3, characterized in that, In the step S200, the chromosomes to be analyzed are the chromosomes in the m populations; and in the step S300, the chromosomes to be analyzed are the chromosomes corresponding to each old solution and each new solution before and after each annealing operation. The genes in each chromosome are represented by different numerical values, each numerical value represents a section, and the numerical values are encoded by integers.
6. The path planning method based on improved genetic annealing algorithm according to claim 1, characterized in that, The step S300 specifically comprises: Step S10, setting initial temperature Threshold value ε, first counter i, second counter j, first sensitive value u, second sensitive value v, i and j are integers with initial value 0; The step S20 comprises: annealing each chromosome in the input sequence at a corresponding temperature to obtain a new solution corresponding to each chromosome respectively, calculating the improved fitness of each new solution, taking each chromosome reserved as an initial input sequence and an initial solution of the annealing operation, for each new solution, judging whether the difference between the improved fitness of the old solution and the new solution before and after the annealing operation is less than 0, if less than 0, accepting the new solution; if greater than or equal to 0, accepting the new solution according to the corresponding probability of the annealing operation, and the initial probability is a set value, and executing the step S30; The step S30 comprises: judging whether a cycle end condition is reached, if yes, taking the accepted new solution and the remaining old solution as a final solution corresponding to each chromosome; otherwise, taking the accepted new solution and the remaining old solution as an input sequence of the next annealing operation, and executing the step S40; The step S40 comprises: for each new solution after the annealing operation, judging whether the absolute value of the difference between the improved fitness of the old solution and the new solution before and after the annealing operation is greater than a threshold value ε, if yes, the first counter i+1, executing the step S50, otherwise, the second counter j+1, executing the step S50; The step S50 comprises: judging whether the first counter i is greater than a first sensitive value u, if yes, increasing the temperature, otherwise, executing the step S60; The step S60 comprises: judging whether the second counter j is greater than a second sensitive value v, if yes, clearing the first counter i and the second counter j, otherwise, decreasing the temperature; returning to execute the step S20.
7. The path planning method based on the improved genetic annealing algorithm according to claim 6, characterized in that, The step S10 further comprises: setting the number of annealing cycles L, the temperature increasing coefficient β and the temperature decreasing coefficient α, L is an integer with an initial value of 0; the step S60 further comprises: before returning to execute the step S20, setting the number of annealing cycles L+1; The step S30 comprises: judging whether the temperature reaches a set value and / or whether the number of annealing cycles L reaches a set value.
8. The path planning method based on the improved genetic annealing algorithm according to claim 6, characterized in that, The corresponding probability in the step S20 is: wherein denotes the difference in fitness of the old and new solutions before and after the annealing operation, denotes the temperature on which the annealing operation is based.
9. The path planning method based on the improved genetic annealing algorithm according to claim 6, characterized in that, The step S400 specifically comprises: after completing the cycle annealing operation, for each chromosome in the initial input sequence, comparing the improved fitness of the chromosome with the improved fitness of the final solution of the chromosome, and selecting a chromosome with greater improved fitness as a new chromosome; Judging whether a path planning end condition is reached, if yes, taking the path corresponding to the chromosome with the greatest improved fitness in each new chromosome as a planned path; otherwise, returning to execute the step S200.
10. The path planning method based on the improved genetic annealing algorithm according to claim 1, characterized in that, Before the step S300, further comprising: selecting, crossing and mutating each chromosome reserved. Before the step S300, further comprising: selecting, crossing and mutating each chromosome reserved.
Citation Information
Patent Citations
Complex curved surface spraying path planning method and system based on multi-chromosome particle swarm
CN116384608A
Method and system for determining motion path of mechanical arm
US20200101608A1
