Calculation method and device for steel bar optimized cutting based on genetic algorithm
By optimizing steel bar cutting using genetic algorithms, the problem of reusing surplus materials was solved, improving steel bar utilization and engineering efficiency, and realizing intelligent and information-based steel bar processing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HEBEI UNIV OF TECH
- Filing Date
- 2023-03-20
- Publication Date
- 2026-06-26
AI Technical Summary
Existing methods for optimizing rebar cutting fail to effectively consider the reuse of leftover materials, leading to rebar cutting errors and resource waste, which affects project quality and schedule.
A genetic algorithm-based method for optimizing rebar cutting is adopted. By combining fitness functions and coding rules with two-point crossover and mutation operators, the rebar cutting scheme is optimized to ensure maximum reuse of surplus materials.
It has achieved efficient utilization of steel reinforcement raw materials, reduced costs, improved the economic benefits of the project, and realized the informatization and intelligentization of steel reinforcement processing.
Smart Images

Figure CN116468147B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of civil engineering technology, and in particular relates to a calculation method and apparatus for optimized steel bar cutting based on genetic algorithms. Background Technology
[0002] As one of the pillar industries of my country's economic development, the construction industry's development determines the country's overall economic progress and also drives the development of numerous related industries. Reinforcing steel, as one of the most widely used materials in construction projects, is an indispensable and crucial component of the process. The cost of reinforcing steel is key to cost control during construction management. Therefore, optimizing the cutting of reinforcing steel can help construction companies effectively avoid waste, reduce costs, and improve economic efficiency.
[0003] Reinforcing bars are classified according to strength grade, diameter, and length, and are numerous and diverse. The variety of cutting methods makes manually calculating cutting schemes extremely difficult. Manual calculations often involve simply cutting bars sequentially; errors in length calculation can lead to incorrect bar cutting, wasting steel bars, labor, and machinery, and even affecting project quality and schedule. Therefore, it is crucial to accurately calculate the cutting length of the reinforcing bars and use this as the basis for construction workers' work.
[0004] However, current theoretical research on optimized rebar cutting incorporates the leftover material from the previous operation into the raw materials (the provided raw materials and the remaining material) for calculation, without considering the reuse of the remaining material, and therefore cannot output the optimal solution suitable for the current and future cutting operations. Summary of the Invention
[0005] To address the shortcomings of existing methods for optimizing rebar cutting, this invention provides a calculation method and apparatus for optimizing rebar cutting based on a genetic algorithm, thus overcoming the aforementioned deficiencies.
[0006] To achieve the above objectives, the present invention provides the following technical solution:
[0007] In a first aspect, the present invention provides a calculation method for optimized steel bar cutting based on a genetic algorithm, comprising the following steps:
[0008] Step 1: Obtain information on raw steel reinforcement materials, and classify and store the raw steel reinforcement materials according to their strength grade and diameter; determine the type of raw material.
[0009] Step 2: Obtain all lengths of the steel reinforcement cutting parts and store them together with the corresponding raw materials according to their strength grade and diameter. Determine the length of the steel reinforcement cutting parts required for each type of raw material and the required quantity for each length.
[0010] Step 3: Use a genetic algorithm to calculate the steel reinforcement cutting plan, determining the optimal cutting plan and the required quantity of steel reinforcement materials. The specific process is as follows:
[0011] Step 3.1, determine the fitness function and selection operator:
[0012] The fitness function considers the longest remaining single rebar and the minimum total used raw materials, with one remaining rebar having the longest remaining length. The fitness function is the difference between the length of the rebar used (number of used rebars minus one) and the maximum remaining length among all used rebars. The objective formula for the fitness function f(x) is:
[0013]
[0014] Where k' is the amount of steel reinforcement already used, a ji Let l be the number of the i-th type of blanking parts on the j-th raw material. i Let be the length of the i-th type of blank;
[0015] The selection operator P is determined according to the selection probability P(x). u Select a certain number of individuals from the current population, with a selection probability P(x). u The difference between the maximum fitness in the entire population and the fitness of a single individual is the sum of the fitness of all individuals in the entire population.
[0016] Step 3.2, Preset raw material quantity: According to Calculate the preset quantity k of the current type of raw material, where round refers to rounding up, l i Let d be the length of the i-th type of required part. i Let L be the number of parts required for the i-th type of material, and L be the length of the raw material.
[0017] Step 3.3, Encoding Rules:
[0018] Let the required lengths of the parts to be cut from the current type of raw material be a1, a2, a3…a n The corresponding quantities of the required parts are b1, b2, b3…b n Arrange the blanking parts in ascending order of length, and then label the lengths of the blanking parts as l1, l2, l3…l n The number of parts to be cut in order of length is d1, d2, d3…d n ;
[0019] Arrange all blank parts in ascending order, with blank parts of the same length arranged sequentially. The result of sorting all blank parts is:
[0020]
[0021] The encoding rule is as follows: Based on the preset raw material quantity k, the value range of the encoding character is set to {1,2,…k}, and the length of a single raw material is set to L. For each cut part, a random character is selected from the encoding character {1,2,…k} for random encoding. After all cut parts are encoded, a chromosome is formed, and the chromosome length is [missing information]. n is the number of types of parts to be cut, d i This is the number of blank parts required for the i-th length.
[0022] According to the coding rules, we know which lengths of blank parts need to be cut from the same raw material;
[0023] Step 3.4: Set the maximum number of iterations, let gen = 1, and randomly generate 2N individuals according to the encoding rules to form the first population;
[0024] Step 3.5: Perform selection processing on the first population using the selection operator to obtain offspring 1: Calculate the fitness of each chromosome in the 2N individuals of the first population, calculate the selection operator P based on the chromosome fitness, and obtain the selection probability of each chromosome being selected; the chromosomes with the top N selection probability values are selected as a preset number of chromosomes, which are offspring 1.
[0025] Step 3.6: Set the crossover probability, and perform crossover processing on offspring 1 using the two-point crossover operator to obtain offspring 2;
[0026] Step 3.7: Set the mutation probability, and use the mutation operator to mutate offspring 2 to obtain offspring 3;
[0027] Step 3.8: Determine if any chromosome in offspring 3 results in a situation where the utilization rate of a single steel rebar exceeds 100%. If so, chromosome correction processing is required for offspring 3 to obtain the second population, specifically:
[0028] Based on the genes on the chromosomes of offspring 3, all unused raw materials are deleted, and the used steel reinforcement materials are re-encoded. The encoding characters are randomly selected from {1,2,…m}, and the m used steel reinforcement materials are denoted as L1, L2,…L… m ;
[0029] Inspect raw materials L1, L2, ... L m The blanking parts on the upper part, if L e The sum of the lengths of the blank parts exceeds the length of the original material, so L e Delete the smallest blanking part and place it in the overflow area; repeat the process of judging and deleting the smallest blanking part until L. e The sum of the lengths of all blanked parts is less than or equal to L;
[0030] Calculate L eWhen the sum of the lengths of all blanked parts is less than or equal to L, L e The length of the remaining raw material is compared with the length of the blanking parts that exceed the expected length of the raw material. The longest blanking part that is shorter than the expected length of the raw material is then inserted back into L. e In, making L e The sum of the lengths of all the cut parts must never exceed L;
[0031] The blanking parts that cannot be inserted into the area are placed on the new raw material to be cut. The length, type or number of blanking parts to be cut on the new raw material to be cut changes, and the correction of chromosome 3 of offspring is completed. The second population is obtained by selecting the corrected offspring 3 through the selection operator.
[0032] Step 3.9: Let gen = gen + 1. Repeat steps 3.6-3.8 for the newly generated population after chromosome correction to perform the next iteration. When the number of iterations meets the maximum number of iterations, end the iteration and output the chromosome with the highest fitness in the current generation. This chromosome is the optimal cutting scheme.
[0033] The process of the two-point crossover operator is as follows: crossover does not necessarily occur when offspring are generated, but crossover occurs with a certain probability. Every chromosome in the population is traversed, and one chromosome is taken as the parent chromosome. Another chromosome is selected from the population and taken as the mother chromosome. The parent chromosome and the mother chromosome are not the same chromosome. Crossover point 1 and crossover point 2 are randomly generated on the parent chromosome and the mother chromosome. The crossover points 1 and 2 of the parent chromosome and the crossover points 1 and 2 of the mother chromosome are located at the same position of the gene. The offspring chromosomes obtain the gene of the mother chromosome located before the low crossover point, the gene of the mother after the high crossover point, and the gene of the parent chromosome located between the low crossover point and the high crossover point.
[0034] The mutation operator works as follows: each offspring has a certain probability of mutation, two different gene positions are randomly generated on the chromosome of the offspring, and the genes at these two positions are exchanged.
[0035] In a second aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can implement the steps of the above-described method.
[0036] Thirdly, the present invention provides a computational device for optimizing steel bar cutting based on a genetic algorithm, the device comprising: a memory, a processor, an input / output interface, a network interface, and a communicator;
[0037] The memory is used to store information about the raw steel bars, the cutting parts, and the optimal solution.
[0038] The processor is used to execute the process of using a genetic algorithm to calculate the steel reinforcement cutting scheme, and to calculate the optimal cutting scheme and the required quantity of steel reinforcement materials.
[0039] The input / output interface is used to acquire information on the raw steel bars and the cutting parts, and can also output the optimal cutting scheme after the processor has processed it.
[0040] The communicator is used for communication between the aforementioned memory, processor, input / output interface, and network interface;
[0041] The network interface is used to communicate with external devices and export the optimal material cutting scheme.
[0042] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0043] 1. This invention realizes intelligent cutting of steel bars, avoids the problem of incorrect cutting schemes due to manual calculation, improves the utilization rate of steel bar raw materials, reduces the cost of construction projects and improves economic benefits.
[0044] 2. This invention encodes the cutting parts using the quantity of raw materials and solves the problem using a genetic algorithm, fully considering the need to minimize the amount of raw materials used in the project while maximizing the remaining material at the end of the cutting process. Maximizing the remaining material at the end of the cutting process allows for future cutting, thus calculating the optimal solution. Currently common linear programming methods for optimizing cutting processes can calculate relatively good cutting schemes, but they do not consider the issue of maximizing the remaining material at the end of the cutting process. Furthermore, as the types of cutting parts increase, the number of cutting methods for a single steel bar increases exponentially, making it impossible for current computing power to traverse all possible solutions.
[0045] 3. This invention not only supports manual data input but also batch data import, and can export rebar cutting plans. The traditional rebar processing industry has a low level of informatization; most rebar data requires manual paper recording, resulting in low levels of automation. This invention can effectively reduce the manual labor required for recording rebar cutting plans, achieving informatization and intelligentization in rebar processing.
[0046] 4. This invention checks whether the total length of all cut parts from a single raw material exceeds the length of the raw material, and then performs chromosome correction to ensure the accuracy of genetics and the reliability of the optimal solution.
[0047] Therefore, this invention fully considers the problem of reusing leftover materials. It does not consider the leftover materials from the previous cutting, but only considers how to make the leftover materials from this single cutting more reasonable, so that the leftover materials from a single cutting are longer and are conducive to subsequent reuse. Attached Figure Description
[0048] Figure 1 This is a schematic diagram of the connection structure of the calculation device for optimizing steel bar cutting according to an embodiment of the present invention;
[0049] Figure 2 This is a flowchart illustrating the overall process of the calculation method for optimized steel bar cutting based on genetic algorithms according to the present invention.
[0050] Figure 3 This is a flowchart of the genetic algorithm in the calculation method for optimized rebar cutting based on genetic algorithm of the present invention;
[0051] Figure 4 This is a flowchart of the chromosome correction process of the present invention. Detailed Implementation
[0052] The present invention will be further explained below with reference to the embodiments and accompanying drawings, but this is not intended to limit the scope of protection of this application.
[0053] Figure 1 This is a schematic diagram of the calculation device for optimizing steel bar cutting according to an embodiment of the present invention.
[0054] like Figure 1 As shown, the rebar optimization cutting calculation device is a terminal device, comprising: a memory 1, a processor 2, an input / output interface 3, a network interface 4, and a communicator 5. The memory can be the terminal device's internal memory, such as random access memory (RAM) or cache-cache, or it can be the terminal device's external memory, such as a flash disk or solid-state drive. The processor can be a central processing unit (CPU) or any other conventional processor. The input / output interface can include a monitor, keyboard, mouse, etc. The network interface includes a wireless interface and a wired interface. The communicator is used for communication between the memory 1, processor 2, input / output interface 3, and network interface 4. The terminal device can be a mobile phone, tablet computer, laptop computer, or other terminal device. The processor is loaded with the rebar optimization cutting calculation method based on genetic algorithm described in this application.
[0055] This invention provides a calculation method for optimized steel bar cutting based on a genetic algorithm, comprising the following steps:
[0056] Step 1: Obtain information on the raw materials of the reinforcing bars, and classify the reinforcing bars according to their strength grade and diameter, and store the information of reinforcing bars of different specifications in a classified manner.
[0057] Raw material information can be entered manually on the terminal device or imported into an Excel spreadsheet. The terminal device can automatically identify information such as the strength grade and diameter of different specifications of steel bars. Raw material information includes the strength grade, diameter, and length of the raw material.
[0058] Step 2: Obtain the length of the steel reinforcement cutting parts and store them together with the corresponding raw materials according to their strength grade and diameter. This means determining the length of the steel reinforcement cutting parts required for each type of raw material and the required quantity for each length, thus determining the different specifications and quantities of cutting parts required for a certain type of raw material.
[0059] After obtaining the length and quantity of the parts to be cut, the terminal equipment automatically identifies and stores the corresponding raw material information together.
[0060] Step 3, cut the steel reinforcement parts according to their lengths (a1, a2, a3…a ... n The fitness function is set as the difference between the length of the used steel reinforcement material minus 1 and the minimum value of the remaining material among all used steel reinforcement materials. Then, a genetic algorithm with chromosome correction is used to calculate the steel reinforcement construction cutting scheme, calculate the optimal cutting scheme and the required amount of steel reinforcement material, and output the cutting scheme in an Excel spreadsheet based on the calculation results.
[0061] The calculation process for the steel reinforcement cutting scheme using a genetic algorithm with chromosome correction is as follows:
[0062] Step 3.1: Set the fitness function and selection operator P.
[0063] To minimize the amount of raw material used and to leave one piece of raw material with the longest possible allowance, The fitness function is calculated as the difference between the length of the used steel reinforcement material minus one and the maximum value of the remaining material among all used steel reinforcement materials. The fitness function considers both the maximum length of a single remaining piece and the minimum total material used. In the formula: k' is the number of used steel reinforcement materials, a ji Let l be the number of the i-th type of blanking parts on the j-th raw material. i Let be the length of the i-th type of blank.
[0064] A roulette wheel betting method based on proportional selection is used.
[0065]
[0066] According to the selection probability P(x) u A certain number of individuals are selected from the current population. P(x) u ) is the xth u The probability of an individual being selected, f(x) u ) is the xth u The fitness of each individual, max(f(x) u The fitness level is the highest in the entire population. The sum of fitness of all individuals in the entire population is N*, where N* is the number of individuals in the population. N* chromosomes are randomly generated according to the encoding rules; the encoding forms chromosomes, and each encoding corresponds to a gene.
[0067] Step 3.2, preset the quantity of raw materials:
[0068] according to Calculate the preset raw material quantity k, where round refers to rounding up, l i Let d be the length of the i-th type of required part. i Let L be the number of parts required for the i-th type of material, and L be the length of the raw material.
[0069] Step 3.3, Encoding Rules
[0070] Sort the required steel bar cutting parts. Let the required cutting parts lengths for the current type of raw material be a1, a2, a3…a n (Not sorted at this point), the required quantities of parts are b1, b2, b3…b n Arrange the blanking parts in ascending order of length, and then label the lengths of the blanking parts as l1, l2, l3…l n The number of parts to be cut in order of length is d1, d2, d3…d n For example, a part with a length of l1 requires d1 pieces, and a part with a length of l2 requires d2 pieces, where l1 is less than l2.
[0071] Encode the sequentially arranged blanking parts. Sort all blanking parts in ascending order, and assign codes to blanking parts of the same length sequentially. The result of sorting all blanking parts is:
[0072]
[0073] Set the preset quantity of raw materials to k, then the encoding characters are {1,2,...k}. Set the length of a single raw material to L. For each cut part, randomly select from the encoding characters {1,2,...k} for random encoding. All cut parts, after being encoded, form a chromosome. The length of the chromosome is the encoding length. n is the number of types of parts to be cut, d i This represents the required quantity of blanking parts for the i-th length; where the required quantity of blanking parts for length l1 is d1, the required quantity of blanking parts for length l2 is d2, ..., l n The required quantity of blank parts of length d n ;
[0074] In the following formula, the first row contains l1, l2, l nFor each blanking part, the second line 1,2,...,3,k,4,...,6,...,k-1 is the code of the blanking part. The code character is randomly assigned to each blanking part.
[0075] l1,l1,...l1,l2,l2,…l2,...,l n
[0076] 1,2,...,3,k,4,…,6,…,k-1
[0077] Therefore, the above encoding means that the first part of length l1 is cut on the first raw material, the second part of length l1 is cut on the second raw material, the d1th part of length l1 is cut on the third raw material, the first part of length l2 is cut on the kth raw material, the second part of length l2 is cut on the fourth raw material, the d2th part of length l2 is cut on the sixth raw material, and so on. n root l n The blanking parts of length k are cut from the (k-1)th raw material. This encoded character serves as the gene. The encoding rules determine which lengths of blanking parts need to be cut from the same raw material.
[0078] Genetic operators are selected. This application employs a two-point crossover operator and a mutation operator. Crossover does not necessarily occur during offspring generation, but rather with a certain probability. Each chromosome in the population is traversed, designated as the parent chromosome. Another chromosome is selected from the population and designated as the mother chromosome; the parent and mother chromosomes are not the same. Crossover points 1 and 2 are randomly generated on the parent and mother chromosomes. Crossover points 1 and 2 on the parent and mother chromosomes are located at the same gene position, ensuring that the chromosome length remains the same. The offspring chromosome receives the genes from the mother chromosome preceding the low crossover point and the genes from the mother chromosome following the high crossover point, and the genes from the parent chromosome between the low and high crossover points. Each offspring has a certain probability of mutation. Two different gene positions are randomly generated on the offspring chromosome, and the genes at these two positions are exchanged.
[0079] Step 3.4: Set the maximum number of iterations, let gen = 1, and randomly generate 2N individuals according to the encoding rules to form the first group. Specifically, the first group is the set of initial cutting schemes, which are schemes for cutting the raw material to meet the length and quantity of the parts to be cut.
[0080] For example, a construction project requires 12m of steel reinforcement material for cutting. The lengths of the parts to be cut are 3.4m, 4.5m, and 6.7m. Specifically, 3 bars of 3.4m length, 4 bars of 4.5m length, and 5 bars of 6.7m length are needed. What is the preset number of steel reinforcement materials? The root, i.e., the encoded characters are 1-6, and the encoded length is 3+4+5=12 (the above requires 3 steel bars of 3.4m, 4 steel bars of 4.5m, and 5 steel bars of 6.7m; 3+4+5 is the sum of the number of steel bars to be cut). 2N individuals are randomly generated, i.e., 2N chromosomes, such as 111223345566.
[0081] Step 3.5: Select the first group using the selection operator to obtain child 1.
[0082] Specifically, the fitness of each chromosome in the 2N individuals of the first population is calculated, and the selection operator P is calculated based on the fitness of the chromosome to obtain the selection probability of each chromosome being selected; the chromosomes with the highest selection probability are selected as the preset number of chromosomes and are used as offspring 1.
[0083] Step 3.6: Perform crossover processing on offspring 1 using the two-point crossover operator to obtain offspring 2.
[0084] Specifically, in offspring 1, a crossover probability is set, and a chromosome is randomly selected as the parent chromosome. Offspring 2 first inherits all the genes from the parent chromosome, and then a chromosome is randomly selected from the remaining chromosomes of offspring 1 as the parent chromosome. Two identical loci are randomly generated on the parent and parent chromosomes as crossover points. Offspring 2 receives all the genes before the low crossover point and after the high crossover point on the parent chromosome. A predetermined number of offspring 2 are generated, N.
[0085] The low and high crossover points are determined by sorting crossover point 1 and crossover point 2. The crossover point located earlier is called the low crossover point, and the crossover point located later is called the high crossover point.
[0086] It should be noted that not all offspring 1 undergo crossover, but rather crossover occurs with a certain probability.
[0087] For example, a preset number of chromosomes include chromosome 1, chromosome 2, chromosome 3, chromosome 4, and chromosome 5. One chromosome is randomly selected from these five chromosomes as the parent chromosome (e.g., chromosome 5). Let the genes of chromosome 5 be A1, B1, C1, D1, and E1. Then, offspring 2 first inherits all genes A1, B1, C1, D1, and E1 from the parent chromosome. Subsequently, another chromosome is randomly selected from the remaining chromosomes as the parent chromosome (e.g., chromosome 4). Let the genes of chromosome 4 be A2, B2, C2, D2, and E2. Two crossover sites are randomly generated on chromosomes 4 and 5, such as A1, B1 (crossover site 1), C1 (crossover site 2), D1, E1; and A2, B2 (crossover site 1), C2 (crossover site 2), D2, E2. Then, offspring 2's chromosome is A2, B2, C1, D2, and E2.
[0088] Step 3.7: Set the mutation probability, and use the mutation operator to mutate offspring 2 to obtain offspring 3.
[0089] Specifically, two mutation sites are randomly generated on each set of chromosomes in F2, and the genes at the two mutation sites are exchanged.
[0090] It should be noted that not all offspring 2 will mutate, but only a certain probability of mutating.
[0091] For example, if the genes on a chromosome are A, B, C, D, E, F, two mutation sites are randomly generated, such as A, B, C (mutation site 1) and D, E, F (mutation site 2), and then swapped to obtain A, B, F, D, E, C. This results in offspring 3.
[0092] In this embodiment, the chromosome of offspring 3 after crossover mutation causes the utilization rate of a single steel bar raw material to exceed 100%, which is not realistic. For example, if there is 12m of raw material, and 3 steel bars of 3.4m, 4 steel bars of 4.5m, and 5 steel bars of 6.7m are needed, the chromosome after crossover mutation will be 111223345566. Among them, two 6.7m blank parts need to be cut from the 6th raw material, which is not realistic. Step 3.8 is still required.
[0093] Step 3.8: Determine if the chromosomes of offspring 3 result in a situation where the utilization rate of a single steel rebar exceeds 100%. If so, chromosome correction processing is required for offspring 3, and the second population is selected after the correction. Specifically:
[0094] Based on the genes on the chromosomes of offspring 3 (the genes carry information about which raw material each part was cut from), all unused raw materials are deleted, and the used steel reinforcement raw materials are recoded as 1, 2, ..., m. m represents the actual number of raw materials used.
[0095] Inspect raw materials L1, L2, ... L m The blanking parts on the upper part, if L e The sum of the lengths of the blank parts exceeds the length of the original material, so L e The smallest blanking part is deleted and placed into the overflow area; the process of judging and deleting the smallest blanking part is repeated until L. e The sum of the lengths of all blanked parts is less than or equal to L; calculate L at this time. e The length of the remaining raw material is compared with the length of the blanking parts that exceed the expected length of the raw material. The longest blanking part that is shorter than the expected length of the raw material is then inserted back into L. e In, making L e The sum of the lengths of all the cut parts must never exceed L;
[0096] The blanking parts that cannot be inserted into the area are placed on the new raw material to be cut. The length, type or number of blanking parts to be cut on the new raw material changes, thereby correcting the code and then randomly generating a second group.
[0097] For example, consider a 12m long steel rebar that needs to be cut into parts of 2.1m, 4.2m, 4.3m, and 5.1m in length. First, check if the sum of the lengths of the parts exceeds the length of the original rebar. Clearly, 2.1 + 4.2 + 4.3 + 5.1 = 15.7m > 12m. Therefore, the smallest part is removed and placed in the excess area, i.e., the 2.1m part is removed. Then, check if the remaining parts exceed the original length: 4.2 + 4.3 + 5.1 = 13.6m > 12m. Continue removing the smallest part, i.e., the 4.2m part. Next, check if the remaining parts exceed the original length: 4.3 + 5.1 = 9.4m < 12m. Therefore, the excess area contains two types of parts: 2.1m and 4.2m. Finally, insert the excess parts into the original rebar. At this point, the remaining length of the original steel bar is 12 - 9.4 = 2.3m. Since 2.1m < 2.3m < 4.2m, the 2.1m cutting part is inserted into this original steel bar, while the 4.2m cutting part needs to be placed on a new original steel bar to be cut. Therefore, this original steel bar needs to be cut into cutting parts of 2.1m, 4.3m, and 5.1m.
[0098] Step 3.9: Let gen = gen + 1. Repeat the crossover, mutation, chromosome correction, and selection processes on the newly generated population after chromosome correction to achieve iteration. When the number of iterations meets the preset number, the iteration ends, and the chromosome with the highest fitness in the current generation is output. This chromosome is the optimal cutting scheme. The preset number of iterations can be 500-1000.
[0099] For example, the raw steel bar material for a certain project is 12m long, and the required cutting length of the parts is [1.5,1.9,2,2.3,2.7,3.1,3.6,3.9,4.2,4.7], corresponding to the required quantity of [4,3,6,8,9,1,7,5,6,3]. The cutting scheme can be obtained by calculation as shown in the table below.
[0100]
[0101] As shown in the table, in this embodiment, the number of blanking parts of different lengths on the output chromosome is equal to the number of blanking parts required, the total utilization rate of steel bars is 98.3%, the longest residual material at the end is 2.4m, and the utilization rate of the last steel bar is 99.7%, which is a good result.
[0102] It should be noted that the calculated utilization rate is highly dependent on the length and quantity of the steel bar cutting parts.
[0103] Based on the calculation results, an Excel spreadsheet of the material cutting plan is output. After the terminal device calculates the material cutting plan, it automatically recognizes and exports it as an Excel spreadsheet.
[0104] Any aspects not covered in this invention are applicable to existing technologies.
Claims
1. A calculation method for optimized steel bar cutting based on genetic algorithm, comprising the following steps: Step 1: Obtain information on raw steel bars and classify and store them according to strength grade and diameter; Step 2: Obtain all lengths of the steel reinforcement cutting parts and store them together with the corresponding raw materials according to their strength grade and diameter. Determine the length of the steel reinforcement cutting parts required for each type of raw material and the required quantity for each length. Step 3: Use a genetic algorithm to calculate the steel reinforcement cutting plan, determining the optimal cutting plan and the required quantity of steel reinforcement materials. The specific process is as follows: Step 3.1, determine the fitness function and selection operator: The fitness function considers the longest single piece of surplus material and the minimum total used raw materials, with one remaining piece of raw material possessing the longest surplus material. The fitness function is the difference between the length of the used steel reinforcement material number minus one and the maximum value of the remaining material among all used steel reinforcement materials. The target formula is , in, This represents the number of steel reinforcement materials already used. Let represent the number of the i-th type of cutting parts on the j-th raw material. Let be the length of the i-th type of blank; The operator P is selected according to the selection probability. Select a certain number of individuals from the current population, with a selection probability. The difference between the maximum fitness in the entire population and the fitness of a single individual is the sum of the fitness of all individuals in the entire population. Step 3.2, Preset raw material quantity: According to Calculate the preset quantity k of the current type of raw material, where round refers to rounding up. Let be the length of the i-th type of required part. Let L be the number of parts required for the i-th type of material, and L be the length of the raw material. Step 3.3, Encoding Rules: Let the required length of the part to be cut from the current type of raw material be... The corresponding number of parts to be cut is Arrange the blanking parts in ascending order of length, and record the lengths of the blanking parts as follows: The number of parts to be cut according to the length sorting order is: ; Arrange all blank parts in ascending order, with blank parts of the same length arranged sequentially. The result of sorting all blank parts is: , The encoding rule is as follows: based on the preset raw material quantity k, the range of values for the encoded characters is set to... The length of a single raw material is set to L. For each cut part, the coding character is... Random selection is performed within the internal part for random coding. After all the cut parts are coded, they form a chromosome with a length of [missing information]. n is the number of types of parts to be cut, d i This is the number of blank parts required for the i-th length. According to the coding rules, we know which lengths of blank parts need to be cut from the same raw material; Step 3.4: Set the maximum number of iterations, let gen=1, and randomly generate 2N individuals according to the encoding rules to form the first population; Step 3.5: Perform selection processing on the first population using the selection operator to obtain offspring 1: Calculate the fitness of each chromosome in the 2N individuals of the first population, calculate the selection operator P based on the chromosome fitness, and obtain the selection probability of each chromosome being selected; the chromosomes with the top N selection probability values are selected as a preset number of chromosomes, which are offspring 1. Step 3.6: Set the crossover probability, and perform crossover processing on offspring 1 using the two-point crossover operator to obtain offspring 2; Step 3.7: Set the mutation probability, and use the mutation operator to mutate offspring 2 to obtain offspring 3; Step 3.8: Determine if any chromosome in offspring 3 causes the utilization rate of a single steel rebar to exceed 100%. If so, chromosome correction processing is required for offspring 3 to obtain the second population, specifically: Based on the genes on the chromosomes of offspring 3, all unused raw materials were deleted from the raw materials, and the used steel reinforcement materials were re-encoded. The coded characters are in... Randomly selected from within, the m steel bars already used are denoted as follows: ; Inspect raw materials If the blanking parts are on the upper part, The sum of the lengths of the blank parts exceeds the length of the original material. Delete the smallest blanking part and place it in the overflow area; repeat the process of judging and deleting the smallest blanking part until... The sum of the lengths of all blanked parts is less than or equal to L; calculate When the sum of the lengths of all blanked parts is less than or equal to L The length of the remaining raw material is compared with the length of the blank part that exceeds the expected length of the raw material. The longest blank part that is shorter than the expected length of the raw material is then inserted again. In the middle, making The sum of the lengths of all the cut parts must never exceed L; The blanking parts that cannot be inserted into the area are placed on the new raw material to be cut. The length, type or number of blanking parts to be cut on the new raw material to be cut changes, and the correction of chromosome 3 of offspring is completed. The second population is obtained by selecting the corrected offspring 3 through the selection operator. Step 3.9: Let gen = gen + 1. Repeat steps 3.6-3.8 for the newly generated population after chromosome correction to perform the next iteration. When the number of iterations meets the maximum number of iterations, the iteration ends and the chromosome with the highest fitness in the current generation is output. This chromosome is the optimal cutting scheme.
2. The calculation method for optimized steel bar cutting based on genetic algorithm according to claim 1, characterized in that, The process of the two-point crossover operator is as follows: crossover does not necessarily occur when offspring are generated, but crossover occurs with a certain probability. Every chromosome in the population is traversed, and one chromosome is taken as the parent chromosome. Another chromosome is selected from the population and taken as the mother chromosome. The parent chromosome and the mother chromosome are not the same chromosome. Crossover point 1 and crossover point 2 are randomly generated on the parent chromosome and the mother chromosome. The crossover points 1 and 2 of the parent chromosome and the crossover points 1 and 2 of the mother chromosome are located at the same position of the gene. The offspring chromosomes obtain the gene of the mother chromosome located before the low crossover point, the gene of the mother after the high crossover point, and the gene of the parent chromosome located between the low crossover point and the high crossover point.
3. The calculation method for optimized steel bar cutting based on genetic algorithm according to claim 1, characterized in that, The mutation operator works as follows: each offspring has a certain probability of mutation, two different gene positions are randomly generated on the chromosome of the offspring, and the genes at these two positions are exchanged.
4. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program can perform the steps of the method described in any one of claims 1-3.
5. A computational device for optimizing steel bar cutting based on a genetic algorithm, characterized in that, The device performs the method of claim 1, comprising: a memory, a processor, an input / output interface, a network interface, and a communicator; The memory is used to store information about the raw steel bars, the cutting parts, and the optimal solution. The processor is used to execute the process of using a genetic algorithm to calculate the steel reinforcement cutting scheme, and to calculate the optimal cutting scheme and the required quantity of steel reinforcement materials. The input / output interface is used to acquire information on the raw steel bars and the cutting parts, and can also output the optimal cutting scheme after the processor has processed it. The communicator is used for communication between the aforementioned memory, processor, input / output interface, and network interface; The network interface is used to communicate with external devices and export the optimal material cutting scheme.