Plate adaptation method and system applied to automatic splicing of polygonal plates
By constructing a board-adaptive layout model and using genetic iteration operations, the layout sequence and rotation angle in the automated splicing of polygonal boards are optimized, resolving the contradiction between board utilization and layout height in traditional technologies, and improving layout efficiency and stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-08
- Publication Date
- 2026-03-31
AI Technical Summary
Existing automated nesting technology presents a contradiction in balancing material utilization and nesting height, resulting in nesting results that are inconvenient to process and have poor stability. Traditional genetic algorithms do not effectively utilize material area information, affecting material utilization and nesting efficiency.
A panel layout model was constructed, generating two initial populations. The first population was sorted by panel area from largest to smallest, while the first half of the second population was not rotated. The layout order and rotation angle were optimized through genetic iteration, and the genetic iteration of the population was guided by the weights of maximum layout height and utilization rate.
It improves material utilization and layout efficiency, reduces the processing difficulty of layout boards, and achieves dynamic adaptation that balances layout height and material utilization, making it suitable for large-scale applications.
Smart Images

Figure CN120850383B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automated processing and layout technology based on swarm intelligence, specifically to a board fitting method and system applied to the automated splicing of polygonal boards. Background Technology
[0002] In manufacturing, such as glass, fabric, and steel cutting, raw material layout is related to the utilization rate of materials in production and has high economic and research value. Among them, automated layout is more efficient than manual layout, and layout algorithm is the core of realizing automated layout. A good layout algorithm can improve the utilization rate of materials, avoid waste of resources, thereby reducing enterprise costs and realizing green manufacturing.
[0003] At present, in automated nesting, most of the optimization targets are material utilization rate and genetic algorithms are used for nesting optimization. However, the existing technology has the following shortcomings: (1) In the actual production process, it is often desirable to concentrate the remaining area on the top of the mother plate and to keep the nesting height of the parts as low as possible, so as to facilitate subsequent processing. Therefore, the existing nesting optimization targets ignore the balance between nesting height and material utilization rate, which means that although the material utilization rate requirement can be met, the resulting nesting plate is not convenient for subsequent processing and increases the processing difficulty. (2) When using genetic algorithms for optimization, traditional technology usually directly performs random sorting to generate individual populations, which ignores the influence of the plate area on the arrangement (that is, in the manual nesting process, the method of arranging large plates first and then small plates is usually adopted to improve material utilization rate and nesting efficiency). Thus, the traditional optimization algorithm does not utilize the effective information of plate area, which will make the nesting results sometimes good and sometimes bad, with poor stability, thereby reducing the nesting efficiency and material utilization rate.
[0004] Therefore, given the aforementioned shortcomings, how to provide a board material adaptation method that can balance layout height and material utilization while improving layout efficiency has become an urgent problem to be solved. Summary of the Invention
[0005] The technical problem to be solved by this invention is the problem of panel layout and adaptation in automated panel splicing. The purpose is to provide a panel adaptation method and system for automated splicing of polygonal panels, which solves the problem that the traditional technology uses material utilization rate as the layout optimization target, resulting in high processing difficulty of the obtained layout panel, and the problem of low layout efficiency caused by ineffective utilization of panel area.
[0006] This invention is achieved through the following technical solution:
[0007] Firstly, a board adaptation method is provided for automated splicing of polygonal boards, including:
[0008] A panel adaptation layout model is constructed, wherein the optimization objective of the panel adaptation layout model is to minimize the maximum layout height of the panel on the layout master board and maximize the utilization rate of the layout master board.
[0009] Generate a first initial population, wherein the first initial population contains several first individuals, each first individual contains multiple first genes, each first gene corresponds to a plate, the arrangement order of the first genes is used to characterize the arrangement order of the corresponding plates, and the genes in the first individuals in the first half of the first initial population are arranged in descending order of plate area.
[0010] A second initial population is generated, wherein the second initial population contains several second individuals, each second individual contains multiple second genes, each second gene corresponds to a plate, and is used to characterize the arrangement rotation angle of the corresponding plate. The genes in the first half of the second individuals in the second initial population are all 0, which is used to characterize that the corresponding plate is not rotated during arrangement.
[0011] Based on the board material adaptation and layout model, genetic iteration operations are performed simultaneously on the first and second initial populations until the iteration stopping condition is met, thus obtaining the optimal layout order and optimal layout rotation angle of each board material in automated splicing.
[0012] Based on the above-disclosed content, this invention constructs a board-fitting layout model with the optimization objective of minimizing the maximum layout height of the boards on the layout motherboard while maximizing the utilization rate of the layout motherboard. Simultaneously, two initial populations are constructed. In the first initial population, the genes of the individuals in the first half are sorted according to the board area from largest to smallest, while the remaining individuals maintain random sorting. In the second initial population, the genes of the individuals in the first half are all 0, used to keep the boards from rotating, while the remaining individuals rotate randomly. Thus, after constructing the two initial populations, iterative genetic operations can be performed on both populations based on the aforementioned constructed board-fitting layout model. After the iterative genetic operations, the optimal layout order and optimal layout rotation angle for each board in automated splicing are obtained.
[0013] Through the above design, this invention utilizes the effective information of the board area to construct an initial population, ensuring that the initial population contains individuals with high board utilization rates. Based on this, during the optimization of the layout, larger boards can be prioritized for placement, facilitating subsequent use of smaller boards for area filling, thereby improving the utilization rate of the mother board. Furthermore, prioritizing the placement of larger boards also helps the algorithm quickly find a better layout scheme. Simultaneously, by using a board-adaptive layout model that combines the maximum layout height and the utilization rate of the mother board, the genetic iteration of the population can be guided, maximizing material utilization while minimizing the layout height. This reduces the processing difficulty of the resulting layout boards. Therefore, this invention provides a dynamic adaptation technology for board layout that balances layout height and material utilization with high layout efficiency, making it highly suitable for large-scale application and promotion.
[0014] In one possible design, a panel fit and layout model is constructed, including:
[0015] The board material matching layout model is constructed according to the following formula (1);
[0016] (1)
[0017] In the above formula (1), This indicates that the sheet material is compatible with the layout model. This indicates the maximum layout height of all boards after they are placed on the layout master board. This indicates the utilization rate of the layout master plate when all boards are placed on it. These represent the weight of the layout height and the weight of the utilization rate, respectively.
[0018] In one possible design, based on the board-fitting layout model, genetic iteration operations are simultaneously performed on the first and second initial populations, including:
[0019] Obtain the first and second populations at the t-th iteration, where when t is 1, the first and second populations at the t-th iteration are the first initial population and the second initial population, respectively.
[0020] Genetic operations are performed simultaneously on the first and second populations to obtain a first new population and a second new population, wherein the genetic operations include individual selection, individual crossover, and individual mutation.
[0021] Based on the kth first new individual in the first new population and the kth second new individual in the second new population, a board layout code result is generated, and when k is queried from 1 to K, several board layout codes are obtained, where K is the population size of the first new population.
[0022] The layout coding results of each board are decoded to obtain the layout information corresponding to each board layout coding result;
[0023] Based on the board material adaptation layout model and the layout information corresponding to the layout coding results of each board material, the fitness corresponding to the layout coding results of each board material is calculated. The smaller the fitness, the lower the maximum layout height on the layout mother board after each board material is laid out, and the greater the utilization rate of the layout mother board.
[0024] The minimum fitness among the various board layout coding results is taken as the optimal fitness for the t-th iteration;
[0025] Determine if the iteration stopping condition is met;
[0026] If not, then the first new population and the second new population will be used as the first population and the second population in the (t+1)th iteration, respectively.
[0027] Increment t by 1 and reacquire the first and second populations at the t-th iteration until the iteration stopping condition is met. Based on the optimal fitness of the board layout coding results corresponding to the optimal fitness at the time the iteration stopping condition is met, determine the optimal layout order and optimal layout rotation angle of each board.
[0028] In one possible design, the crossover probability during individual crossover operations is obtained as follows:
[0029] For two target individuals to be crossed in the target population, the fitness of each target individual in the target population is calculated based on the plate fitting and layout model. The target population is generated after the first population performs individual selection operation, and the two target individuals to be crossed are different from each other.
[0030] Based on the fitness of each target individual in the target population, the maximum fitness is determined and the mean fitness is calculated.
[0031] Obtain the maximum number of iterations, the maximum cross weight, and the minimum cross weight, and calculate the cross weight at the t-th iteration based on the maximum number of iterations, the maximum cross weight, and the minimum cross weight;
[0032] The crossover probability of the two target individuals to be crossed is calculated based on the maximum fitness, the mean fitness, and the crossover weight at the t-th iteration.
[0033] In a possible design, the cross weight at the t-th iteration is calculated based on the maximum number of iterations, the maximum cross weight, and the minimum cross weight, including:
[0034] The cross weights at the t-th iteration are calculated according to the following formula (2);
[0035] (2)
[0036] In the above formula (2), This represents the cross weight at the t-th iteration. This represents the maximum number of iterations. These represent the maximum and minimum cross weights, respectively. Indicates the weight adjustment factor;
[0037] Accordingly, based on the maximum fitness, the mean fitness, and the crossover weight at the t-th iteration, the crossover probability of the two target individuals to be crossed is calculated, including:
[0038] The crossover probability of the two target individuals to be crossed is calculated using the following formula (3);
[0039] (3)
[0040] In the above formula (3), This represents the crossover probability between two target individuals. This represents the maximum fitness. This represents the mean fitness value. This represents the fitness of the two target individuals to be crossed, where the fitness is the highest. These represent the maximum crossover probability and the minimum crossover probability, respectively.
[0041] In one possible design, the individual crossing method between the two target individuals to be crossed is as follows:
[0042] Generate a random integer and a first random number, wherein the value range of the first random number is (0,1), the value range of the random integer is [1,N], and N represents the length of any one of the two target individuals to be crossed;
[0043] Determine whether the first random number is less than the crossover probability of the two target individuals to be crossed;
[0044] If so, the intersection position is determined based on the random integer;
[0045] Based on the crossover position, the two target individuals to be crossovered are divided into a crossover part and a genetic part, wherein the genetic part of any target individual to be crossovered contains the gene located at the crossover position in any target individual.
[0046] Remove identical genes from the genetic portions of the two target individuals to be cross-crossed, resulting in the first genome and the second genome;
[0047] Using the first and second genomes, the crossover portion of the two target individuals to be crossovered is replaced to obtain the first crossover individual and the second crossover individual;
[0048] The intersection portions of the first and second intersecting individuals are swapped to obtain two target individuals after the swapping process.
[0049] In a possible design, any panel layout code result contains the layout order and rotation angle of each panel; wherein, decoding the layout code result of each panel yields the layout information corresponding to each panel layout code result, including:
[0050] For any board layout coding result, the layout order and layout rotation angle of each board are determined according to the layout coding result, and the sorted set is obtained according to the layout order of each board.
[0051] Obtain the set of horizontal lines, where the set of horizontal lines only includes the bottom edge of the layout master plate during the first layout;
[0052] Select the lowest horizontal line from the set of horizontal lines;
[0053] Starting with the first board in the sorted set, search for boards that can be placed on the lowest horizontal line at the same time, and use them as target boards.
[0054] Determine if the quantity of the target board is greater than 1;
[0055] If so, the target board is placed on the lowest horizontal line according to the corresponding layout rotation angle. If the number of target boards is equal to 1, the board with the largest width is selected from the boards after the first board in the sorted set, and the board with the largest width is swapped with the first board so that the new first board is placed on the lowest horizontal line according to the corresponding layout rotation angle.
[0056] Update the set of horizontal lines using the boards placed on the lowest horizontal line to obtain a new set of horizontal lines, and remove the boards placed on the lowest horizontal line from the sorted set to obtain a new sorted set;
[0057] The set of horizontal lines is updated to a new set of horizontal lines, the set of sorting is updated to a new set of sorting, and the set of horizontal lines is obtained again until all the boards in the set of sorting are placed. Then, the layout diagram and the maximum layout height among all the boards are obtained, and the layout information is composed using the layout diagram and the maximum layout height among all the boards.
[0058] In one possible design, if the number of target panels is less than 1, the method further includes:
[0059] Starting with the first board, search backwards for boards in the sorted set whose width is less than or equal to the lowest horizontal line;
[0060] Calculate the emission compatibility of each selected board material;
[0061] From the selected board materials, the board material with the highest emission compatibility is chosen as the designated board material;
[0062] Swap the positions of the specified board with the first board, and place the resulting new first board on the lowest horizontal line according to the corresponding layout rotation angle.
[0063] In a possible design, the emission compatibility of each selected panel is calculated, including:
[0064] Get the maximum area and maximum height of each board in the sorted set;
[0065] For any selected board material, the emission suitability of the selected board material is calculated based on the maximum area and maximum height, and according to the following formula (4);
[0066] (4)
[0067] In the above formula (4), This indicates the emission compatibility of any of the aforementioned board materials. The height, width, and area of any of the aforementioned plates are represented sequentially. This indicates the length of the lowest horizontal line. The maximum height and maximum area are represented in sequence.
[0068] Secondly, a panel fitting system for automated splicing of polygonal panels is provided, including:
[0069] The model building unit is used to build a board-adaptive layout model, wherein the optimization objective of the board-adaptive layout model is to minimize the maximum layout height of the board on the layout master board and maximize the utilization rate of the layout master board.
[0070] The sorting optimization unit is used to generate the first initial population, wherein the first initial population contains several first individuals, each first individual contains multiple first genes, each first gene corresponds to a board, the arrangement order of the first genes is used to characterize the sorting order of the corresponding board, and the genes in the first individuals in the first half of the first initial population are arranged in descending order of board area.
[0071] The layout optimization unit is used to generate a second initial population, wherein the second initial population contains several second individuals, each second individual contains multiple second genes, each second gene corresponds to a plate, and is used to characterize the layout rotation angle of the corresponding plate. The genes in the first half of the second individuals in the second initial population are all 0, which is used to characterize that the corresponding plate is not rotated during layout.
[0072] The layout optimization unit is also used to perform genetic iteration operations on the first initial population and the second initial population simultaneously based on the board material adaptation layout model until the iteration stopping condition is met, so as to obtain the optimal layout order and optimal layout rotation angle of each board material in automated splicing.
[0073] Thirdly, a board fitting device for automated splicing of polygonal boards is provided. Taking the device as an electronic device as an example, it includes a memory, a processor, and a transceiver that are connected in sequence. The memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the board fitting method for automated splicing of polygonal boards as described in the first aspect or any possible design of the first aspect.
[0074] Fourthly, a storage medium is provided, on which instructions are stored, which, when executed on a computer, perform the panel fitting method applied to the automated splicing of polygonal panels as described in the first aspect or any possible design of the first aspect.
[0075] Fifthly, a computer program product containing instructions is provided, which, when executed on a computer, cause the computer to perform the panel fitting method applied to the automated splicing of polygonal panels as described in the first aspect or any possible design of the first aspect.
[0076] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0077] In this invention, when performing panel layout adaptation, two initial populations of the same size are generated. In the first initial population, the genes of the first half of the individuals are arranged in descending order of panel area, while the genes of the remaining individuals are randomly ordered. In the second initial population, the genes of the first half of the individuals are 0, so the panels are not rotated, while the remaining individuals are randomly rotated. By generating the population in this way, individuals with high utilization rates can be obtained from the beginning, thereby accelerating the search and convergence speed of the algorithm and improving the optimization ability. At the same time, a panel layout adaptation model that combines the maximum layout height and the utilization rate of the parent panel is used to guide the genetic iteration of the population, which can maximize material utilization while minimizing the layout height. Based on this, the processing difficulty of the obtained layout panels can be reduced. Therefore, this invention provides a dynamic adaptation technology for panel layout that balances layout height and material utilization and has high layout efficiency, making it very suitable for large-scale application and promotion. Attached Figure Description
[0078] To more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of the present invention and should not be considered as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort. In the drawings:
[0079] Figure 1 This is a flowchart illustrating the steps of a panel adaptation method applied to automated splicing of polygonal panels according to an embodiment of the present invention.
[0080] Figure 2 This is a structural diagram of a panel adaptation system for automated splicing of polygonal panels provided in an embodiment of the present invention;
[0081] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0082] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to embodiments and accompanying drawings. The illustrative embodiments and descriptions of this invention are for explanation only and are not intended to limit the invention. It should be understood that although terms such as "first," "second," etc., may be used herein to describe various units, these units should not be limited by these terms. These terms are only used to distinguish one unit from another. For example, a first unit may be referred to as a second unit, and similarly, a second unit may be referred to as a first unit, without departing from the scope of the exemplary embodiments of this invention.
[0083] Example:
[0084] See Figure 1 As shown, the board fitting method for automated splicing of polygonal boards provided in this embodiment generates an initial population by arranging the boards in descending order of area and combining this with a non-rotation method. This can accelerate the algorithm's search and convergence speed and improve its optimization ability while ensuring population diversity. At the same time, by constructing a board fitting and layout model that takes into account both the maximum layout height and the utilization rate of the layout mother board, the genetic iteration of the population can be guided. This can maximize the utilization rate of the mother board while ensuring the minimum layout height, thereby reducing the processing difficulty of the layout board obtained after layout. Therefore, this method provides a dynamic board layout fitting technology that takes into account both layout height and material utilization and has high layout efficiency, making it very suitable for large-scale application and promotion. For example, this method can be run on the board processing end, but is not limited to. Optionally, the board processing end can be, but is not limited to, a computer. It is understood that the aforementioned execution subject does not constitute a limitation on the embodiments of this application. Accordingly, the operation steps of this method can be, but are not limited to, the steps S1 to S4 below.
[0085] S1. Construct a sheet material adaptation layout model, wherein the optimization objective of the sheet material adaptation layout model is to minimize the maximum layout height of the sheet material on the layout master plate and maximize the utilization rate of the layout master plate. In specific implementation, for example, this embodiment targets rectangular sheet material in polygonal sheet material, that is, to perform layout adaptation in the splicing of rectangular parts, that is, to place each rectangular part on the layout master plate, and while minimizing the maximum layout height, to maximize the utilization rate of the layout master plate as much as possible, so as to reduce the processing difficulty of the layout master plate on which the rectangular parts are placed while meeting the material utilization requirements.
[0086] Optionally, for example, but not limited to, the following formula (1) can be used to construct the aforementioned board adaptation layout model.
[0087] (1)
[0088] In the above formula (1), This indicates that the sheet material is compatible with the layout model. This indicates the maximum layout height of all boards after they are placed on the layout master board. This indicates the utilization rate of the layout master plate when all boards are placed on it. These represent the weight of the layout height and the weight of the utilization rate, respectively. In this embodiment, the constraints of the model are: the layout of the boards does not exceed the boundary of the layout mother board, and the layout boards do not overlap.
[0089] In practical implementation, the maximum layout height and utilization rate are obtained after arranging the boards according to a certain layout scheme onto the layout master board. For the utilization rate, first obtain the layout diagram formed after the boards are placed on the layout master board; then, segment the outline of the area where no boards are placed (called the free area) from the layout diagram; then, subtract the free area from the total area to obtain the total layout area of the boards; finally, the ratio between the total layout area of the boards and the area of the layout master board is used as the utilization rate. As mentioned earlier, the boards are rectangular; therefore, after segmenting the free area, if it is an irregular shape, it can be divided into multiple small rectangles to calculate its area. Of course, the above calculation method is a commonly used method for calculating the area of irregular areas, and its principle will not be elaborated further.
[0090] At the same time, it can be seen from the aforementioned formula (1) that, The smaller, and The larger the value, the smaller the overall model value. Therefore, to minimize the overall model value, we need to make... Reaching the minimum, and To reach the maximum; thus, after constructing a board-adaptive layout model that takes into account both the maximum layout height and the motherboard utilization rate according to the aforementioned formula (1), an initial population for board layout optimization can be constructed so that the initial population can be guided by the aforementioned board-adaptive layout model for subsequent iterative genetic operations, and then the optimal layout order and optimal layout rotation angle of each board in automated splicing can be determined in the iterative genetic operations.
[0091] Traditional genetic algorithms often generate the initial population by randomly sorting the boards, without considering the factor of prioritizing boards with larger areas (in actual layout, prioritizing the placement of larger boards provides greater flexibility, thereby improving layout efficiency and utilization to some extent). Therefore, existing technologies result in inconsistent layout results and poor stability, ultimately reducing layout efficiency. Based on this, this embodiment provides a population generation method that combines board area sorting, allowing for the acquisition of large-area boards at the initial iteration, thus accelerating the algorithm's search and convergence speed. The initial population construction process is shown in steps S2 and S3 below.
[0092] S2. Generate a first initial population, wherein the first initial population contains several first individuals, each first individual contains multiple first genes, each first gene corresponds to a board, the arrangement order of the first genes is used to characterize the sorting order of the corresponding boards, and the genes in the first individuals in the first 1 / 2 part of the first initial population are arranged in descending order of board area; in this embodiment, any first individual in the first initial population is encoded in decimal; specifically, in this embodiment, several first initial individuals are first generated, and then the genes in the first 1 / 2 part of the individuals are arranged in descending order of board area, thus generating the first initial population.
[0093] Specifically, for example, the length of the first initial individual is equal to the number of boards, and the gene is the board number. If there are 5 boards, numbered 1-5 respectively, and if any first initial individual is coded as (3,1,4,5,2), then it means that the arrangement order of board number 3 is 1, the arrangement order of board number 1 is 2, the arrangement order of board number 4 is 3, the arrangement order of board number 5 is 4, and the arrangement order of board number 2 is 5. Of course, the coding method of the other first initial individuals is the same, which will not be repeated here.
[0094] After generating several initial individuals, the first half of the individuals can be selected to sort their genes in descending order of board area. For example, assuming the areas of boards numbered 1-5 are 2, 6, 4, 8, and 10 respectively, then any of the aforementioned initial individuals becomes (5, 4, 2, 3, 1). Of course, the gene sequences of the remaining selected initial individuals are sorted in the same way. In this way, the gene sequences of the selected first half of the individuals will be the same (i.e., sorted in descending order of board area), thus ensuring that the initial population contains rectangular pieces with larger areas, thereby improving search efficiency.
[0095] Thus, after generating the first initial population based on the aforementioned step S2, the construction of the second initial population can be carried out, as shown in step S3 below.
[0096] S3. Generate a second initial population, wherein the second initial population contains several second individuals, each second individual contains multiple second genes, each second gene corresponds to a plate, used to characterize the arrangement rotation angle of the corresponding plate, and the genes in the first 1 / 2 of the second individuals in the second initial population are all 0, used to characterize that the corresponding plate is not rotated during arrangement.
[0097] In this embodiment, several second initial individuals are first generated. Each second initial individual uses a binary encoding method, that is, the gene is 1 or 0, and the length is equal to the number of boards. Specifically, a gene of 0 indicates that the boards are not rotated before being placed, and a gene of 1 indicates that the boards are rotated 90° before being placed. Then, the genes of the first half of the second initial individuals are all changed to 0 so that the boards are not rotated, while the remaining part remains unchanged, thereby ensuring the randomness of the board placement angle, that is, random rotation. At the same time, each of the aforementioned first individuals corresponds to a second individual, so as to determine the arrangement order and arrangement rotation angle of different boards in the future.
[0098] Based on this, the initial population is constructed in the aforementioned manner, and the benefits obtained are as follows: (1) The area is arranged in descending order: this makes the initial population contain some individuals with high board utilization, which is conducive to the algorithm quickly finding a better layout scheme. At the same time, it is also convenient to use small boards to flexibly fill the area in the future, thereby improving the board utilization rate; (2) The remaining part in the first initial population is randomly sorted, which ensures the diversity of the first initial population; (3) Half of the individuals in the second initial population have 0 genes, which can ensure that the initial population contains all the board layout schemes in the 0-degree direction, which is conducive to exploring the layout effect brought by rotation in the subsequent genetic operation. The remaining individuals are randomly rotated, which can ensure the diversity of the second initial population. Based on this, by using the aforementioned population construction method, individuals with high board utilization can be obtained at the beginning, thereby accelerating the search and convergence speed of the algorithm and improving the optimization ability. At the same time, the diversity of the initial population is enhanced, so that the algorithm can jump out of the local optimum.
[0099] After constructing the first and second initial populations, the plate fitting and layout model constructed in step S1 above can be used to guide the two populations to perform iterative genetic operations, as shown in step S4 below.
[0100] S4. Based on the board material adaptation and layout model, perform genetic iteration operations on the first initial population and the second initial population simultaneously until the iteration stopping condition is met, and obtain the optimal layout order and optimal layout rotation angle of each board material in automated splicing; in specific implementation, the aforementioned genetic iteration operation can be, but is not limited to, as shown in steps S41 to S49 below.
[0101] S41. Obtain the first and second populations at the t-th iteration, where, when t is 1, the first and second populations at the t-th iteration are the first initial population and the second initial population, respectively.
[0102] After obtaining the first and second populations at the t-th iteration, genetic operations can be performed on both populations simultaneously, as shown in step S42 below.
[0103] S42. Genetic operations are simultaneously performed on the first and second populations to obtain a first new population and a second new population, wherein the genetic operations include individual selection, individual crossover, and individual mutation. In specific implementation, individual selection is performed on the first population and the second population respectively to obtain a target population and a designated population; then, individual crossover is performed on the target population and the designated population to obtain a first crossover population and a second crossover population respectively; finally, individual mutation is performed on the first crossover population and the second crossover population to obtain a first new population and a second new population.
[0104] Specifically, taking the first type of group as an example, the individual selection operation is as follows:
[0105] Step 1: Determine the first individual in the first group and the corresponding second individual in the second group to generate several initial board layout codes. Each initial board layout code contains the layout order and layout rotation angle of each board.
[0106] Step 2: Decode the initial board layout coding results to obtain the initial layout information corresponding to each initial board layout coding result; In this embodiment, the decoding process is described in detail in step S44 below.
[0107] Step 3: Based on the board adaptation layout model and the initial layout information corresponding to each initial board layout code result, calculate the fitness of each initial board layout code result, and use the fitness of the initial board layout code result as the fitness of each first individual in each first group; wherein, the smaller the fitness, the lower the maximum layout height on the layout motherboard after each board is laid out, and the greater the utilization rate of the layout motherboard.
[0108] Step 4: Sort the first individuals in the first population according to their fitness from low to high, obtain the individual sorting sequence, and determine whether t is less than (3 / 4) × ,in, This represents the maximum number of iterations.
[0109] Step 5: If yes, divide the individual ranking sequence into three parts according to the ratio of 5%, 90%, and 5%, and replace the individuals in the bottom 5% with the individuals in the top 5% to obtain the target population; otherwise, divide the individual ranking sequence into three parts according to the ratio of 15%, 70%, and 15%, and replace the individuals in the bottom 15% with the individuals in the top 15% to obtain the target population.
[0110] Thus, by going through the first to fifth steps mentioned above, the individual selection operation of the first group can be completed. Of course, the individual selection operation of the second group is also the same. Since the two are in a corresponding relationship, the fitness of each individual in the first group can be used directly to select individuals. The process will not be described in detail here.
[0111] After completing the individual selection operations for the first and second populations, the individual crossover operation can be performed. When performing the individual crossover operation for the target population, the crossover probability of the two target individuals to be crossed in each group at the t-th iteration is calculated. Then, based on the crossover probability, the individual crossover is performed. For example, the calculation process of the crossover probability of the two target individuals to be crossed in the target population can be, but is not limited to, as shown in steps S42a to S42c below.
[0112] S42a. For two target individuals to be crossbred in the target population, the fitness of each target individual in the target population is calculated based on the board fitting and layout model. The target population is generated after the first population performs individual selection operations, and the two target individuals to be crossbred are different from each other. In this embodiment, since the genes of the first half of the individuals are arranged in descending order according to the board area when the first initial population is generated, there are multiple identical individuals in the first initial population. Based on this, different individuals need to be selected when crossbringing to ensure effective crossbringing. Of course, the proportion of individuals to be crossbred can be set according to actual use and is not specifically limited here.
[0113] Meanwhile, the calculation process of the fitness of each target individual in the target population is also combined with the designated individuals in the specified population that correspond to each target individual to generate the corresponding layout coding result, and then decoded and combined with the board adaptation layout model to calculate it. This embodiment is also described in detail in step S44 below.
[0114] After obtaining the fitness of each target individual, the maximum fitness can be selected and the mean fitness value can be calculated, as shown in step S42b below.
[0115] S42b. Based on the fitness of each target individual in the target population, determine the maximum fitness and calculate the mean fitness. In specific applications, after obtaining the maximum fitness and mean fitness at the t-th iteration, this embodiment introduces a crossover weight based on the traditional crossover operator to adjust the crossover probability at different iteration numbers. The calculation process of the crossover weight is shown in step S42b below.
[0116] S42b. Obtain the maximum number of iterations, the maximum cross weight, and the minimum cross weight, and calculate the cross weight at the t-th iteration based on the maximum number of iterations, the maximum cross weight, and the minimum cross weight.
[0117] In this embodiment, the cross weights at the t-th iteration can be calculated using, but are not limited to, the following formula (2).
[0118] (2)
[0119] In the above formula (2), This represents the cross weight at the t-th iteration. This represents the maximum number of iterations. These represent the maximum and minimum cross weights, respectively. This represents the weight adjustment factor; in this embodiment, the weight adjustment factor can be, but is not limited to, set to 0.01; meanwhile, the entire cross weight is an integer less than 1.
[0120] After obtaining the cross weights at the t-th iteration based on the aforementioned formula (2), the cross probability at the current iteration can be calculated, as shown in step S42c below.
[0121] S42c. Calculate the crossover probability of the two target individuals to be crossed based on the maximum fitness, the average fitness, and the crossover weight at the t-th iteration; in specific implementation, for example, but not limited to, the following formula (3) can be used to calculate the crossover probability of the two target individuals to be crossed.
[0122] (3)
[0123] In the above formula (3), This represents the crossover probability between two target individuals. This represents the maximum fitness. This represents the mean fitness value. This represents the fitness of the two target individuals to be crossed, where the fitness is the highest. These represent the maximum crossover probability and the minimum crossover probability, respectively; in this embodiment, The value is (0, 1).
[0124] In practical implementation, the formula (3) mentioned above... In essence, it is a value less than 1, meaning the denominator in the expression is greater than or equal to 0. The range of is [0,1]; where, It is a non-negative number and less than 1; thus, we can know the entire... The range is [0, Based on this, the range of the entire expression is... Therefore, the result is a value less than 1.
[0125] Based on this, during an iteration, if an individual's fitness is greater than the average fitness value at the time of the current iteration, the crossover probability of that individual is smaller (i.e., the crossover weight is multiplied by a numerical term less than 1, thus reducing the crossover probability). Conversely, if the fitness is less than the average fitness value at the time of the current iteration, the crossover probability of that individual is larger (i.e., the crossover weight is not multiplied by a numerical term less than 1). Therefore, it is possible to avoid performing crossover operations on excellent individuals with high fitness values during the current iteration, thereby preserving excellent individuals.
[0126] Furthermore, based on the aforementioned formula for calculating crossover weights, it can be seen that the trend of crossover weights decreases with the number of iterations. That is, the weights are larger in the early stages of iteration, which increases the crossover probability, strengthens the global search capability, and ensures population diversity. In the later stages of iteration, the weights are smaller, which reduces the crossover probability, thus ensuring that superior individuals in the population are not destroyed. Thus, the aforementioned improved formula for calculating crossover probability can, in one iteration, make the crossover probability of high fitness low and the crossover probability of low fitness high, and ensure that the crossover probability in the early stages of iteration is higher than that in the later stages of iteration. This ensures that there are more crossover operations in the early stages of iteration to maintain population diversity, and reduces crossover operations in the later stages to retain superior individuals.
[0127] Thus, through the aforementioned steps S42a to S42c, the crossover probability of two target individuals to be crossovered in the target population can be calculated; of course, the calculation process for the crossover probability of the other target individuals to be crossovered is the same, and will not be repeated here.
[0128] After obtaining the crossover probabilities of the two target individuals to be crossed, the individual crossover operation can be performed. The process can be, but is not limited to, the steps S42d to S42j below.
[0129] S42d. Generate a random integer and a first random number, wherein the value range of the first random number is (0,1), the value range of the random integer is [1,N], and N represents the length of any one of the two target individuals to be crossed.
[0130] In this embodiment, after generating the first random integer and the first random number, individual crossover can be performed, as shown in steps S42e to S42j below.
[0131] S42e. Determine whether the first random number is less than the crossover probability of the two target individuals to be crossed; in this embodiment, if the first random number is greater than or equal to the aforementioned crossover probability, then no individual crossover is performed, that is, the next pair of individuals is crossed; and if the first random number is less than the corresponding crossover probability, then the following step S42f is executed.
[0132] S42f. If so, the crossover position is determined based on the random integer; in this embodiment, assuming the random integer is 3, then the crossover position is the third gene; then, individual crossover can be performed based on the crossover position, as shown in the following steps S42g to S42j.
[0133] S42g. Based on the crossover position, the two target individuals to be crossovered are divided into a crossover portion and a genetic portion, wherein the genetic portion of any target individual to be crossovered contains the gene located at the crossover position in any target individual; in specific implementation, based on the aforementioned crossover position 3, an example is given:
[0134] Suppose the two target individuals to be crossovered are 2,4,5,1,2 and 4,3,1,5,2 respectively; then the crossover part is (1,2) and (5,2), while the genetic part is (2,4,5) and (4,3,1) respectively.
[0135] Thus, after obtaining the crossover portion and genetic portion corresponding to the two target individuals, the same gene can be removed, as shown in step S42h below.
[0136] S42h. Remove identical genes from the genetic portions of the two target individuals to be cross-crossed, obtaining the first genome and the second genome; in practice, the explanation will be based on the aforementioned example:
[0137] If the aforementioned genetic part contains the same gene 4, then it is removed. Therefore, the first genome is (2,5) and the second genome is (3,1). Then, gene replacement can be performed, as shown in step S42i below.
[0138] S42i. Using the first and second genomes, replace the crossover portion of the two target individuals to be crossovered to obtain the first crossover individual and the second crossover individual; in specific applications, (2,5) is used to replace the crossover portion (1,2), and (3,1) is used to replace the crossover portion (5,2). At this time, the first new individual is 2,4,5,2,5, and the second new individual is 4,3,1,3,1.
[0139] Thus, after obtaining the first and second crossover individuals, the individual crossover operation can be performed, as shown in step S42j below.
[0140] S42j. The intersection parts of the first and second intersection individuals are swapped to obtain two target individuals after the swap. In this embodiment, the 2 and 5 in (2,4,5,2,5) are swapped with the 3 and 1 in (4,3,1,3,1). At this time, the two target individuals after the swap are: 2,4,5,3,1; 4,3,1,2,5.
[0141] In addition, in this embodiment, if there are no identical genes in the genetic part, the crossover part is directly crossed, and then the positions of the duplicate genes in the two genes obtained by the crossover are swapped, so that two target individuals can be obtained after the crossover.
[0142] Thus, through the aforementioned steps S42d to S42j, the individual crossover operation of the target population can be completed, thereby obtaining the first crossover population; at the same time, for the specified population, since it is encoded in binary, the individual crossover can be performed directly according to the crossover probability and using a single-point crossover method to obtain the second crossover population.
[0143] After the crossover is completed, this embodiment may also include a step to determine whether the crossover individuals are acceptable, as shown below:
[0144] Assuming the two target individuals after crossover are A and B, firstly, calculate the fitness of target individual A and the fitness of target individual B; then, generate a random individual for each of target individuals A and B, resulting in a first random individual and a second random individual; next, calculate the fitness of the first random individual and the second random individual; then, if the fitness of the first random individual is greater than the fitness of target individual A, update target individual A to the first random individual; similarly, if the fitness of the second random individual is greater than the fitness of target individual B, update target individual B to the second random individual.
[0145] Meanwhile, if the fitness of the first random individual is less than or equal to the fitness of the target individual A, then the acceptance probability of the individual is calculated, and a third random number between [0,1] is generated; if the acceptance probability of the individual is less than or equal to the random number, then the first random individual is still used to replace the target individual A; otherwise, the target individual A is retained.
[0146] The formula for calculating the probability of an individual accepting the offer is as follows:
[0147] In the formula, Indicates the probability of an individual accepting the offer. This represents the fitness difference between the first random individual and the target individual. This indicates the preset coefficient.
[0148] Thus, by selecting individuals as described above, the algorithm's local search capability can be improved, preventing it from getting trapped in local optima.
[0149] After completing the aforementioned crossover operation, the individual mutation operation can be performed. Both individuals can be assigned the same mutation probability, which can be set based on the number of iterations. The calculation formula is as follows:
[0150]
[0151] In the formula, Indicates the probability of mutation. Represents the mutation function;
[0152] in, .
[0153] Thus, after obtaining the mutation probability, a second random number can be generated for any individual after the first crossover in the first crossover population; then, it is determined whether the second random number is less than the mutation probability; if so, two mutation points are randomly selected from any individual after the first crossover, and the genes at the two mutation points are swapped to obtain a mutated individual; thus, after performing individual mutation operations in the aforementioned manner, a first new population can be obtained.
[0154] Similarly, for the second crossover population, the mutation method is the same as that of the first crossover population, except that the genes at the mutation points are inverted, i.e., 0 becomes 1 and 1 becomes 0.
[0155] Thus, through the aforementioned step S42 and its sub-steps, the genetic operations of the first and second populations at the t-th iteration can be completed. Then, the individuals obtained through genetics can be decoded to determine the merits of the sorting scheme. The decoding process can be, but is not limited to, the steps S43 and S44 described below.
[0156] S43. Based on the kth first new individual in the first new population and the kth second new individual in the second new population, a board layout coding result is generated, and when k is queried from 1 to K, several board layout coding results are obtained, where K is the population size of the first new population; in this embodiment, as previously explained, each first individual corresponds to a second individual, so after the genetic operation, the two are also in one-to-one correspondence. Based on this, the first new individual determines the board layout order, while the second new individual determines the board layout rotation angle.
[0157] For example, suppose the kth new individual is 3, 5, 2, 1, 4, and its corresponding second new individual is 0, 1, 1, 1, 0. Then, it means that the board numbered 3 is placed first, and it is not rotated during placement. The board numbered 5 is placed second, and it needs to be rotated 90° before placement. Similarly, in the above manner, the placement order and rotation angle of the remaining boards can be determined. Based on this, based on the first and second new populations, several board placement coding results can be generated (i.e., by splicing the first and second new individuals to obtain the corresponding coding results). Each board placement coding result corresponds to a placement scheme and includes the placement order and rotation angle of each board.
[0158] In this way, after obtaining several board layout coding results, decoding processing can be performed, that is, board layout is performed, so that the fitness of each board layout coding result can be calculated based on the layout information obtained from the layout and the board adaptation layout model. The process is shown in step S44 below.
[0159] S44. Decode the layout coding results of each board to obtain the layout information corresponding to each board layout coding result; in specific implementation, the decoding process can be, but is not limited to, the steps S44a to S44h below.
[0160] S44a. For any board layout coding result, determine the layout order and layout rotation angle of each board according to the layout coding result, and obtain the sorting set according to the layout order of each board; in this embodiment, taking the above as an example, the obtained sorting set is {3,5,2,1,4}, that is, the first board is the board numbered 3; of course, the sorting set is different when the board layout coding results are different.
[0161] After obtaining the sorted set, the boards can be placed. In this embodiment, an improved minimum horizontal line placement algorithm is provided. When placing the current board, the algorithm searches backward to see if there are any boards that can be placed to the remaining minimum horizontal line. In other words, it searches for boards that can be placed to the minimum horizontal line all at once and places them all at once. This avoids the problem of unusable voids and reduced utilization caused by placing the current board and then placing the next board in the traditional technology.
[0162] The specific decoding and emission process is shown in steps S44b to S44h below.
[0163] S44b. Obtain the set of horizontal lines, wherein the set of horizontal lines only includes the bottom edge of the layout master plate during the first layout.
[0164] After obtaining the set of horizontal lines, the lowest horizontal line can be selected, as shown in step S44c below.
[0165] S44c. Select the lowest horizontal line from the set of horizontal lines; in practice, the lowest horizontal line is the horizontal line with the lowest height in the set of horizontal lines. Of course, initially, it is the bottom edge of the layout mother board; in this way, after obtaining the lowest horizontal line, the boards can be laid out, and the process is as shown in step S44d below.
[0166] S44d. Starting with the first board in the sorted set, search for boards that can be placed on the lowest horizontal line simultaneously, and use them as target boards. In specific implementation, this involves determining whether the width of the first board is less than or equal to the lowest horizontal line. If so, subtract the width of the first board from the lowest horizontal line to obtain an updated lowest horizontal line. Then, starting with the first board in the sorted set, search backwards for boards with a width less than or equal to the updated lowest horizontal line. If so, mark them to obtain marked boards. Next, update the first board to the marked board and replace the maximum horizontal line with the updated lowest horizontal line. Finally, subtract the width of the first board from the lowest horizontal line again until the entire sorted set has been searched. In this way, at least one marked board can be obtained. Based on this, the first board and the marked board can be used as target boards.
[0167] Based on this, after obtaining the target material, it can be determined whether the number of target materials is greater than 1, so that different discharge operations can be performed according to the number of target materials, as shown in steps S44e and S44f below.
[0168] S44e. Determine if the quantity of the target board is greater than 1.
[0169] S44f. If so, place the target board at the lowest horizontal line according to the corresponding layout rotation angle.
[0170] Thus, through the aforementioned design, this embodiment can identify and discharge all boards that can be discharged to the lowest level in one go; based on this, compared with traditional technology, it can avoid the generation of unusable voids, thereby improving the utilization rate of the motherboard.
[0171] Furthermore, if in the aforementioned step S44d, only the current board material can be placed on the lowest horizontal line, then in this embodiment, the current board material will not be placed, and a board material position transformation will be performed. The process is as follows:
[0172] If the number of target boards is equal to 1, then select the board with the largest width from all boards after the first board in the sorted set, and swap the position of the board with the first board so that the new first board is placed on the lowest horizontal line according to the corresponding layout rotation angle; in specific implementation, if there are multiple shifts with the largest width and the same position, then select the board with the highest width and swap its position with the first board.
[0173] In this way, by finding the widest board after the first board and swapping its position with the first board, we can avoid concentrating large boards in the later stages of arrangement, which would increase unusable space and affect the layout effect.
[0174] Furthermore, in this embodiment, if the number of target boards is less than 1 in the aforementioned step S44d, meaning the first board cannot be placed on the lowest horizontal line, then it is also necessary to search backwards. This embodiment provides a board search method based on area and height criteria, the process of which is shown in the following steps:
[0175] (1) Starting from the first board, search backwards for boards in the sorted set whose width is less than or equal to the lowest horizontal line.
[0176] (2) Calculate the emission suitability of each selected board; in this embodiment, the maximum area and maximum height of each board in the sorted set can be obtained first; then, for any selected board, the emission suitability of the board is calculated based on the maximum area and maximum height, according to the following formula (4).
[0177] (4)
[0178] In the above formula (4), This indicates the emission compatibility of any of the aforementioned board materials. The height, width, and area of any of the aforementioned plates are represented sequentially. This indicates the length of the lowest horizontal line. The maximum height and maximum area are represented in sequence.
[0179] Thus, the matching degree of each board can be calculated by the aforementioned formula (4); in the aforementioned formula (4), the first two terms on the right side of the formula are height and area terms, which means that the influence of board height and area on the layout effect is considered. Therefore, when there are multiple boards with the same difference between the width and the length of the horizontal line, the board with the larger height and area will be selected first; based on this, the principle of arranging boards with larger area and height first is realized.
[0180] Based on this, after calculating the emission compatibility of each selected board, the board with the highest emission compatibility can be selected for position swapping, as shown in steps (3) and (4) below.
[0181] (3) Select the board with the highest emission compatibility from the selected boards and use it as the designated board.
[0182] (4) Swap the positions of the specified board with the first board, and place the new first board on the lowest horizontal line according to the corresponding layout rotation angle.
[0183] In addition, in this embodiment, if there are no boards with a width less than or equal to the lowest horizontal line in step (1), then the lowest horizontal line needs to be raised and the set of horizontal lines needs to be updated. The process of raising the lowest horizontal line is as follows: each board is arranged according to the sorted set and arranged with the corresponding rotation angle. Then, the top edge of each board is used as a pre-selected horizontal line (each board is placed directly on the maximum horizontal line). Next, the pre-selected horizontal line that is closest to the lowest horizontal line and has the lowest height is selected as the designated horizontal line. Finally, the lowest horizontal line is raised to the designated horizontal line and the set of horizontal lines is updated.
[0184] Thus, after completing one emission, the set of horizontal lines and the set of sorted lines can be updated, as shown in step S44g below.
[0185] S44g. Using the boards placed on the lowest horizontal line, update the horizontal line set to obtain a new horizontal line set, and remove the boards placed on the lowest horizontal line from the sorted set to obtain a new sorted set; in this embodiment, the top edge of the board placed on the lowest horizontal line is added to the horizontal line set as a new horizontal line; at the same time, if there is no empty space on the lowest horizontal line, the lowest horizontal line is deleted from the horizontal line set; in this way, the update of the horizontal line set can be completed.
[0186] After obtaining the new set of horizontal lines and the new set of sorting, the set of horizontal lines can be updated to the new set of horizontal lines, the set of sorting can be updated to the new set of sorting, and the first board can be selected again for placement. That is, the process starts again from step S44c until all boards are placed. Then the layout diagram and the maximum layout height can be obtained. The process is shown in step S44h below.
[0187] S44h. Update the horizontal line set to a new horizontal line set, update the sort set to a new sort set, and re-acquire the horizontal line set until all boards in the sort set have been placed, to obtain the layout diagram and the maximum layout height among all boards, so as to use the layout diagram and the maximum layout height among all boards to form the layout information.
[0188] Thus, through the aforementioned steps S44a to S44h, the decoding of the layout coding results of each board can be completed, thereby obtaining the corresponding layout information. Then, the fitness of each board layout coding result can be calculated based on the corresponding layout information, so as to perform population iteration based on the fitness. The process is shown in step S45 below.
[0189] S45. Based on the board material adaptation layout model and the layout information corresponding to the layout coding results of each board material, calculate the fitness corresponding to the layout coding results of each board material. The smaller the fitness, the lower the maximum layout height on the layout motherboard after each board material is laid out, and the greater the utilization rate of the layout motherboard.
[0190] In this embodiment, after obtaining the layout diagram, the outline of the area where no boards are placed can be segmented from the layout diagram; then, the total layout area of the boards is obtained by subtracting the empty area from the total area of the layout master board; finally, the ratio between the total layout area of the boards and the area of the layout master board is used as the utilization rate of the layout master board; at the same time, the utilization rate and the maximum layout height are substituted into the board adaptation layout model to obtain the fitness corresponding to each board layout coding result; of course, the calculation method of the fitness of the individual is also the same when the aforementioned individual selection and cross operation is performed, and can be uniformly referred to step S44 and its sub-steps.
[0191] Thus, after obtaining the fitness of each board layout coding result, the smallest fitness can be selected, as shown in step S46 below.
[0192] S46. The minimum fitness among the various board layout coding results is taken as the optimal fitness for the t-th iteration. In practical applications, after obtaining the optimal fitness for the t-th iteration, it can be determined whether the iteration stopping condition can be met. The process is shown in step S47 below.
[0193] S47. Determine whether the iteration stopping condition is met; In this embodiment, the iteration stopping condition may be, but is not limited to, t reaching the maximum number of iterations, or the difference between the optimal fitness in several consecutive iterations being less than a preset threshold (such as the difference between the optimal fitness in 3 or 5 consecutive iterations being less than a preset threshold); If any of the aforementioned conditions is not met, then population update is required and iteration continues, as shown in steps S48 and S49 below.
[0194] S48. If not, then the first new population and the second new population are respectively used as the first population and the second population in the (t+1)th iteration; in this embodiment, after using the first new population and the second new population as the first population and the second population in the (t+1)th iteration, the iteration operation can continue, and the process is shown in step S49 below.
[0195] S49. Increment t by 1 and reacquire the first and second populations at the t-th iteration until the iteration stopping condition is met. Based on the optimal fitness of the board layout coding results corresponding to the optimal fitness at the time the iteration stopping condition is met, determine the optimal layout order and optimal layout rotation angle of each board.
[0196] Thus, through the aforementioned steps S41 to S49, when the iteration stopping condition is met, the optimal arrangement order and optimal arrangement rotation angle of each board can be obtained by decoding based on the optimal fitness corresponding to the optimal fitness when the iteration stopping condition is met. The decoding result can be found in the aforementioned step S44, and will not be repeated here.
[0197] Therefore, through the board fitting method applied to the automated splicing of polygonal boards described in the aforementioned steps S1 to S4, this invention provides a dynamic board fitting technology that balances layout height and material utilization, and has high layout efficiency, making it very suitable for large-scale application and promotion.
[0198] Furthermore, although this embodiment mainly uses rectangular plates for demonstration, the method is also applicable to any plate that can be simplified into a convex polygon. By performing polygon approximation and boundary envelope calculation on plates with arbitrary complex contours, the layout logic is still applicable to the adaptation of rotation angle, area priority and space filling principles, and has high versatility and expansion potential.
[0199] like Figure 2 As shown, the second aspect of this embodiment provides a hardware system for implementing the board adaptation method for automated splicing of polygonal boards described in the first aspect of the embodiment, comprising:
[0200] The model building unit is used to build a board-adaptive layout model. The optimization objective of the board-adaptive layout model is to minimize the maximum layout height of the board on the layout master board and maximize the utilization rate of the layout master board.
[0201] The sorting optimization unit is used to generate the first initial population, wherein the first initial population contains several first individuals, each first individual contains multiple first genes, each first gene corresponds to a board, the arrangement order of the first genes is used to characterize the sorting order of the corresponding board, and the genes in the first individuals in the first half of the first initial population are arranged in descending order of board area.
[0202] The layout optimization unit is used to generate a second initial population, wherein the second initial population contains several second individuals, each second individual contains multiple second genes, each second gene corresponds to a plate and is used to characterize the layout rotation angle of the corresponding plate, and the genes in the first 1 / 2 of the second individuals in the second initial population are all 0, which is used to characterize that the corresponding plate is not rotated during layout.
[0203] The layout optimization unit is also used to perform genetic iteration operations on the first initial population and the second initial population simultaneously based on the board material adaptation layout model until the iteration stopping condition is met, so as to obtain the optimal layout order and optimal layout rotation angle of each board material in automated splicing.
[0204] The working process, working details and technical effects of the system provided in this embodiment can be found in the first aspect of the embodiment, and will not be repeated here.
[0205] like Figure 3 As shown, the third aspect of this embodiment provides a board fitting device for automated splicing of polygonal boards. Taking the device as an electronic device as an example, it includes: a memory, a processor, and a transceiver connected in sequence. The memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the board fitting method for automated splicing of polygonal boards as described in the first aspect of the embodiment.
[0206] For specific examples, the memory may include, but is not limited to, random access memory (RAM), read-only memory (ROM), flash memory, first-in-first-out (FIFO) memory, and / or first-in-last-out (FILO) memory, etc.; specifically, the processor may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor may be implemented using at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), PLA (Programmable Logic Array). The processor may also include a main processor and a coprocessor. The main processor, also known as the CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state.
[0207] In some embodiments, the processor may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. For example, the processor may not be limited to microprocessors of the STM32F105 series, reduced instruction set computer (RISC) microprocessors, x86 architecture processors, or processors with integrated neural network processing units (NPUs). The transceiver may be, but is not limited to, a Wi-Fi transceiver, a Bluetooth transceiver, a General Packet Radio Service (GPRS) transceiver, a ZigBee (a low-power LAN protocol based on the IEEE 802.15.4 standard) transceiver, a 3G transceiver, a 4G transceiver, and / or a 5G transceiver. Furthermore, the device may also include, but is not limited to, a power module, a display screen, and other necessary components.
[0208] The working process, working details and technical effects of the electronic device provided in this embodiment can be found in the first aspect of the embodiment, and will not be repeated here.
[0209] The fourth aspect of this embodiment provides a storage medium that stores instructions containing the board adaptation method for automated splicing of polygonal boards as described in the first aspect of the embodiment. That is, the storage medium stores instructions that, when the instructions are run on a computer, execute the board adaptation method for automated splicing of polygonal boards as described in the first aspect of the embodiment.
[0210] The storage medium refers to a carrier for storing data, which may include, but is not limited to, floppy disks, optical disks, hard disks, flash memory, USB flash drives, and / or memory sticks. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
[0211] The working process, working details and technical effects of the storage medium provided in this embodiment can be found in the first aspect of the embodiment, and will not be repeated here.
[0212] The fifth aspect of this embodiment provides a computer program product containing instructions that, when executed on a computer, cause the computer to perform the board fitting method applied to the automated splicing of polygonal boards as described in the first aspect of this embodiment, wherein the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
[0213] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A plate fitting method applied to automatic splicing of polygonal plates, characterized in that, The application comprises the following steps: a plate fitting layout model is constructed, wherein the optimization target of the plate fitting layout model is to make the maximum layout height of the plate on the layout master plate lowest and the utilization rate of the layout master plate maximum; a first initial population is generated, wherein the first initial population contains a plurality of first individuals, each first individual contains a plurality of first genes, each first gene corresponds to a plate, the arrangement order of the first gene is used to represent the layout order of the corresponding plate, and the genes in the first 1 / 2 part of the first individuals in the first initial population are arranged in the order from large to small according to the plate area; a second initial population is generated, wherein the second initial population contains a plurality of second individuals, each second individual contains a plurality of second genes, each second gene corresponds to a plate, and is used to represent the layout rotation angle of the corresponding plate, and the genes in the first 1 / 2 part of the second individuals in the second initial population are all 0, which is used to represent that the corresponding plate does not rotate during layout; the genetic iteration operation is performed on the first initial population and the second initial population based on the plate fitting layout model, until the iteration stop condition is met, and the optimal layout order and the optimal layout rotation angle of each plate in automatic splicing are obtained; the genetic iteration operation is performed on the first initial population and the second initial population based on the plate fitting layout model, including: the first population and the second population at the tth iteration are obtained, wherein when t is 1, the first population and the second population at the tth iteration are the first initial population and the second initial population respectively; the genetic operation is performed on the first population and the second population to obtain a first new population and a second new population, wherein the genetic operation includes individual selection operation, individual crossover operation and individual mutation operation; a plate layout coding result is generated based on the kth first new individual in the first new population and the kth second new individual in the second new population, and a plurality of plate layout coding results are obtained when k is polled from 1 to K, wherein K is the population size of the first new population; the decoding processing is performed on each plate layout coding result to obtain the layout information corresponding to each plate layout coding result; the fitness of each plate layout coding result corresponding to the layout information is calculated based on the plate fitting layout model and the layout information, wherein the smaller the fitness is, the lower the maximum layout height of each plate on the layout master plate is after the layout, and the larger the utilization rate of the layout master plate is; the smallest fitness in each plate layout coding result is taken as the optimal fitness of the tth iteration; whether the iteration stop condition is met is judged; if not, the first new population and the second new population are taken as the first population and the second population at the (t+1)th iteration respectively; t is increased by 1, and the first population and the second population at the tth iteration are obtained again, until the iteration stop condition is met, so that the optimal layout order and the optimal layout rotation angle of each plate are determined based on the plate layout coding result corresponding to the optimal fitness when the iteration stop condition is met.
2. The method of claim 1, wherein, The plate fitting layout model is constructed, including: the plate fitting layout model is constructed according to the following formula (1); (1) In the above equation (1), represents a plate fitting layout model, represents the maximum layout height of all the plates after all the plates are placed on the layout master plate, represents the utilization rate of the layout master plate when all the plates are placed on the layout master plate, respectively represents the layout height weight and the utilization rate weight.
3. The method of claim 1, wherein, The cross probability of the individual cross operation is obtained in the following manner: For two target individuals to be crossed in the target population, based on the plate adaptive layout model, the fitness of each target individual in the target population is calculated, wherein the target population is generated after the individual selection operation of the first population, and the two target individuals to be crossed are different from each other; Based on the fitness of each target individual in the target population, the maximum fitness is determined, and the average fitness is calculated; The maximum iteration number, the maximum cross weight and the minimum cross weight are obtained, and based on the maximum iteration number, the maximum cross weight and the minimum cross weight, the cross weight at the tth iteration is calculated; According to the maximum fitness, the average fitness and the cross weight at the tth iteration, the cross probability of the two target individuals to be crossed is calculated.
4. The method of claim 3, wherein, Based on the maximum iteration number, the maximum cross weight and the minimum cross weight, the cross weight at the tth iteration is calculated, including: According to the following formula (2), the cross weight at the tth iteration is calculated; (2) In the above equation (2), denotes the cross-over weight at the tth iteration, denotes the maximum number of iterations, denotes the maximum cross-over weight and the minimum cross-over weight, respectively, denotes the weight adjustment factor; Accordingly, according to the maximum fitness, the average fitness and the cross weight at the tth iteration, the cross probability of the two target individuals to be crossed is calculated, which includes: The following formula (3) is used to calculate the cross probability of the two target individuals to be crossed; (3) In the above formula (3), denotes a crossover probability of two target individuals to be crossed, denotes the maximum fitness, denotes the mean fitness, denotes the maximum fitness of the fitnesses of two target individuals to be crossed, denotes the maximum crossover probability and the minimum crossover probability, respectively.
5. The method of claim 4, wherein, The individual cross method of the two target individuals to be crossed is as follows: A random integer and a first random number are generated, wherein the value range of the first random number is (0, 1), the value range of the random integer is [1, N], and N represents the length of any target individual of the two target individuals to be crossed; It is judged whether the first random number is less than the cross probability of the two target individuals to be crossed; If yes, the cross position is determined based on the random integer; According to the cross position, the two target individuals to be crossed are divided into a cross part and a genetic part, wherein the genetic part of any target individual of the two target individuals to be crossed contains the gene of the target individual at the cross position; The same genes in the genetic parts of the two target individuals to be crossed are removed to obtain a first gene group and a second gene group; The first gene group and the second gene group are used to replace the cross parts in the two target individuals to be crossed to obtain a first cross individual and a second cross individual; The cross parts in the first cross individual and the second cross individual are exchanged to obtain the two target individuals after cross.
6. The method of claim 1, wherein, Any plate layout coding result contains the layout order and the layout rotation angle of each plate; wherein the decoding processing of each plate layout coding result obtains the layout information corresponding to each plate layout coding result, including: For any plate layout coding result, the layout order and the layout rotation angle of each plate are determined according to any plate layout coding result, and the sorting set is obtained according to the layout order of each plate; A horizontal line set is obtained, wherein the horizontal line set only contains the bottom edge of the layout mother plate in the first layout; The lowest horizontal line is selected from the horizontal line set; Taking the first board in the sorting set as a starting point, a board capable of being placed on the lowest horizontal line is searched as a target board; It is judged whether the number of target boards is greater than 1; If yes, the target boards are placed on the lowest horizontal line according to the corresponding layout rotation angle, wherein if the number of target boards is equal to 1, the largest width board is selected from the boards after the first board in the sorting set, and the largest width board and the first board are interchanged in position, so that the new first board is placed on the lowest horizontal line according to the corresponding layout rotation angle; The board placed on the lowest horizontal line is used to update the horizontal line set to obtain a new horizontal line set, and the board placed on the lowest horizontal line is removed from the sorting set to obtain a new sorting set; The horizontal line set is updated to the new horizontal line set, the sorting set is updated to the new sorting set, and the horizontal line set is reacquired until all boards in the sorting set are placed, to obtain a layout drawing and a maximum layout height in all boards, so as to use the layout drawing and the maximum layout height in all boards to form the layout information.
7. The method of claim 6, wherein, If the number of target boards is less than 1, the method further comprises: Taking the first board as a starting point, searching for boards with a width less than or equal to the lowest horizontal line in the sorting set; Calculating the layout adaptation degree of each selected board; Selecting the board with the largest layout adaptation degree from the selected boards as a specified board; Interchanging the specified board and the first board in position, and placing the new first board obtained on the lowest horizontal line according to the corresponding layout rotation angle.
8. The method of claim 7, wherein, Calculating the layout adaptation degree of each selected board comprises: Obtaining the maximum area and the maximum height of each board in the sorting set; For any selected board, based on the maximum area and the maximum height, the layout adaptation degree of the board is calculated according to formula (4) as follows: (4) In the above equation (4), represents the discharge fitness of any one of the boards, represents the height, width and area of any one of the boards in turn, represents the length of the lowest horizontal line, represents the maximum height and maximum area in turn.
9. A plate adapting system applied in automatic splicing of polygonal plates, characterized in that, The system for implementing the method of any one of claims 1-8 comprises: A model construction unit for constructing a board adaptive layout model, wherein the optimization target of the board adaptive layout model is to make the maximum layout height of the board on the layout masterboard the lowest and the utilization rate of the layout masterboard the largest; A layout optimization unit for generating a first initial population, wherein the first initial population contains a plurality of first individuals, each first individual contains a plurality of first genes, each first gene corresponds to a board, the arrangement order of the first gene is used to represent the layout order of the corresponding board, and the genes in the first 1 / 2 of the first individuals in the first initial population are arranged in the order of decreasing board area; A layout optimization unit for generating a second initial population, wherein the second initial population contains a plurality of second individuals, each second individual contains a plurality of second genes, each second gene corresponds to a board, and is used to represent the layout rotation angle of the corresponding board, and the genes in the first 1 / 2 of the second individuals in the second initial population are all 0, which is used to represent that the corresponding board is not rotated during layout. The nesting optimization unit is further configured to perform genetic iteration operations on the first initial population and the second initial population simultaneously based on the plate adaptation nesting model, and obtain the optimal nesting sequence and the optimal nesting rotation angle of each plate in the automatic splicing when an iteration stop condition is met.
Citation Information
Patent Citations
Robot assembly unit multi-objective layout optimization method based on multi-group distribution estimation algorithm
CN109917754A
Resource assignment optimization using direct encoding and genetic algorithms
US20070005522A1