A multi-forest area route scheduling planning method based on double-layer nested genetic algorithm
Through the double -layer nested genetic algorithm optimization of the Duolin area aviation application route, the problem of low route scheduling planning efficiency in the existing technologies has been solved, the shortest path planning is achieved, the efficiency of the drug application operation is improved, and the economic cost is reduced. Essence
Patent Information
- Application Number
- CN202110264083.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-11
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2041-03-11
AI Technical Summary
The existing technology is difficult to effectively solve the planning problem of dispatching routes during aviation pharmaceutical application operations in Duolin District, resulting in low efficiency and high economic costs.
The dual -layer nested genetic algorithm is adopted. The first layer of genetic algorithm optimizes the scheduling path of the Dolilin area through the decimal encoding. The second layer of genetic algorithm further optimizes the route of the route through binary coding to avoid repeated calculations and improve calculation efficiency.
The shortest path planning of the Duolin District route scheduling path has been achieved, the efficiency of administration operation is improved, the scheduling range is shortened, the working hours and aviation fuel use, and the economic costs are reduced.
Smart Images

Figure CN115081663B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of forestry management, and in particular to a multi-forest area route scheduling planning method based on a double-layer nested genetic algorithm. Background Art
[0002] The terrain of my country's forest areas is very complex, with both large concentrated forest areas and small scattered forest areas. For example, the forest areas in the northeast and southwest are mostly large forest areas, while the forest areas in the eastern region are mainly protective forests in areas such as roads, villages and farmland, and are mostly small forests. In the process of aerial pesticide application, it is often the case that the application area is divided into multiple smaller forest areas. Therefore, the scheduling route planning of multiple forest areas is particularly important. At present, there is little research on the scheduling route during aerial pesticide application in multiple forest areas, which is difficult to meet the use needs of aerial pesticide application in multiple forest areas, which has brought certain troubles to the pesticide application operation in multiple forest areas. Summary of the invention
[0003] The purpose of the present invention is to provide a multi-forest area route scheduling planning method based on a double-layer nested genetic algorithm with simple operation and improved efficiency in view of the above problems.
[0004] In order to achieve the above object, the technical solution of the present invention is:
[0005] A multi-forest area route scheduling planning method based on a double-layer nested genetic algorithm comprises the following steps:
[0006] S1. Set the population size and length, crossover probability, and mutation probability of the first-layer genetic algorithm according to the number of forest areas that need to be sprayed; set the population size and length, crossover probability, and mutation probability of the second-layer genetic algorithm;
[0007] S2, using a decimal encoding method and a random population generation method to obtain an initial population Chrom1; and expanding the initial population Chrom1 to obtain a population Chrom11;
[0008] S3, using binary coding for the second-layer genetic algorithm, and obtaining the population Chrom2 by randomly generating binary numbers;
[0009] S4. Modify the Kth row of the extended population Chrom11 according to the population Chrom2 to obtain the modified extended population Chrom22 for the kth row in Chrom1; the chromosome in the modified population Chrom22 represents the scheduling path of the real entry and exit point path, calculate the scheduling path length corresponding to each row of chromosomes in the population Chrom22, and use the reciprocal of the scheduling path length corresponding to each row of chromosomes in the population Chrom22 as the fitness value of each row of the population Chrom2;
[0010] S5, performing selection, crossover, and mutation operations on the chromosomes in population Chrom2, and then performing a reversal operation to generate an updated population Chrom3, and assigning the data of population Chrom3 to population Chrom2;
[0011] S6, detecting whether the number of iterations of the second-layer genetic algorithm exceeds the maximum number of iterations, when the number of iterations does not exceed the maximum number of iterations, returning to step S4, otherwise proceeding to step S7;
[0012] S7, calculate the fitness of the Kth row in population Chrom1: the Kth row in population Chrom11 is modified and expanded according to the binary code of each row in population Chrom2, and the modified expanded population Chrom22 is obtained, and the shortest distance value in Chrom22 is taken as the fitness of the Kth row in population Chrom1, recorded as f1(k);
[0013] S8, determine whether the K value is greater than the population size of population Chrom1; when K≥size(Chrom1,1), set K=1 and proceed to step S8, otherwise set K=K+1 and return to step S4;
[0014] S9, performing selection, crossover, and mutation operations on the scheduling length in population Chrom1, and then performing a reversal operation; reinserting the updated population Chrom1;
[0015] S10, checking whether the number of iterations exceeds the maximum number of iterations, if the number of iterations does not exceed the maximum number of iterations, returning to step S2, otherwise proceeding to step S11;
[0016] S11. Output the shortest scheduling path by calculation. The shortest scheduling path is the shortest scheduling path of the multi-forest area route scheduling plan.
[0017] Furthermore, the population size in the first-layer genetic algorithm population in step S1 is set to 4 to 6 times the sum of the number of forest areas and the aircraft take-off and landing points, and the number of iterations, crossover probability, mutation probability, and generation gap are all set to constants; the crossover probability is set to 0.6 to 0.9, the mutation probability is set to 0.0001 to 0.1, and the generation gap is set to 0.9 to 0.95.
[0018] Furthermore, in step S3, the population size in the second-layer genetic algorithm population is set to 4 to 6 times the sum of the number of forest areas and the aircraft take-off and landing points, and the crossover probability, mutation probability, and generation gap are all set to constants; the crossover probability is set to 0.6 to 0.9, the mutation probability is set to between 0.0001 and 0.1, and the generation gap is set to 0.9 to 0.95.
[0019] Compared with the prior art, the present invention has the following advantages and positive effects:
[0020] The present invention plans the route scheduling path of multiple forest areas by adopting a double-layer nested genetic algorithm, so as to obtain the shortest scheduling path, which avoids excessive repeated calculation processes and has high calculation efficiency, thereby improving the path planning efficiency of pesticide application in multiple forest areas; the present invention can shorten the scheduling distance of pesticide application operations in multiple forest areas, save the working time of pesticide application operations in multiple forest areas, and improve the pesticide application efficiency in forest areas, and it effectively reduces the use of aviation fuel, saves the economic cost of pesticide application operations in forest areas, and brings convenience to pesticide application operations in multiple forest areas. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0022] Figure 1 It is a double-layer nested genetic algorithm flow chart in the present invention;
[0023] Figure 2 Plan mission charts for multi-forest routes;
[0024] Figure 3 This is a schematic diagram of route planning within a single area;
[0025] Figure 4 This is a schematic diagram of the global route scheduling planning results for Duolin District. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work, any modifications, equivalent substitutions, improvements, etc., should be included in the protection scope of the present invention.
[0027] like Figures 1 to 4 As shown, this embodiment discloses a multi-forest route scheduling planning method based on a double-layer nested genetic algorithm, and its route planning tasks are as follows: Figure 2 The aircraft starts from the take-off and landing point H, then passes through the entry and exit points of each area, traverses each area, and then returns to H. The route for scheduling between areas is required to be the shortest. Figure 3The full coverage route planning algorithm shown in the figure is to draw a parallel line from the longest side of the boundary according to the width of the aircraft jet. When it reaches the intersection of other boundaries, the aircraft turns around and flies until all the areas of the area are traversed. Therefore, each area must have an entry point and an exit point. When scheduling, it must enter and exit from two points, but it is not specific which point. For example, from Figure 2 After entering from A1, you must exit from A2, or after entering from A2, you must exit from A1. Figure 3 The route plan shown. Figure 1 The double-layer nested genetic algorithm shown in the figure is used for route planning, and the following is obtained: Figure 4 The better results shown.
[0028] The process of double-layer nested genetic algorithm is as follows Figure 1 As shown:
[0029] The following is the algorithm implementation process:
[0030] Step 1: The algorithm starts, and the population size and length of the first-level genetic algorithm are set according to the number of forest areas that need to be sprayed. For example, if there are 5 forest areas that need to be sprayed, the population length is set to 5+1=6. The reason is that each forest area is represented by the midpoint of the line connecting the entry and exit points, such as Figure 2 As shown in A0 in Figure 1 The aircraft take-off and landing point in is also regarded as a point and placed at the last position of the population length. Then the scheduling task of 5 forest areas is regarded as the scheduling task of 6 forest areas. The number of populations is set to 4-6 times the number of cities. For example, if the scheduling task of 5 areas is to be completed, the number of populations can be set between 24-36. Set the number of iterations of the first-layer algorithm GEN1 to a constant, such as 500; the crossover probability, mutation probability, and generation gap are all set to constants. The crossover probability is set to between 0.6-0.9, the mutation probability is set to between 0.0001-0.1, and the generation gap is set to 0.9-0.95. Then set the population size, mutation probability, and maximum number of iterations GEN2 of the second-layer genetic algorithm. Use binary coding to express the status of the entry and exit points of each forest area. The population size is also set to 4-6 times the sum of the number of forest areas and the aircraft take-off and landing points. The chromosome length is set to the sum of the number of forest areas and the aircraft take-off and landing points. The crossover probability, mutation probability, and generation gap are all set to constants. The crossover probability is set between 0.6 and 0.9, the mutation probability is set between 0.0001 and 0.1, and the generation gap is set between 0.9 and 0.95.
[0031] Step 2: Use decimal encoding and random population generation to obtain the initial population Chrom1. For example, 123456, 213465, and 345216 can all be a chromosome in the population, and the numbers must not be repeated. If the population number in the first step is set to 30, there are 30 randomly generated chromosomes in the initial population.
[0032] Step 3: Expand the population Chrom1 to get Chrom11, according to the following expansion method. For example, for the 5-area scheduling tasks, the English letters ABCDEH are used to correspond to the decimal numbers 123456, where H and 6 represent the take-off and landing points of the aircraft. In step 1, the midpoint of the line connecting the entry and exit points of each forest area is used to represent the forest area. After step 2, the initial population is obtained. Next, the entry and exit points of each forest area need to be considered. For example, 132456 represents a chromosome, and 6 is the take-off and landing point. Then add another chromosome of equal length after the chromosome, and the size of each gene of the added chromosome is the value of each gene of the chromosome before replication plus the length value of the Chrom1 chromosome. Then the 132456 chromosome becomes 1 3 2 4 5 6 7 9 8 10 11 12 after the initial expansion. Among them, 7 9 810 11 12 are the result of adding the length value of the Chrom1 chromosome to the replicated chromosomes. The expanded chromosome is recorded as Chrom0, and then it is sorted. In Chrom0, the first half of the chromosomes use 1 3 2 4 5 6 to represent the entry point of each corresponding area, and the second half of the chromosomes 7 9 8 10 11 12 represent the corresponding exit point of each area. The entry point and exit point of each area are placed adjacent to each other, and the operation order of each forest area is kept in the original order. After the adjustment, the chromosome 1 73 9 2 8 4 10 5 11 6 12 represents the real scheduling path after considering the entry and exit points. After the sorting operation of Chrom0, the extended population Chrom11 is obtained. The above chromosomes described by the forest area operation points are A1 A2 C1C2 B1 B2 D1 D2 E1 E2 H1 H2.
[0033] The forest area number, entry and exit point coordinates, and entry and exit point midpoint connection coordinates are shown in Table 1. The values in the table are reference values for a random example. Among them, 6 and H represent the take-off and landing points of the aircraft. The coordinate values of the midpoint, entry point, and departure point of the take-off and landing points of the aircraft are the same. Then all forest area entry and exit points and aircraft take-off and landing points are regarded as a pseudo area to calculate the extended distance neighborhood table DD, as shown in Table 2.
[0034] Table 1 Reference examples of coordinate values required for scheduling in each area
[0035]
[0036] Table 2 Domain distance matrix considering the entry and exit points of the area and the aircraft take-off and landing points
[0037]
[0038] Step 4: Initialize and generate the population Chrom2 of the second-level genetic algorithm. Binary coding is used for the second-level genetic algorithm. Taking three areas as an example, the operation sequence is assumed to be ABC. The operation starting points of area A can be A1 and A2 or A2 and A1, and the two states are represented by 0 and 1 respectively. Then the state code of A1A2B1B2C1C2 is 000, indicating that the operation sequence is A1 in, A2 out, B1 in, B2 out, C1 in, C2 out, and then back to A1. Then the state code of A1A2B2B1C1C2 is 010. The initial population Chrom2 is obtained by randomly generating binary numbers. For the scheduling task of the above 5 areas and 1 aircraft take-off and landing point, 00 1 0 1 0, 1 0 1 0 1 0, and 1 1 1 0 1 1 can all be a chromosome in Chrom2.
[0039] Step 5: Calculate the fitness f2 of the second-layer genetic algorithm. According to the state population Chrom2, the Kth row of the extended population Chrom11 is modified to obtain the modified extended population Chrom22 for the kth row in Chrom1. The chromosome in the modified Chrom22 represents the real scheduling path considering the entry and exit point paths. The modification method is shown in Table 3.
[0040] Table 3 An example of modifying Chrom11 based on the state table Chrom2
[0041]
[0042] For example, in the Kth row of chromosomes of Chrom11, 1 and 7 represent the entry and exit points of area A respectively. When the corresponding state in Chrom2 is 1, it means that the entry and exit points of area A are A2 in and A1 out, that is, 1 and 7 in Chrom11 are swapped. The corresponding chromosomes in Chrom22 are 7 and 1. When the corresponding state in Chrom2 is 0, the corresponding genes in Chrom11 are not adjusted. And so on, until the Kth row of chromosomes of Chrom11 is completely corrected according to the Chrom2 chromosomes. The corrected chromosomes in Chrom22 are shown in the third row of Table 3. The flight route represented by this chromosome is A2A1C1C2B1B2D2D1E1E2H2H1. The Kth row of chromosomes of Chrom11 is corrected once according to each row of chromosomes in Chrom2 to obtain the corrected new population Chrom22, and then the path calculation length subroutine PathLength is called according to the extended neighborhood table DD to obtain the scheduling path length corresponding to each row of chromosomes in Chrom22. The length of the chromosome below can be calculated based on the DD table and the PathLength function. Chromosome 7 1 3 9 2 8 10 4 5 11 12 6 represents the length of the path 7-1-3-9-2-8-10-4-5 -11-12-6-7, that is, the length of the A2-A1-C1-C2-B1-B2-D2-D1-E1-E2-H2-H1-A2 loop. The length minus the length of the line between the entry and exit points of each forest area can be used to get the actual path length.
[0043] Calculate the fitness f2: Calculate the length of the scheduling path corresponding to each row of chromosomes in Chrom22. The inverse of the length of the scheduling path corresponding to each row of chromosomes in Chrom22 is used as the fitness value of each row of Chrom2. f2(i)=l(Chrom11(k){state(Chrom2(i))})=lChrom22(i).
[0044] Step 6: Perform selection, crossover, and mutation operations on the chromosome of Chrom2. Choose the roulette wheel method.
[0045] Step 7: Reverse the operation on Chrom2 that has gone through step 7. Considering the large amount of calculation of the scheduling task, in order to avoid the solution falling into the local optimum, the reversal operation can enhance the ability of global search. If the chromosome is 100101, it breaks at 2 and 3, 4 and 5 and then reverses and inserts, the new code string is 10-01-01.
[0046] Step 8: Re-insert to generate the updated population Chrom2.
[0047] Step 9: Check whether the number of iterations exceeds the maximum number of iterations GEN2. When the number of iterations ≤ GEN2, return to step 5, otherwise proceed to step 10.
[0048] Step 10: Calculate the fitness of the Kth row in Chrom1. Chrom2 has been optimized by GEN2 iterations. The Kth row in Chrom11 corrects the extended population according to each row in the Chrom2 state table, and obtains the corrected extended population Chrom22. The shortest distance value in Chrom22 is taken as the fitness of the Kth row in Chrom1, recorded as f1(k).
[0049] Step 11: Determine whether the K value is greater than the population size of Chrom1. When K ≥ size(Chrom,1), set K=1 and proceed to step 12; otherwise, set K=K+1 and return to step 5.
[0050] Step 12: Perform selection, crossover, and mutation operations on the population Chrom according to the parameter values set in step 1.
[0051] Step 13: Perform a reversal operation on population Chrom1. If the chromosome is 12345678, and breaks occur at positions 2 and 3, 6 and 7 and then reverse insertion, the new code string is 12-6543-78. The reversal operation is used to enhance the global search capability of the algorithm.
[0052] Step 14: Re-insert to generate new populations of Chrom1.
[0053] Step 15: Check whether the number of iterations exceeds the maximum number of iterations GEN1. When the number of iterations ≤ GEN1, return to step 6, otherwise proceed to step 3, otherwise proceed to step 16.
[0054] Step 16: Read the job sequence in Chrom1 and the state table in Chrom2 corresponding to the shortest scheduling path, and record the length of the shortest scheduling path.
[0055] Step 17: The algorithm ends.
[0056] The present invention adopts a two-layer genetic algorithm nesting method; wherein, the fitness calculation method of the first-layer genetic algorithm depends on the result of the second layer, and the encoding method of the first-layer algorithm is related to the number of patches, and uses decimal encoding; the fitness calculation method of the second-layer genetic algorithm depends on the result of the first layer, and the encoding method of the second-layer algorithm uses binary to indicate the state of the aircraft entering each forest area. This algorithm requires a total of GEN1*GEN2 iterations. GEN1 and GNE2 are the maximum number of iterations set for the two-layer algorithms of the algorithm.
[0057] At the same time, the population obtained by the first-level genetic algorithm in the present invention needs to be expanded, and a custom expansion algorithm is used. For example, ABC represents a job sequence solved by the first-level algorithm, A represents 1, B represents 2, and C represents 3, that is, the job sequence is 1-2-3, and 1-4-2-5-3-6 is used to represent the real scheduling path after considering the entry point. At this time, 1 represents point A1, 4 represents point A2, 2 represents B1, 5 represents B2, 3 represents C1, and 6 represents C2 in the expanded real scheduling path. That is, each area plus the number of forest areas represents the second point of the forest area. For example, in the above-mentioned 1-4-2-5-3-6 job sequence, each entry and exit point is regarded as a point of the traveling salesman problem, and the distance of 1-4-2-5-3-6-1 is calculated according to the query of the expanded neighborhood table, that is, the distance of A1-A2-B1-B2-C1-C2-A1, recorded as S1, which is the complete distance. Then the actual dispatching path distance between multiple forest areas = the complete distance - the sum of the distances between the entry and exit points in each forest area, such as S0 = S1 - the length of (A1A2 + B1B2 + C1C2).
[0058] The present invention plans the route scheduling path of multiple forest areas by adopting a double-layer nested genetic algorithm, so as to obtain the shortest scheduling path, which avoids excessive repeated calculation processes and has high calculation efficiency, thereby improving the path planning efficiency of pesticide application in multiple forest areas; the present invention can shorten the scheduling distance of pesticide application operations in multiple forest areas, save the working time of pesticide application operations in multiple forest areas, and improve the pesticide application efficiency in forest areas, and it effectively reduces the use of aviation fuel, saves the economic cost of pesticide application operations in forest areas, and brings convenience to pesticide application operations in multiple forest areas.
Claims
1. A multi-forest route scheduling planning method based on a double-layer nested genetic algorithm, characterized by: The following steps are involved: S1. Set the population size and length, crossover probability, and mutation probability of the first-layer genetic algorithm according to the number of forest areas that need to be sprayed; set the population size and length, crossover probability, and mutation probability of the second-layer genetic algorithm; S2, using a decimal encoding method and a random population generation method to obtain an initial population Chrom1; and expanding the initial population Chrom1 to obtain a population Chrom11; S3, using binary coding for the second-layer genetic algorithm, and obtaining the population Chrom2 by randomly generating binary numbers; S4. Modify the Kth row of the extended population Chrom11 according to the population Chrom2 to obtain the modified extended population Chrom22 for the kth row in Chrom1; the chromosome in the modified population Chrom22 represents the scheduling path of the real entry and exit point path, calculate the scheduling path length corresponding to each row of chromosomes in the population Chrom22, and use the reciprocal of the scheduling path length corresponding to each row of chromosomes in the population Chrom22 as the fitness value of each row of the population Chrom2; S5, performing selection, crossover, and mutation operations on the chromosomes in population Chrom2, and then performing a reversal operation to generate an updated population Chrom3, and assigning the data of population Chrom3 to population Chrom2; S6, detecting whether the number of iterations of the second-layer genetic algorithm exceeds the maximum number of iterations, when the number of iterations does not exceed the maximum number of iterations, returning to step S4, otherwise proceeding to step S7; S7, calculate the fitness of the Kth row in population Chrom1: the Kth row in population Chrom11 is modified and expanded according to the binary code of each row in population Chrom2, and the modified expanded population Chrom22 is obtained, and the shortest distance value in Chrom22 is taken as the fitness of the Kth row in population Chrom1, recorded as f1(k); S8, determine whether the K value is greater than the population size of population Chrom1; when K≥size(Chrom1,1), set K=1 and proceed to step S8, otherwise set K=K+1 and return to step S4; S9, performing selection, crossover, and mutation operations on the scheduling length in population Chrom1, and then performing a reversal operation; reinserting the updated population Chrom1; S10, checking whether the number of iterations exceeds the maximum number of iterations, if the number of iterations does not exceed the maximum number of iterations, returning to step S2, otherwise proceeding to step S11; S11. Output the shortest scheduling path by calculation. The shortest scheduling path is the shortest scheduling path of the multi-forest area route scheduling plan.
2. The multi-forest route scheduling planning method based on a double-layer nested genetic algorithm as claimed in claim 1 is characterized by: The population size of the first-layer genetic algorithm population in step S1 is set to 4 to 6 times the sum of the number of forest areas and the aircraft take-off and landing points, and the number of iterations, crossover probability, mutation probability, and generation gap are all set to constants; the crossover probability is set to 0.6 to 0.9, the mutation probability is set to 0.0001 to 0.1, and the generation gap is set to 0.9 to 0.
95.
3. The multi-forest area route scheduling planning method based on a double-layer nested genetic algorithm as claimed in claim 2 is characterized by: The population size of the second-layer genetic algorithm population in step S3 is set to 4 to 6 times the sum of the number of forest areas and the aircraft take-off and landing points, and the crossover probability, mutation probability, and generation gap are all set to constants; the crossover probability is set to 0.6 to 0.9, the mutation probability is set to between 0.0001 and 0.1, and the generation gap is set to 0.9 to 0.95.
Citation Information
Patent Citations
Ship branch pipeline path planning method
CN105975674A
Improved genetic algorithm-based traveling salesman problem solving method
CN107122843A