Single-specification one-dimensional blanking method and device based on improved genetic algorithm
By improving the genetic algorithm and combining it with deep search and heuristic algorithms, the one-dimensional blanking method was optimized, which solved the problems of low profile optimization rate and multiple layout schemes, and achieved efficient profile processing and cost reduction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ANHUI UNIV
- Filing Date
- 2022-12-01
- Publication Date
- 2026-07-03
AI Technical Summary
Existing technologies for one-dimensional material cutting suffer from low profile optimization rates and multiple layout methods, leading to inconvenience in factory processing.
An improved genetic algorithm, combined with deep search and heuristic algorithms, was used to encode the genes of the parent material and the daughter material in a four-segment coding method, select the best population, and optimize the sorting scheme through gene repair, crossover and mutation.
While ensuring operating speed, improve the profile optimization rate, reduce the number of layout schemes, meet the factory processing needs, and reduce processing costs.
Smart Images

Figure CN115829030B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer application technology, and in particular to a single-specification one-dimensional cutting method and apparatus based on an improved genetic algorithm. Background Technology
[0002] The blanking problem refers to the process of processing raw materials into the required size through cutting, trimming, stamping, etc. According to the dimension of the raw materials and parts, the blanking problem can be divided into three types: one-dimensional blanking, two-dimensional blanking, and three-dimensional blanking. Among them, the one-dimensional blanking problem refers to the process of cutting raw materials of known length into various lengths according to the required number of parts, such as the blanking of bars, tubes, and wires.
[0003] Currently, many scholars have proposed various optimization algorithms for the one-dimensional material cutting problem, such as linear programming, branch and bound, dynamic programming, heuristic algorithms, simulated annealing, genetic algorithms, and evolutionary algorithms. However, in actual production processes, if only depth-first search algorithms are used, it is easy to get trapped in local optima, while using only genetic algorithms results in slow convergence speed, a certain degree of randomness, and too many sorting methods. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention provides a single-specification one-dimensional cutting method and apparatus based on an improved genetic algorithm. This solves the technical problems of low profile optimization rate and multiple layout methods that lead to inconvenience in factory processing. By integrating the depth search algorithm into the genetic algorithm, the invention achieves the goal of significantly reducing the layout scheme while ensuring that the utilization rate is not reduced.
[0005] To solve the above-mentioned technical problems, the present invention provides the following technical solution: a single-specification one-dimensional cutting method based on an improved genetic algorithm, comprising the following steps:
[0006] S1. Determine the gene coding method based on the information of the parent material and the daughter material;
[0007] S2. Generate an initial population containing multiple gene codes according to the gene coding method, and call a deep search to optimize the initial population to obtain an incomplete population, wherein the gene codes include mother material segment codes and daughter material segment codes, corresponding to the sorting scheme of mother material and daughter material;
[0008] S3. Use a heuristic algorithm to repair the genes of individuals in the incomplete population, and calculate the fitness of each repaired individual according to the fitness function. Select the individuals with the highest fitness value as the dominant population.
[0009] S4. Based on the remaining material of the sorting scheme, a heuristic algorithm is called to perform diversification processing on the dominant population, and the population individual with the highest fitness value is extracted as the current population.
[0010] S5. Cross and mutate the individuals in the dominant population and the current population to obtain the optimal population, and regard the sorting scheme corresponding to the gene encoding in the optimal population as a one-dimensional feeding scheme.
[0011] Further, step S2 specifically includes:
[0012] S21. Generate an initial population containing multiple gene codes based on the gene coding method;
[0013] S22. Based on the initial population, the code corresponding to the smallest sub-material is extracted by calling the base traversal, and the complete layout scheme library is obtained by using the constraint function to repair it.
[0014] S23. Assign priority to the complete layout scheme according to the priority function and put the top five layout schemes with the highest priority into the final scheme library;
[0015] S24. Update the current material selection library based on existing material requirements;
[0016] S25. Repeat S21 to S24 until all sub-materials in the candidate library have been completely traversed;
[0017] S26. Select the highest priority ACC solutions from the final solution library, determine how many times the sub-material M can be changed or how many times it can be expanded, and take the minimum of the two to obtain ACC cases. For each case, execute step S27.
[0018] S27. Repeat S25 and S26 until the number of schemes in the complete layout scheme library F is less than 5 after a certain depth search. Record the current status and store it in the final total scheme library.
[0019] S28. Set R_L to R_R+1 and R_R to 100, then repeat S27.
[0020] S29. Set R_R to R_R+1, set R_R to 300, and repeat S27.
[0021] Furthermore, step S3 specifically includes:
[0022] S31. Perform gene repair on individuals in an incomplete population to obtain repaired individuals;
[0023] S32. Calculate the fitness of each individual in the repaired population according to the fitness function, and take the individual with the largest fitness value as the dominant population.
[0024] Furthermore, step S4 specifically includes:
[0025] S41. Divide the dominant population into two parts, the parent and the mother, based on the remaining material from the sampling plan.
[0026] S42. Extract genes x and y from the parent class and the mother class respectively;
[0027] S43. Combine genes x and y to form a new individual N and place it into the parent class;
[0028] S44. Repeat steps S42 and S43 until the parent class is empty;
[0029] S45. Use a heuristic algorithm to complete the current parent class to obtain the complete population and put it into the container ALL;
[0030] S46. Repeat steps S41 to S45 a preset number of times to obtain a diverse population with a rich variety of species.
[0031] S47. Calculate the fitness of all populations in the diverse population, and select the population with the highest fitness value as the current population.
[0032] Further, step S5 specifically includes:
[0033] S51. Perform crossover and mutation on individuals in the dominant population and the current population, and call a heuristic algorithm to repair genes to obtain complete individuals;
[0034] S52. Repeat step S51 a preset number of times to obtain a new generation population composed of complete individuals. Extract the individual with the largest fitness value from the dominant population, the current population and the new generation population. If the fitness value of the individual with the largest fitness value is greater than the fitness value of the dominant population, then take it as the local optimal solution III. At the same time, select the second highest fitness value individual and take the two as the parent and mother of the next generation.
[0035] S53. Repeat step S52. If no better population individuals are found after a preset number of consecutive attempts, the population individuals corresponding to the local optimal solution III are regarded as the optimal population, and the sorting scheme corresponding to the gene encoding in the optimal population is regarded as a one-dimensional feeding scheme.
[0036] Furthermore, after step S5, the method further includes: S6, using depth search based on the sub-material information to reduce the one-dimensional cutting scheme and obtain the optimal cutting scheme.
[0037] Further, step S6 specifically includes:
[0038] S61. Traverse the one-dimensional material cutting schemes and set all schemes whose usage times are less than or equal to k as sub-materials and put them into the temporary sub-material library.
[0039] S62. Call the depth search function to process the temporary sub-material library. If it is found that the number of schemes has not decreased or the number of master materials used has increased, then k = k-1. Repeat step S61 until the number of schemes decreases or k = 0 when the number of master materials used remains unchanged or decreases, and obtain the optimal cutting scheme after reduction.
[0040] An apparatus for implementing the above-described single-specification one-dimensional cutting method based on an improved genetic algorithm, comprising:
[0041] The encoding method determination module is used to determine the gene encoding method based on the parent material information and the daughter material information;
[0042] An incomplete population generation module is used to generate an initial population containing multiple gene codes according to the gene coding method, and to call a deep search to optimize the initial population to obtain an incomplete population. The gene codes include mother material segment codes and daughter material segment codes, corresponding to the sorting scheme of mother material and daughter material.
[0043] A dominant population generation module is used to perform gene repair on individuals in the incomplete population using a heuristic algorithm, calculate the fitness of each repaired individual based on a fitness function, and select the individuals with the highest fitness value as the dominant population.
[0044] The contemporary population generation module is used to call a heuristic algorithm to perform diversification processing on the dominant population based on the remaining material of the sorting scheme, and extract the population individuals with the highest fitness value as the contemporary population.
[0045] A one-dimensional material cutting scheme determination module is used to perform crossover and mutation on individuals in the dominant population and the current population to obtain the optimal population, and to regard the sorting scheme corresponding to the gene encoding in the optimal population as a one-dimensional material cutting scheme.
[0046] Furthermore, it also includes a one-dimensional cutting scheme reduction module, which is used to perform a depth search based on the sub-material information to reduce the one-dimensional cutting scheme and obtain the optimal cutting scheme.
[0047] By employing the above technical solution, the present invention provides a single-specification one-dimensional cutting method and apparatus based on an improved genetic algorithm, which has at least the following beneficial effects:
[0048] 1. This invention employs a four-segment coding method to encode the genes of the parent material and the daughter material. Based on the fitness value of each gene code, a depth-first search based on a greedy algorithm is used to select the best population. This effectively overcomes the shortcomings of conventional genetic algorithms, which require multiple iterations to obtain a good population or result in poor final results due to premature exit from the genetic process. In addition, by using a layout scheme as a gene replication and proposing three mutation methods, it can seek better genes while inheriting the original excellent genes. Under the premise of ensuring running speed, it further improves the profile optimization rate, reduces the number of layout schemes, and better meets the needs of factory processing. It solves the technical problem of inconvenience in factory processing caused by too many layout schemes.
[0049] 2. This invention greatly expands the search range and speed by transforming depth search into a base traversal and optimizing the initial population based on a priority function. Furthermore, by establishing the boundary of the search surplus material and selecting a heuristic algorithm for completion, the speed of determining the one-dimensional cutting scheme is further improved. This achieves the goal of significantly reducing the number of layout schemes while ensuring the profile optimization rate, thereby reducing factory production and processing costs and enhancing practicality. Attached Figure Description
[0050] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0051] Figure 1 This is a flowchart of a single-specification one-dimensional blanking method provided in Embodiment 1 of the present invention;
[0052] Figure 2 This is a schematic diagram illustrating the layout scheme for determining the dominant species in the single-specification one-dimensional cutting method provided in Embodiment 1 of the present invention.
[0053] Figure 3 This is a schematic diagram illustrating the crossover and mutation operations performed on the dominant population in the single-specification one-dimensional cutting method provided in Embodiment 1 of the present invention.
[0054] Figure 4 This is a schematic diagram of the single-specification one-dimensional feeding device provided in Embodiment 1 of the present invention;
[0055] Figure 5 This is a flowchart of a single-specification one-dimensional blanking method provided in Embodiment 2 of the present invention;
[0056] Figure 6 This is a schematic diagram illustrating the reduction of the material cutting scheme in the single-specification one-dimensional material cutting method provided in Embodiment 2 of the present invention;
[0057] Figure 7This is a schematic diagram of the single-specification one-dimensional feeding device provided in Embodiment 2 of the present invention.
[0058] In the diagram: 10. Encoding method determination module; 20. Incomplete population generation module; 30. Dominant population generation module; 40. Contemporary population generation module; 50. One-dimensional cutting scheme determination module; 60. One-dimensional cutting scheme reduction module. Detailed Implementation
[0059] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. This will allow for a full understanding of how the present application uses technical means to solve technical problems and achieve technical effects, and to facilitate its implementation.
[0060] Example 1
[0061] Please refer to Figures 1-3 This illustrates a specific implementation of the present embodiment. This embodiment selects an excellent population from the initial population by calling a depth search based on a greedy algorithm. This can effectively overcome the shortcomings of conventional genetic algorithms, which require multiple iterations to obtain an excellent population or result in poor final results due to premature exit from the genetic algorithm. It achieves the goal of further improving the profile optimization rate and reducing the layout scheme while ensuring the running speed, thus better meeting the needs of factory processing.
[0062] like Figure 1 As shown, a single-specification one-dimensional blanking method based on an improved genetic algorithm includes the following steps:
[0063] S1. Determine the gene encoding method based on the information of the parent material and the daughter material.
[0064] During the sampling process, it is necessary to first extract masterbatch and daughter material information from the order requirements, and then determine the gene coding method based on the masterbatch and daughter material information. The gene coding method determines the form and composition of the generated gene code. Among them, the masterbatch information includes at least the masterbatch category and size, and may also include priority; the daughter material information includes at least the daughter material category and size.
[0065] This embodiment employs a four-segment coding system. The obtained gene code includes a parent material segment code and a daughter material segment code connected together. Both the parent material segment code and the daughter material segment code include at least one bit of coding. When multiple bits of coding are included, their coding order corresponds to the parent material and / or daughter material sequences. It is worth noting that because multi-parent material sampling is not very meaningful in practical applications, this application does not discuss multi-parent material sampling.
[0066] It should be noted that, in this embodiment, the master material refers to a material with a fixed size, which is uniformly processed and produced by the raw material factory; the sub-material refers to a material with different sizes required in different scenarios in actual engineering, that is, the specific size is determined according to the actual application scenario; the layout refers to arranging the sub-material on the master material according to the sub-material information, and cutting it based on the layout to obtain the sub-material, thereby making full use of the master material and reducing material loss.
[0067] It should be understood that in order to ensure that the sub-material can be cut from the master material, the size of the sub-material needs to be no larger than the size of the master material. Of course, the size of the sub-material can also be the same as the size of the master material. Here, "no larger than" means that the total length of the sub-materials laid out on a master material is no greater than the total length of the master material.
[0068] Because the initial population's genetic coding corresponds to a wide variety of sampling schemes, raw material processing will be time-consuming and inefficient, resulting in high processing costs. Therefore, it is necessary to optimize the initial population to determine the dominant population. The entire optimization process is as follows: Figure 2 As shown, the specific steps include S2 and S3.
[0069] S2. Generate an initial population containing multiple gene codes according to the gene coding method, and call deep search to optimize the initial population to obtain an incomplete population. The gene codes include the mother material segment code, the daughter material segment code, and the corresponding mother material and daughter material sorting scheme.
[0070] S21. Generate an initial population containing multiple gene codes based on the gene coding method;
[0071] Each gene code in the initial population can be generated randomly or in other ways, and the coding order of each generated gene code corresponds to different sorting schemes.
[0072] In this embodiment, the existing sub-material library containing K types of unfinished sub-materials is divided into two parts in descending order according to the current sub-material demand: a current selection library and a candidate library. The current selection library contains k types of sub-materials, and the candidate library contains Kk types of sub-materials. The sub-material type M with the highest demand is selected from the current selection library. The threshold is set to Raw-M, and the current selection library is permuted and combined. A depth search is used to obtain all preliminary sorting schemes containing sub-material M. For example, the gene code 1|8|1|222365 indicates that the remaining material in a sorting scheme is 1, the priority is 8, and sub-materials 2, 2, 2, 3, 6, and 5 are cut from the first type of mother material. It is worth noting that the preliminary sorting scheme here only determines the types of sub-materials in the sorting scheme, and does not determine the specific quantity of sub-materials.
[0073] S22. Based on the initial population, the code corresponding to the smallest sub-material is extracted by calling the base traversal, and the complete layout scheme library is obtained by using the constraint function to repair it.
[0074] In this embodiment, to improve the depth search speed, the smallest sub-material m is selected from the initial population. The depth search of quantity is converted into a base traversal, and the corresponding base is the mother material length R / m rounded down, which is floor(R / m). A constraint function is then used to repair the complete layout scheme library F, where the expression of the constraint function is as follows:
[0075]
[0076] In the above formula, O i C represents the length of a single piece of material of type i. i O i The quantity of sub-materials, R_L represents the left threshold for surplus material, with an initial value of 0, and R_R represents the right threshold for surplus material, with an initial value of 35.
[0077] S23. Assign priorities to the complete layout schemes according to the priority function, and add the top five layout schemes with the highest priorities to the final scheme library. The expression for the priority function is as follows:
[0078]
[0079] In the above formula, count represents the number of sub-materials M that are included in the corresponding layout scheme, and Count represents how many times the sub-material M can be changed or how many times it can be expanded for the corresponding layout scheme. The minimum value of the two is taken.
[0080] By assigning priority to the entire layout scheme according to the priority function mentioned above, the smaller the function value, the higher the priority. In this embodiment, the top five layout schemes with the highest priority are put into the final scheme library.
[0081] S24. Update the current material selection library based on existing material requirements;
[0082] Reorder the current selection pool in descending order according to current demand, and add the seed material at the bottom floor (k / 2) to the candidate pool. At the same time, add the seed material at the top floor (k / 2) with the largest current demand from the candidate pool to the current pool.
[0083] S25. Repeat S21 to S24 until all sub-materials in the candidate library have been completely traversed;
[0084] S26. Select the highest priority ACC solutions from the final solution library, determine how many times the sub-material M can be changed or the maximum number of times it can be expanded, and take the minimum of the two to obtain ACC cases. For each case, execute step S27.
[0085] S27. Repeat S25 and S26 until the number of solutions in the complete nesting plan library F is less than 5 after a certain depth search. Record the current state and store it in the final total plan library Library.
[0086] S28. Set R_L to R_R + 1, set R_R to 100, and repeat S27.
[0087] S29. Set R_R to R_R + 1, set R_R to 300, and repeat S27.
[0088] After the above series of operations, the population individuals corresponding to the nesting plans in the finally selected total plan library Library form an incomplete population.
[0089] It should be noted that it is difficult to solve all sub - material requirements by only selecting nesting plans within a certain range of depth search. Therefore, in order to improve the algorithm speed and enhance the user experience, a heuristic algorithm is also needed to complete the incomplete population.
[0090] S3. Use the heuristic algorithm to repair the genes of the population individuals in the incomplete population, calculate the fitness of each repaired population individual according to the fitness function, and take the population individual with the largest fitness value as the dominant population.
[0091] S31. Repair the genes of the population individuals in the incomplete population to obtain the repaired population individuals.
[0092] For each preliminary nesting plan in the final total plan library Library (i.e., the incomplete population), call the heuristic algorithm (that is, after cutting according to the plan given by the preliminary nesting plan, from the remaining sub - material library Work, select the sub - material closest to the length R of the mother material for cutting. If R < m, then open a new material until the requirements of the remaining sub - material library Work are completely met), and add the cutting plans obtained in this part. The repaired population individuals can be obtained, denoted as the complete solution Cm.
[0093] S32. Calculate the fitness of each repaired population individual according to the fitness function, and take the population individual with the largest fitness value as the dominant population; among them, the expression of the fitness function is as follows:
[0094]
[0095] In the above formula, O i represents the length of a single i - category sub - material, C i represents the number of O i sub - materials, R represents the length of the mother material, Sum represents the total amount of mother material used, Last represents the remaining length of the last mother material, and K represents the number of sub - material types.
[0096] The fitness of each repaired complete solution Cm in the final solution library Library is calculated according to the fitness function formula above, and the individual with the largest fitness value is selected as the dominant population and defined as the local optimal solution I.
[0097] To further improve the profile optimization rate and reduce the layout scheme, it is necessary to perform cross-fertilization and mutation processing on the obtained dominant population based on the surplus material search boundary in order to determine the one-dimensional cutting scheme required for factory processing. An exemplary operation process is as follows: Figure 3 As shown, the specific steps include S4 and S5.
[0098] S4. Based on the remaining material of the sorting scheme, call the heuristic algorithm to perform diversification processing on the dominant population, and extract the population individuals with the highest fitness value as the current population.
[0099] S41. Divide the dominant population into two parts, the parent and the mother, based on the remaining material from the sampling plan.
[0100] The dominant population is divided into two parts based on the remaining material of the layout scheme. All cutting schemes with remaining material ≤ R_R are taken as the parent class, and all cutting schemes with remaining material > R_R are taken as the mother class.
[0101] S42. Extract genes x and y from the parent class and the mother class respectively;
[0102] Randomly select a cutting scheme X from the parent class, randomly select and remove x1 seed materials O from X, and randomly select x2 of each type of seed material. The constraints are as follows: In the formula, X_S represents the types of seed materials contained in the cutting scheme X, and X_S_C represents the number of times each seed material is selected. The combination yields gene x, and X is then placed back into the parent class. Following the same operational steps as above, gene y is obtained from the parent class.
[0103] S43. Combine genes x and y to form a new individual N and place it into the parent class;
[0104] S44. Repeat steps S42 and S43 until the parent class is empty;
[0105] S45. Use a heuristic algorithm to complete the current parent class to obtain the complete population and put it into the container ALL;
[0106] Traverse the current parent class. If the total cutting length of the scheme is greater than R and the difference is D, remove the sub-material that is closest to D from the scheme and put it into the temporary sub-material library TMP until D > 0. Then traverse the parent class again. If there is a layout scheme with leftover material greater than R_R, then roll back all the layout schemes into sub-materials and put them into the temporary sub-material library TMP. Then call the heuristic algorithm mentioned above on the temporary sub-material library TMP to complete the parent class, making it a complete population and put it into the container ALL.
[0107] S46. Repeat steps S41 to S45 a preset number of times to obtain a diverse population with a rich variety of species.
[0108] In this embodiment, the preset number of times is ten, that is, repeating steps S41 to S45 ten times to diversify the population in container ALL, resulting in a diverse population with rich species.
[0109] S47. Calculate the fitness of all populations in the diverse population, and select the population with the highest fitness value as the current population.
[0110] The fitness of all populations in the diverse population is calculated based on the fitness function described above, and the individual with the highest fitness value is selected as the current population, denoted as Local Optimal Solution II.
[0111] S5. Crossover and mutation are performed on individuals in the dominant population and the current population to obtain the optimal population, and the sorting scheme corresponding to the gene encoding in the optimal population is regarded as a one-dimensional feeding scheme.
[0112] S51. Perform crossover and mutation on individuals in the dominant population and the current population, and call a heuristic algorithm to repair genes to obtain complete individuals;
[0113] Set container ALL to empty. Use local optimal solution I (the dominant population) as the parent class and local optimal solution II (the current generation population) as the mother class. Randomly select a layout scheme X from the parent class and a layout scheme Y from the mother class. Copy X and Y to the new individual. During the entire copying process, ... As the dynamic mutation rate, M_Fit is the fitness value of the local optimal solution I. If mutation occurs, three mutation methods are selected with equal probability until both the parent and mother classes are empty. Then, the heuristic algorithm is called to complete the individual for the remaining child materials of the new individual and put it into the container ALL.
[0114] In this embodiment, a random number rand is selected between 0 and 100, resulting in three mutation methods:
[0115] When 0 ≤ rand < 33, a crossover operation is performed, randomly selecting a sub-material from the layout scheme X and exchanging it with a random sub-material from the layout scheme Y. It is worth noting that this refers to selecting a cut sub-material rather than a sub-material type.
[0116] When 33≤rand<66, perform an addition operation. In the new population, take out the last child material o that is ranked first, randomly select a scheme position P, and then move P and the first child material of each subsequent position one scheme to the right, and add o to the scheme at position P.
[0117] When 66≤rand<100, a deletion operation is performed. In the new population, a random sampling scheme position P is selected, the first sub-material o is taken out, and then the first sub-material of each subsequent scheme is moved forward by one scheme, and o is added to the last scheme.
[0118] To improve population diversity, we choose not to consider the number of scheme roots in the parent and mother classes. Only when the child materials contained in a scheme cannot be satisfied by the current child material library will the scheme be removed from the parent and mother classes, and other schemes will be selected again until the scheme can be satisfied or the parent / mother class is empty.
[0119] S52. Repeat step S51 a preset number of times to obtain a new generation population composed of complete individuals. Extract the individual with the largest fitness value from the dominant population, the current population and the new generation population. If the fitness value of the individual with the largest fitness value is greater than M_Fit, then take it as the local optimal solution III. At the same time, select the second highest fitness value individual and take the two as the parent and mother of the next generation. In this embodiment, step S51 is preset to be repeated ten times.
[0120] S53. Repeat step S52. If no better population individuals are found after a preset number of consecutive attempts, the population individuals corresponding to the local optimal solution III are regarded as the optimal population, and the sorting scheme corresponding to the gene encoding in the optimal population is regarded as a one-dimensional feeding scheme.
[0121] Please refer to Figure 4 This embodiment also provides an apparatus for implementing the above-described single-specification one-dimensional cutting method based on an improved genetic algorithm, comprising:
[0122] The coding method determination module 10 is used to determine the gene coding method as a four-segment coding based on the masterbatch information and daughterbatch information extracted from the customer order requirements.
[0123] The incomplete population generation module 20 is used to generate an initial population containing multiple gene codes according to the four-segment gene coding method and call deep search to optimize the genes of the initial population to obtain an incomplete population. The gene codes include the mother material segment code and the daughter material segment code, as well as the corresponding mother material and daughter material sorting scheme.
[0124] The dominant population generation module 30 is used to perform gene repair on individuals in an incomplete population using a heuristic algorithm, calculate the fitness of each gene-repaired individual based on the fitness function, and select the individuals with the highest fitness value as the dominant population.
[0125] The contemporary population generation module 40 is used to call a heuristic algorithm to diversify the dominant population based on the remaining material of the sorting scheme, and to extract the population individual with the highest fitness value from the diversified population as the contemporary population.
[0126] The one-dimensional feeding scheme determination module 50 is used to perform crossover and mutation operations on individuals in the dominant population and the current population to obtain the optimal population and regard the sorting scheme corresponding to the gene encoding in the optimal population as the one-dimensional feeding scheme.
[0127] This embodiment employs a four-segment coding method to encode the genes of the parent material and the daughter material. Based on the fitness value of each gene code, a depth-first search based on a greedy algorithm is used to select the best population. This effectively overcomes the shortcomings of conventional genetic algorithms, which require multiple iterations to obtain a good population or result in poor final results due to premature exit from the genetic process. In addition, by using a layout scheme as a gene replication and proposing three mutation methods, it is possible to seek better genes while inheriting the original excellent genes. Under the premise of ensuring running speed, it further improves the profile optimization rate, reduces the number of layout schemes, and better meets the needs of factory processing. This solves the technical problem of inconvenience in factory processing caused by too many layout schemes.
[0128] Example 2
[0129] The specific implementation method provided in this embodiment is based on Embodiment 1. The same parts can be referred to each other, and the same parts have the same beneficial effects. Therefore, the same parts will not be described in detail in this embodiment.
[0130] Please refer to Figure 5 and Figure 6 This illustrates a specific implementation of Embodiment 2 of the present invention. In this embodiment, a new cutting scheme is supplemented by calling a depth search algorithm and a heuristic algorithm on the obtained one-dimensional cutting scheme. This achieves the goal of significantly reducing the layout scheme while ensuring the profile optimization rate, thereby reducing the factory production and processing costs and enhancing practicality.
[0131] like Figure 5 As shown, a single-specification one-dimensional blanking method based on an improved genetic algorithm includes the following steps:
[0132] S1. Determine the gene coding method based on the information of the parent material and the daughter material;
[0133] S2. Generate an initial population containing multiple gene codes according to the gene coding method, and call deep search to optimize the initial population to obtain an incomplete population. The gene codes include the mother material segment code and the daughter material segment code, corresponding to the sorting scheme of the mother material and the daughter material.
[0134] S3. Use a heuristic algorithm to repair the genes of individuals in the incomplete population, calculate the fitness of each repaired individual according to the fitness function, and take the individual with the largest fitness value as the dominant population.
[0135] S4. Based on the remaining material of the sorting scheme, the dominant population is subjected to a heuristic algorithm for diversification, and the individual with the highest fitness value is selected as the current population based on the fitness function.
[0136] S5. Cross and mutate the individuals in the dominant population and the current population to obtain the optimal population, and regard the sorting scheme corresponding to the gene code in the optimal population as a one-dimensional material cutting scheme.
[0137] S6. Based on the sub-material information, call a depth search to reduce the one-dimensional cutting scheme and obtain the optimal cutting scheme.
[0138] like Figure 6 As shown, the specific process of using depth search to reduce the one-dimensional cutting scheme includes the following steps:
[0139] S61. Traverse the one-dimensional cutting scheme (i.e., the optimal population) and set all schemes with an expansion number less than or equal to k as sub-materials and put them into the temporary sub-material library TMP.
[0140] S62. Call the depth search function to process the temporary sub-material library TMP. If it is found that the number of schemes has not decreased or the number of master materials used has increased, then k = k-1, and repeat step S61 until the number of schemes decreases or k = 0 when the number of master materials used remains unchanged or decreases, and obtain the optimal cutting scheme after reduction.
[0141] In this embodiment, the actual cutting task of aluminum alloy steel will be used as an example to test according to the above steps. First, the user obtains the sub-material information from the order information, as shown in Table 1:
[0142] length 2406 1984 1884 1656 1648 1548 1406 1356 1306 1298 1212 quantity 4 54 18 286 64 36 19 166 31 36 6 length 1206 894 870 856 756 746 706 656 556 484 456 quantity 2 18 81 4 66 9 51 44 27 72 9
[0143] Table 1 Substrate Information
[0144] The improved genetic algorithm was initialized with user-defined kerf length (Kerf), raw material length (Raw), maximum acceptable number of schemes (Kind), and calculation accuracy (ACC). The boundary value of the remaining material in the depth search nesting scheme was set to 0–35. After a series of iterations, the final nesting scheme was obtained as shown in Table 2.
[0145]
[0146] Table 2 Final Layout Scheme
[0147] The table above shows that the optimal material cutting scheme is 15, the masterbatch consumption is 234, the saw kerf length is 0, the utilization rate is as high as 99.6885%, and the entire experimental run time is 6.505 seconds. While ensuring the profile optimization rate, it greatly improves the layout efficiency, reduces the number of layout schemes, and lowers the processing cost, thus better meeting the factory's processing needs and solving the technical problem of inconvenience caused by too many layout schemes in the factory.
[0148] Please refer to Figure 7 This embodiment also provides an apparatus for implementing the above-described single-specification one-dimensional cutting method based on an improved genetic algorithm, comprising:
[0149] The coding method determination module 10 is used to determine the gene coding method based on the parent material information and the daughter material information;
[0150] The incomplete population generation module 20 is used to generate an initial population containing multiple gene codes according to the gene coding method, and to call deep search to optimize the initial population to obtain an incomplete population. The gene codes include the mother material segment code and the daughter material segment code, corresponding to the sorting scheme of the mother material and the daughter material.
[0151] The dominant population generation module 30 is used to repair the genes of individuals in the incomplete population using a heuristic algorithm, and calculate the fitness of each repaired individual according to the fitness function, and select the individual with the highest fitness value as the dominant population.
[0152] The contemporary population generation module 40 is used to call a heuristic algorithm to perform diversification processing on the dominant population based on the remaining material of the sorting scheme, and extract the population individual with the highest fitness value as the contemporary population.
[0153] The one-dimensional cutting scheme determination module 50 is used to cross and mutate the individuals in the dominant population and the current population to obtain the optimal population, and to regard the sorting scheme corresponding to the gene encoding in the optimal population as the one-dimensional cutting scheme.
[0154] The one-dimensional cutting scheme reduction module 60 is used to reduce the one-dimensional cutting scheme by calling depth search based on the sub-material information to obtain the optimal cutting scheme.
[0155] This embodiment transforms depth search into a binary traversal and optimizes the initial population based on a priority function, significantly increasing the search range and speed. Furthermore, by establishing search margin boundaries and using a heuristic algorithm to lock the obtained one-dimensional cutting scheme, it not only further improves the speed of determining the one-dimensional cutting scheme but also achieves the goal of significantly reducing the number of layout schemes while ensuring the profile optimization rate. This reduces factory production and processing costs, enhances practicality, and has high social value and application prospects.
[0156] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. Since the above embodiments are fundamentally similar to the method embodiments, their descriptions are relatively simple; relevant parts can be found in the descriptions of the method embodiments.
[0157] The above embodiments provide a detailed description of the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A single-specification one-dimensional blanking method based on an improved genetic algorithm, characterized in that, Includes the following steps: S1. Determine the gene coding method based on the information of the parent material and the daughter material; S2. Generate an initial population containing multiple gene codes according to the gene coding method, and call a deep search to optimize the initial population to obtain an incomplete population, wherein the gene codes include mother material segment codes and daughter material segment codes, corresponding to the sorting scheme of mother material and daughter material; Step S2 specifically includes: S21. Generate an initial population containing multiple gene codes based on the gene coding method; S22. Based on the initial population, the code corresponding to the smallest sub-material is extracted by calling the base traversal, and the complete layout scheme library is obtained by using the constraint function to repair it. S23. Assign priority to the complete layout scheme according to the priority function and put the top five layout schemes with the highest priority into the final scheme library; S24. Update the current material selection library based on existing material requirements; S25. Repeat S21 to S24 until all sub-materials in the candidate library have been completely traversed; S26. Select the highest priority ACC solutions from the final solution library, determine how many times the sub-material M can be changed or how many times it can be expanded, and take the minimum of the two to obtain ACC cases. For each case, execute step S27. S27. Repeat S25 and S26 until the number of schemes in the complete layout scheme library F is less than 5 after a certain depth search. Record the current status and store it in the final total scheme library. S28. Set R_L to R_R+1, where R_L represents the left threshold of residual material, with an initial value of 0. Set R_R to 100 and repeat S27. S29. Set R_R to R_R+1, where R_R represents the right threshold for residual material. The initial value is 35. Set R_R to 300 and repeat S27. S3. Use a heuristic algorithm to repair the genes of individuals in the incomplete population, and calculate the fitness of each repaired individual according to the fitness function. Select the individuals with the highest fitness value as the dominant population. S4. Based on the remaining material of the sorting scheme, a heuristic algorithm is called to perform diversification processing on the dominant population, and the population individual with the highest fitness value is extracted as the current population. S5. Cross and mutate the individuals in the dominant population and the current population to obtain the optimal population, and regard the sorting scheme corresponding to the gene encoding in the optimal population as a one-dimensional feeding scheme.
2. The single-specification one-dimensional blanking method according to claim 1, characterized in that, Step S3 specifically includes: S31. Perform gene repair on individuals in an incomplete population to obtain repaired individuals; S32. Calculate the fitness of each individual in the repaired population according to the fitness function, and take the individual with the largest fitness value as the dominant population.
3. The single-specification one-dimensional blanking method according to claim 1, characterized in that, Step S4 specifically includes: S41. Divide the dominant population into two parts, the parent and the mother, based on the remaining material from the sampling plan. S42. Extract genes x and y from the parent class and the mother class respectively; S43. Combine genes x and y to form a new individual N and place it into the parent class; S44. Repeat steps S42 and S43 until the parent class is empty; S45. Use a heuristic algorithm to complete the current parent class to obtain the complete population and put it into the container ALL; S46. Repeat steps S41 to S45 a preset number of times to obtain a diverse population with a rich variety of species. S47. Calculate the fitness of all populations in the diverse population, and select the population with the highest fitness value as the current population.
4. The single-specification one-dimensional blanking method according to claim 1, characterized in that, Step S5 specifically includes: S51. Perform crossover and mutation on individuals in the dominant population and the current population, and call a heuristic algorithm to repair genes to obtain complete individuals; S52. Repeat step S51 a preset number of times to obtain a new generation population composed of complete individuals. Extract the individual with the largest fitness value from the dominant population, the current population and the new generation population. If the fitness value of the individual with the largest fitness value is greater than the fitness value of the dominant population, then take it as the local optimal solution III. At the same time, select the second highest fitness value individual and take the two as the parent and mother of the next generation. S53. Repeat step S52. If no better population individuals are found after a preset number of consecutive attempts, the population individuals corresponding to the local optimal solution III are regarded as the optimal population, and the sorting scheme corresponding to the gene encoding in the optimal population is regarded as a one-dimensional feeding scheme.
5. The single-specification one-dimensional blanking method according to claim 1, characterized in that, After step S5, the process also includes: S6, using depth search based on the sub-material information to reduce the one-dimensional cutting scheme and obtain the optimal cutting scheme.
6. The single-specification one-dimensional blanking method according to claim 5, characterized in that, Step S6 specifically includes: S61. Traverse the one-dimensional material cutting schemes and set all schemes whose usage times are less than or equal to k as sub-materials and put them into the temporary sub-material library. S62. Call the depth search function to process the temporary sub-material library. If it is found that the number of schemes has not decreased or the number of master materials used has increased, then k=k-1. Repeat step S61 until the number of schemes decreases or k=0 when the number of master materials used remains unchanged or decreases, and obtain the optimal cutting scheme after reduction.
7. An apparatus for implementing the single-specification one-dimensional blanking method based on an improved genetic algorithm as described in any one of claims 1-6, characterized in that, include: The encoding method determination module (10) is used to determine the gene encoding method based on the parent material information and the daughter material information; Incomplete population generation module (20), the incomplete population generation module (20) is used to generate an initial population containing multiple gene codes according to the gene coding method, and call deep search to optimize the initial population to obtain an incomplete population, wherein the gene codes include mother material segment codes and daughter material segment codes, corresponding to the sorting scheme of mother material and daughter material; The dominant population generation module (30) is used to perform gene repair on the individuals in the incomplete population using a heuristic algorithm, and calculate the fitness of each repaired individual according to the fitness function, and take the individual with the largest fitness value as the dominant population. The contemporary population generation module (40) is used to call a heuristic algorithm to perform diversification processing on the dominant population based on the remaining material of the sorting scheme, and extract the population individual with the largest fitness value as the contemporary population. The one-dimensional feeding scheme determination module (50) is used to cross and mutate the individuals in the dominant population and the current population to obtain the optimal population, and regard the sorting scheme corresponding to the gene code in the optimal population as the one-dimensional feeding scheme.
8. The apparatus for the single-specification one-dimensional feeding method according to claim 7, characterized in that, Also includes: A one-dimensional material cutting scheme reduction module (60) is used to reduce the one-dimensional material cutting scheme by calling a depth search based on the sub-material information to obtain the optimal material cutting scheme.