One-dimensional blanking method based on genetic evaluation genetic algorithm

By scoring and mutating each gene in the chromosome, the encoding method of the genetic algorithm is improved, which solves the problems of low efficiency and high memory consumption in traditional methods and achieves faster optimal solution finding.

CN116663660BActive Publication Date: 2025-11-11HEBEI UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310652588.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-05
Publication Date
2025-11-11
Estimated Expiration
2043-06-05

AI Technical Summary

Technical Problem

Traditional one-dimensional cutting methods are inefficient, error-prone, time-consuming, and consume a lot of computer memory resources. Existing genetic algorithms are insufficient in terms of gene mutation, making it difficult to quickly find the optimal solution.

Method used

A genetic algorithm based on gene evaluation is adopted. By scoring each gene in the chromosome and selecting excellent genes for mutation, the chromosome encoding method and mutation operation are improved, and the evaluation time and computational complexity are reduced.

Benefits of technology

It improves the algorithm's solution efficiency and convergence speed, enabling it to find the optimal solution faster, reducing the generation of invalid genes, and lowering computational complexity and computer memory consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116663660B_ABST
    Figure CN116663660B_ABST
Patent Text Reader

Abstract

This invention is a one-dimensional material cutting method based on gene evaluation genetic algorithm. By randomly combining gene materials, the composition of each gene can be intuitively understood, and the cutting of each steel bar can also be known. The time spent on decoding is reduced. By scoring each gene in the chromosome, excellent genes are selected for mutation, and the optimal solution can be obtained more easily and quickly. The new mutation method reduces the evaluation time of individuals and speeds up the convergence speed of the algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This method relates to the field of one-dimensional material cutting combination optimization, and more specifically to the research of genetic algorithms in the field of one-dimensional material cutting problems. Background Technology

[0002] With the continuous advancement of China's industrialization and urbanization, more and more fields require the support of steel, especially the use of reinforcing bars, which is increasing daily. Optimized rebar cutting refers to the process of minimizing waste and improving the utilization rate of rebar by rationally cutting its length while meeting structural design requirements. It's important to note that optimized rebar cutting is a one-dimensional cutting method. Traditional methods involve manual calculations, calculating the length of each rebar according to the length requirements on the design drawings before cutting. This method is inefficient, prone to errors, time-consuming, and labor-intensive, and it cannot guarantee an optimal solution. Modern one-dimensional cutting methods utilize computer technology and optimization algorithms to model and calculate factors such as rebar length, material, and specifications to derive the optimal cutting scheme, reducing rebar waste.

[0003] In recent decades, regarding the one-dimensional cutting problem, China proposed using genetic algorithms to solve it in 1997, followed by hybrid genetic algorithms and improved adaptive genetic algorithms. Among these, Wei Liangliang et al.'s improved adaptive genetic algorithm for the one-dimensional cutting problem introduced a descending optimal adaptation strategy, improving the algorithm's accuracy. However, the descending optimal adaptation strategy significantly increased the evaluation time for each individual. Later, Zhu Shenglan et al.'s research on optimization algorithms for the one-dimensional cutting problem demonstrated that genetic algorithms are suitable for large-scale scenarios, but their limitation lies in gene mutation. More recently, Li Bin, Peng Yaoyao, and other scholars have published papers on improved hybrid genetic algorithms and genetic algorithms based on expansion-contraction mechanisms for solving the one-dimensional cutting problem. These methods enrich the population sample and facilitate finding the optimal solution, but also increase the consumption of computer memory resources. Summary of the Invention

[0004] To overcome the aforementioned shortcomings of existing technologies, this invention proposes a genetic algorithm based on gene evaluation to solve the one-dimensional material feeding problem. Traditional one-dimensional material feeding genetic algorithms only focus on evaluating the fitness of chromosomes. This invention scores each gene in the chromosome and then selects excellent genes for mutation, thereby solving the shortcomings of the aforementioned background technologies.

[0005] The technical solution adopted in this invention is as follows:

[0006] A one-dimensional material cutting method based on gene evaluation genetic algorithm, the material cutting method includes the following steps:

[0007] S1, Input the raw material length Len, and the required steel bar component lengths l1, l2, ..., l s Quantities de1, de2, ..., de s Number of iterations R, crossover probability p c Mutation probability p m The convergence rate is c, and the population size is n. The length and quantity of parts are in one-to-one correspondence. The information on the length and quantity of usable steel reinforcement parts is called genetic material, with the part length as an element in the gene: de1, de2, ..., de s The values ​​are all less than or equal to Len, where s is the number of different part length types;

[0008] S2. Initialize the population based on the genetic material in S1 and perform random combination encoding. The specific process is as follows:

[0009] S21、d1,d2,···,d s This represents the real-time quantity of parts of different lengths, initially designated as d1, d2, ..., d s It equals the input de1, de2, ..., de in step S1 s L represents the remaining length of the raw material, initially set to equal Len.

[0010] S22. Determine d1, d2, ..., d s Which values ​​are greater than 0?

[0011] S23. Determine l1, l2, ..., l s Which values ​​are less than or equal to L?

[0012] S24. Select gene materials that simultaneously satisfy steps S22 and S23;

[0013] S25. Randomly select one l from the results obtained in step S24. r , and the corresponding d r Decrease by 1 and update the remaining length L of the raw material, that is, subtract the length of the selected part from the remaining length L of the raw material;

[0014] S26. Then repeat S22-S25 until the remaining length L of the raw material is less than d1, d2, ..., d s The non-zero values ​​of l1, l2, ..., l s The minimum value in or d1, d2, ..., d s If both values ​​are 0, record the length of the randomly selected part at this point, denoted as l. x ,l y ,···,l z ;

[0015] S27. Select the l x ,l y ,···,l z Together with the stable marker and the replication marker, they form a gene on an individual chromosome. Both markers are set to False when the gene is first combined. Both markers disappear after the gene is disassembled, but the elements in the gene do not disappear.

[0016] S28. Select multiple raw materials and repeat steps S22-S27 until d1, d2, ..., d s All of them equal 0, and the resulting numerous gene combinations become individual chromosomes, realizing random combination encoding;

[0017] S29. Execute S21-S28 n times to complete the initialization of the population, where n is the population size;

[0018] S3, based on the crossover probability p c Perform cross operations;

[0019] S4. Score each gene on each chromosome of each individual in the population: Find all genes with stable markers set to False in the individual, sum all elements in each gene with a stable marker set to False, and suml is the gene score. Select the gene with the highest gene score for mutation. Select the individual with the lowest gene score on the chromosome and calculate the individual's fitness value using the lowest gene score. The fitness function f is:

[0020] f(k,minsuml)=(k-1)*Len+minsuml

[0021] Where: k is the number of genes in an individual chromosome, minsuml is the smallest suml in an individual chromosome, and Len is the length of the raw material;

[0022] S5. If the evolutionary conditions are met, output the optimal solution. If the evolutionary conditions are not met, select an individual that needs to be selected for the next round of iteration based on the fitness value and the selection probability. The smaller the fitness value, the greater the probability of being selected.

[0023] Furthermore, the evolutionary condition is whether the number of iterations R has been reached or whether the stability flag and replication flag of all genes on all chromosomes of all individuals in the population are set to True.

[0024] Furthermore, step S3 includes the following sub-steps:

[0025] S31. Randomly generate a decimal number between 0 and 1. If the randomly generated decimal number is less than the crossover probability p... cThen execute S32 and S33 if p is greater than or equal to p. c Then do nothing;

[0026] S32. Randomly select two individuals from the population;

[0027] S33. Randomly select one gene with a stable flag bit of False from each of the two individuals and perform a crossover operation.

[0028] The crossover operation is as follows: Suppose chromosome A wants to obtain gene b from chromosome B, and chromosome B wants to obtain gene a from chromosome A. Then, determine whether all genes with stable markers set to False in chromosome A and gene a can be separated to form a crossover gene b. If they can, then separate those genes in chromosome A that can form gene b within a small range. If the separated genes can form gene b in chromosome B, then stop separating chromosome A. Then, combine a gene b and set the stable marker and replication marker of gene b to False. The remaining gene material after separation is combined according to steps S22 to S28 until the separated gene material is used up. If a crossover gene b cannot be formed, do nothing. Similarly, perform the same operation on chromosome B.

[0029] Furthermore, the mutation operation includes:

[0030] After obtaining the gene score for each gene on an individual chromosome, the gene scores are sorted from largest to smallest; the gene with the largest gene score is selected. If there are multiple genes with the same largest suml value, one of them is randomly selected; it is determined whether the selected gene meets the mutation conditions. If it meets the conditions, the mutation operation is performed; otherwise, nothing is done.

[0031] The mutation conditions are as follows: First, determine if the current iteration number r is less than or equal to R / 10. If so, then determine if the suml value of the selected gene is equal to Len. If so, perform the mutation operation. If the current iteration number r is greater than R / 10, then determine if the suml value of the selected gene is greater than or equal to Lc*r*(Len / 10). If so, perform the mutation operation. Otherwise, do nothing.

[0032] The gene that meets the mutation condition in the current iteration round is the gene to be mutated. The stable marker and replication marker of the gene to be mutated are both set to True. Then, all genes with stable markers of False in the individual chromosome are disassembled. Then, gene materials with the same elements as the gene to be mutated are selected from the disassembled gene materials and replicated. The stable marker and replication marker of the replicated gene are also set to True. This process continues until replication is no longer possible. Whether the gene to be mutated can be replicated depends on whether the disassembled gene materials can be combined to form a gene with all markers of True. If they can be combined, they can be replicated; if they cannot be combined, they cannot be replicated. The remaining gene materials are combined according to steps S22 to S28 to form new genes with both stable markers of False. This process continues until all the disassembled gene materials are used up.

[0033] Furthermore, the specific process of selecting individuals for the next iteration based on their fitness values ​​and selection probabilities is as follows: arranging the fitness values ​​from smallest to largest, determining the selection probability using an exponential function based on the ranking, and the selection probability of the chromosome of the individual ranked i is pi, where pi = m·(1-m). i-1 i = 1, 2, ..., n, m is a constant less than 1, and individual chromosomes are selected iteratively according to the selection probability.

[0034] The value of m is 4 / n.

[0035] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0036] (1) Traditional one-dimensional genetic algorithms only focus on evaluating the fitness of chromosomes. This invention scores each gene in the chromosome and selects the best genes for mutation, thus making it easier and faster to obtain the optimal solution.

[0037] (2) This invention employs a random combination coding method, improving upon the chromosome coding method in the traditional one-dimensional material feeding genetic algorithm, and avoiding the generation of invalid genes. The traditional coding method involves numbering all raw materials as follows: Similarly, all parts are numbered. Random from Select from the numbers The chromosome code for an individual is formed by a set of numbers. For example, (3, 5, 2, ..., 3) represents the chromosome code of an individual, indicating that part number 1 is placed on raw material number 3, part number 2 is placed on raw material number 5, part number 3 is placed on raw material number 2, and so on. Part number 3 is located on raw material number 3. Traditional encoding methods incur significant time consumption during decoding. For example, in optimizing rebar cutting, it's necessary to know the cutting method for each rebar. This requires decoding the entire sequence of parts, and the time complexity of decoding is comparable to that of part numbering. Proportional. In this application, by randomly combining genetic materials, the composition of each gene can be intuitively understood, and the cutting method of each steel bar can also be known, thus reducing the time spent on decoding.

[0038] (3) The present invention reduces the evaluation time of individuals and accelerates the convergence speed of the algorithm by proposing the mutation method. Attached Figure Description

[0039] Figure 1 This is a flowchart of a one-dimensional material feeding method based on a gene evaluation genetic algorithm.

[0040] Figure 2 This is a schematic diagram of the chromosomes in a population; stability and replication markers are omitted from the diagram.

[0041] Figure 3 This is a diagram of chromosome A crossing over; the stability marker and replication marker are omitted from the diagram.

[0042] Figure 4 This is a schematic diagram of B chromosome crossing over; the stability marker and replication marker are omitted from the diagram.

[0043] Figure 5 This is a schematic diagram of the mutation operation; the stability flag and replication flag are omitted in the diagram.

[0044] Figure 6 This is a schematic diagram of a gene on a chromosome. Detailed Implementation

[0045] The specific embodiments of the present invention are described below to enable those skilled in the art to understand the present invention. However, it should be understood that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the present invention as defined and determined by the appended claims. All inventions utilizing the concept of the present invention are protected.

[0046] like Figure 1 As shown, the one-dimensional feeding method based on gene evaluation genetic algorithm includes steps S1-S8:

[0047] S1, Input the raw material length Len, and the required steel bar component lengths l1, l2, ..., l s Quantities de1, de2, ..., de s Number of iterations R, crossover probability pc Mutation probability p m The convergence rate is c, and the population size is n. The length and quantity of parts are in one-to-one correspondence. The information on the length and quantity of usable steel reinforcement parts is called genetic material, with the part length as an element in the gene: de1, de2, ..., de s The values ​​are all less than or equal to the raw material length Len (in cm), and s is the number of types of part lengths.

[0048] In an optional embodiment of the present invention, let Len = 1000, l1 = 512, l2 = 321, l3 = 128, l4 = 247, l5 = 290, de1 = 6, de2 = 8, de3 = 5, de4 = 10, de5 = 4, p c =0.2, p m =0.2, n=50, R=300, c=0.01.

[0049] S2. Initialize the population based on the genetic material in S1.

[0050] In an optional embodiment of the present invention, an initialization operation is performed based on the information in step S1, and the obtained initialization result can be used... Figure 2 express.

[0051] Step S2 includes the following sub-steps:

[0052] S21、d1,d2,···,d s This represents the real-time quantity of parts of different lengths, initially designated as d1, d2, ..., d s It equals the input de1, de2, ..., de in step S1 s L represents the remaining length of the raw material, initially set to equal Len.

[0053] In an optional embodiment of the present invention, there are initially 6 gene materials of 512, 8 of 321, 5 of 128, 10 of 247, and 4 of 290.

[0054] In an optional embodiment of the present invention, the initial time setting is L equal to 1000.

[0055] S22. Determine d1, d2, ..., d s Which values ​​are greater than 0?

[0056] In an optional embodiment of the present invention, initially 6, 8, 5, 10, and 4 are all greater than 0.

[0057] S23. Determine l1, l2, ..., l s Which values ​​are less than or equal to L?

[0058] In an optional embodiment of the present invention, initially 512, 321, 128, 247, and 290 are all less than 1000.

[0059] S24. Select gene materials that simultaneously satisfy steps S22 and S23;

[0060] In an optional embodiment of the present invention, initially, 6 gene materials of 512, 8 gene materials of 321, 5 gene materials of 128, 10 gene materials of 247, and 4 gene materials of 290 were selected.

[0061] S25. Randomly select one l from the results obtained in step S24. r , and the corresponding d r Decrease by 1 and update the remaining length L of the raw materials. That is, subtract the length of the selected part from the remaining length L of the raw materials. The update method is L = Ll. r ;

[0062] In an optional embodiment of the present invention, if 512 is initially selected, then d1 is reduced by 1 to become 5, and the remaining length L of the raw material is reduced by 512 to become 488. At this time, the gene material becomes 5 x 512, 8 x 321, 5 x 128, 10 x 247, and 4 x 290.

[0063] S26. Then repeat S22-S25 until the remaining length L of the raw material is less than d1, d2, ..., d s The non-zero values ​​of l1, l2, ..., l s The minimum value in or d1, d2, ..., d s If both values ​​are 0, record the length of the randomly selected part at this point, denoted as l. x ,l y ,···,l z ;

[0064] In an optional embodiment of the present invention, step S22 determines that 5, 8, 5, 10, and 4 are all greater than 0; step S23 determines that 321, 128, 247, and 290 are less than 488; step S24 determines that 8 gene materials of 321, 5 gene materials of 128, 10 gene materials of 247, and 4 gene materials of 290 are selected; step S25 selects 321, then d2 is reduced by 1 to become 7, and the remaining length L of the raw material is reduced by 321 to become 167. At this time, the gene materials become 5 gene materials of 512, 7 gene materials of 321, 5 gene materials of 128, 10 gene materials of 247, and 4 gene materials of 290. Next, step S22 checks if 5, 7, 5, 10, and 4 are all greater than 0. Step S23 checks if 128 is less than 167. Step S24 checks if five gene materials with a length of 128 are selected. Step S25 selects 128, so d3 is reduced by 1 to 4, and the remaining length L of the raw material is reduced by 128 to 39. At this point, the gene materials become five 512, seven 321, four 128, ten 247, and four 290. The remaining length L of the raw material is now 39, and 512, 321, 128, 247, and 290 are all greater than 39. The length L of one gene... x ,l y ,l z Selection complete.

[0065] This explains why the remaining length L of the raw material is less than d1, d2, ..., d s The non-zero values ​​of l1, l2, ..., l s The meaning of the minimum value in the equation. If the remaining length L of the raw materials is 250, and the gene materials are 2 x 512, 0 x 321, 0 x 128, 0 x 247, and 6 x 290, then d1, d2, ..., d s The non-zero values ​​of l1, l2, ..., l s The minimum value is 290, and 290 is greater than 250. Therefore, the gene l is selected. x ,l y ,···,l z The process is over.

[0066] S27. Select the l x ,l y ,···,l z Together with the stability marker and the replication marker, these three parts form a gene on an individual chromosome. Two of the markers are set to False when the gene is first assembled, and both markers disappear after the gene is disassembled. x ,l y ,···,l z Genetic material will not disappear, where x, y, ..., z equals the values ​​in 1, 2, ..., s. Two markers are generated during gene formation and disappear during gene disassembly. The l in the gene... x ,l y ,···,lz The order is based on the random selection process.

[0067] In an optional embodiment of the present invention, the stability flag with a value of 512, 321, 128, and a replication flag with a value of False are combined to form one gene, such as... Figure 6 As shown.

[0068] S28. Select multiple raw materials and repeat steps S22-S27 until d1, d2, ..., d s All of them equal 0, and the resulting numerous gene combinations become the individual's chromosomes.

[0069] In an optional embodiment of the present invention, an individual's chromosome contains one 247 gene, one 512, 321 gene, one 321, 321, 247 gene, one 321, 247, 247 gene, one 290, 128, 512 gene, one 247, 247, 247, 247 gene, one 247, 321, 128, 128 gene, one 290, 321, 290 gene, two 321, 128, 512 genes, one 512, 247 gene, and one 512, 290 gene, which together form an individual's chromosome.

[0070] S29. Execute S21-S28 n times to complete the initialization of the population and realize random combination encoding, where n is the population size.

[0071] S3, based on the crossover probability p c Perform cross operations.

[0072] In an optional embodiment of the invention, the crossover operation is as follows: Figure 3 and Figure 4 As shown.

[0073] Step S3 includes the following sub-steps:

[0074] S31. Randomly generate a decimal number between 0 and 1. If the randomly generated decimal number is less than the crossover probability p... c Then execute S32 and S33 if p is greater than or equal to p. c Then do nothing;

[0075] In an optional embodiment of the present invention, the randomly generated decimal is 0.18, and it is decided to continue executing steps S32 and S33.

[0076] S32. Randomly select two individuals from the population;

[0077] S33. Randomly select one gene with a stable marker bit of False from each of the two individuals and perform a crossover operation.

[0078] The crossover operation is as follows: Let chromosome A be ( Figure 3 To obtain chromosome B ( Figure 4 To obtain the a gene from chromosome A, chromosome B needs to obtain the b gene from chromosome A. The process involves determining whether all genes with stable markers set to False in chromosome A, along with the a gene, can be separated to form a crossover b gene. If so, genes that can form the b gene are separated within a small scope, while other genes are not separated. This small scope refers to the process of sequentially scanning during separation. If the selected genes can form the b gene, no further separation is needed; separation is limited to a small area. A b gene is then created, and its stable and replication markers are set to False. The remaining gene material is then combined according to steps S22 to S28 until all the separated gene material is used. If a crossover b gene cannot be formed, no action is taken. The same operation is performed on chromosome B. This method of operation does not produce invalid genes.

[0079] In an optional embodiment of the present invention, during a certain iteration round, genes 321, 247, and 247 in chromosome A are intended to be exchanged with genes 321, 321, and 321 in chromosome B. At this point, it is found that the stable markers of two genes 321, 128, and 512 in chromosome A are True, so these two genes are not split, and the stable markers of the remaining genes are False. Within a small range, it is found that genes 321, 247, and 247 in chromosome A can be combined into a single gene 321, 321, and 321. Therefore, genes 321, 247, and 247 in chromosome A are split and combined into a single 321, 321, and 321 gene. The remaining gene material is combined into a single gene 247, 247, and 247. The stable and replication markers of these two genes are set to False. Other genes in chromosome A with stable markers of False are not split.

[0080] It was found that the stable marker bits of all genes on chromosome B were False. Within a small range, genes 321, 321, 321, genes 512, 247, and genes 247, 247 could be combined into a single gene 321, 247, 247. Therefore, these three genes were decomposed and combined into one gene 321, 247, 247, one gene 321, 321, and one gene 512, 247. The stable and replication marker bits of these three genes were set to False. No further action was taken on other genes on chromosome B whose stable marker bits were False.

[0081] S4. Score each gene on each chromosome of each individual in the population.

[0082] Step S4 includes the following sub-steps:

[0083] S41. Select an individual from the population;

[0084] S42. Find all genes in an individual whose stable marker bits are False;

[0085] S43, extract the element l from the gene obtained in step S42. x ,l y ,···,l z The values ​​are added together to get suml, which is the gene score. The larger suml is, the more likely the gene is to mutate. The genes obtained in step S29 and the genes obtained after the crossover operation both have a stability flag of False and will be scored.

[0086] In an optional embodiment of the present invention, genes 321, 128, 512, 321, 321, 247, and 247, 247, 290 are scored. If genes 321, 128, and 512 have the highest suml values, then those genes are selected for mutation.

[0087] S44. Each individual in the population performs steps S42 and S43.

[0088] S5, according to the mutation probability p m Perform mutation operations.

[0089] In an optional embodiment of the invention, the mutation operation is as follows: Figure 5 As shown.

[0090] Step S5 includes the following sub-steps:

[0091] S51. Select an individual from the population;

[0092] S52. Find all genes in an individual's chromosome whose stable marker positions are False;

[0093] S53. Arrange the suml of the genes obtained in step S52 from largest to smallest;

[0094] S54. Select the gene with the largest suml value. If there are multiple genes with the same largest suml value, then select any one of them.

[0095] S55. Determine whether the gene obtained in step S54 meets the mutation conditions. If it meets the conditions, perform the mutation operation; otherwise, do nothing.

[0096] The mutation conditions are as follows: First, determine whether the current iteration number r is less than or equal to R / 10. If so, then determine whether the suml value of the selected gene is equal to Len. If so, perform the mutation operation. If the current iteration number r is greater than R / 10, then determine whether the suml value of the selected gene is greater than or equal to Len-c*r*(Len / 10). If so, perform the mutation operation. Generally, the larger the iteration number R is, the smaller the convergence rate c is. In other cases, nothing is done.

[0097] The mutation operation is as follows: set both the stable marker and replication marker of the gene to be mutated to True; then disassemble all genes in the chromosome whose stable marker is False; then select elements from the disassembled gene material that are compatible with the gene to be mutated and replicate them, and set both the stable marker and replication marker of the replicated gene to True as well, until replication is no longer possible; the remaining gene material is combined according to steps S22 to S28 to form new genes whose stable marker and replication marker are both False, until all the disassembled gene material is used up.

[0098] In an optional embodiment of the present invention, the stability and replication markers of genes 247, 247, 247, 247 have been mutated in the previous round, and their stability and replication markers are set to True. In this round, genes 321, 128, and 512 are selected after step S54, and after step S55, it is found that they meet the mutation conditions. At this time, the stability and replication markers of genes 321, 128, and 512 are set to True. Therefore, except for these three genes, all other genes in the chromosome are disassembled, and the disassembled gene materials are 5 genes of 512, 7 genes of 321, 4 genes of 290, 2 genes of 247, and 4 genes of 128. Whether the gene to be mutated can be replicated depends mainly on whether the disassembled gene material can be combined to form the gene to be mutated. If it can be combined, it can be replicated; if it cannot be combined, it cannot be replicated. Then, genes 321, 128, and 512 are replicated according to the shortest possible length, and the number of replications is the same as the number of shortest possible lengths. In an optional embodiment, they are replicated 4 times. The stability flag and replication flag of the 4 replicated genes 321, 128, and 512 are both True. At this time, the gene material becomes 1 512, 3 321, 4 290, 247, and 0 128. The remaining gene material is randomly combined according to the conditions to form 1 512, 321 gene, 1 290, 290, 247 gene, 1 321, 247, 290 gene, and 1 290, 321 gene, but the stability flag and replication flag of the resulting genes are all False.

[0099] S56. Each individual chromosome in the population executes steps S52, S53, S54, and S55.

[0100] S6. Assess the fitness of each individual in the population.

[0101] In an optional embodiment of the present invention, Figure 5 The chromosome contains 5 genes 321, 128, and 512; 2 genes 247, 247, 247, and 247; 1 gene 512 and 321; 1 gene 290, 290, and 247; 1 gene 321, 247, and 247; and 1 gene 290 and 321. The minsuml value is 611. This individual has 11 genes on its chromosome, k = 11, and the calculated fitness value is 10611.

[0102] Step S6 includes the following sub-steps:

[0103] S61. Select an individual from the population;

[0104] S62. Substitute the relevant data of the individual into the fitness function to obtain the fitness value. The fitness function is: f(k,minsuml)=(k-1)*Len+minsuml, where: k is the number of genes in the individual chromosome, minsuml is the smallest suml in the individual chromosome, and Len is the length of the raw material.

[0105] S63. Each individual in the population performs step S62.

[0106] S7. Decide whether to continue evolving. If you decide to continue evolving, perform a selection operation, and then continue to execute S3, S4, S5, S6, and S7. Otherwise, execute S8 directly.

[0107] In an optional embodiment of the invention, after 300 iterations, it is decided to abandon evolution and output the optimal solution.

[0108] Furthermore, step S7 includes evolutionary conditions and selection operations:

[0109] The evolutionary conditions are: whether the number of iterations R has been reached or whether the stability and replication flags of all genes on all chromosomes of all individuals in the population are set to True.

[0110] The selection operation involves: arranging the obtained fitness values ​​from smallest to largest, and determining the selection probability using an exponential function based on the ranking, where p... i =m·(1-m) i-1 Let i = 1, 2, ..., n, where i represents the i-th individual after ranking, and p i Let m represent the selection probability of the i-th ranked individual, where m = 4 / n, and n is the population size. Individuals are selected iteratively based on the obtained probabilities.

[0111] S8. Output the optimal solution.

[0112] In an optional embodiment of the present invention, the optimal output solution is one 290, 128, 290, 290 gene, one 290, 321, 128, 128, 128 gene, two 321, 321, 321 genes, one 321, 512, 128 gene, two 247, 247, 247, 247 genes, two 512, 247 genes, and three 512 genes.

[0113] Those skilled in the art will recognize that the examples described herein are intended to help the reader understand the principles of the invention and should be understood as not limiting the scope of protection of the invention to such specific statements and embodiments. Those skilled in the art can make various other specific modifications and combinations based on the technical teachings disclosed in this invention without departing from the spirit of the invention, and these modifications and combinations are still within the scope of protection of this invention.

[0114] Any aspects not covered in this invention are applicable to existing technologies.

Claims

1. A one-dimensional material feeding method based on gene evaluation genetic algorithm, characterized in that, The material feeding method includes the following steps: S1, Input the raw material length Len, and the required steel bar component lengths l1, l2, ..., l s Quantities de1, de2, ..., de s Number of iterations R, crossover probability p c Mutation probability p m The convergence rate is c, and the population size is n. The length and quantity of parts are in one-to-one correspondence. The information on the length and quantity of usable steel reinforcement parts is called genetic material, with the part length as an element in the gene: de1, de2, ..., de s The values ​​are all less than or equal to Len, where s is the number of different part length types; S2. Initialize the population based on the genetic material in S1 and perform random combination encoding. The specific process is as follows: S21、d1,d2,···,d s This represents the real-time quantity of parts of different lengths, initially designated as d1, d2, ..., d s It equals the input de1, de2, ..., de in step S1 s L represents the remaining length of the raw material, initially set to equal Len. S22. Determine d1, d2, ..., d s Which values ​​are greater than 0? S23. Determine l1, l2, ..., l s Which values ​​are less than or equal to L? S24. Select gene materials that simultaneously satisfy steps S22 and S23; S25. Randomly select one l from the results obtained in step S24. r , and the corresponding d r Decrease by 1 and update the remaining length L of the raw material, that is, subtract the length of the selected part from the remaining length L of the raw material; S26. Then repeat S22-S25 until the remaining length L of the raw material is less than d1, d2, ..., d s The non-zero values ​​of l1, l2, ..., l s The minimum value in or d1, d2, ..., d s If both values ​​are 0, record the length of the randomly selected part at this point, denoted as l. x ,l y ,···,l z ; S27. Select the l x ,l y ,···,l z Together with the stable marker and the replication marker, they form a gene on an individual chromosome. Both markers are set to False when the gene is first combined. Both markers disappear after the gene is disassembled, but the elements in the gene do not disappear. S28. Select multiple raw materials and repeat steps S22-S27 until d1, d2, ..., d s All of them equal 0, and the resulting numerous gene combinations become individual chromosomes, realizing random combination encoding; S29. Execute S21-S28 n times to complete the initialization of the population, where n is the population size; S3, based on the crossover probability p c Perform cross operations; S4. Score each gene on each chromosome of each individual in the population: Find all genes with stable markers set to False in the individual, sum all elements in each gene with a stable marker set to False, and suml is the gene score. Select the gene with the highest gene score for mutation. Select the individual with the lowest gene score on the chromosome and calculate the individual's fitness value using the lowest gene score. The fitness function f is: f(k,minsuml)=(k-1)*Len+minsuml Where: k is the number of genes in an individual chromosome, minsuml is the smallest suml in an individual chromosome, and Len is the length of the raw material; S5. If the evolutionary conditions are met, output the optimal solution. If the evolutionary conditions are not met, select an individual that needs to be selected for the next round of iteration based on the fitness value and the selection probability. The smaller the fitness value, the greater the probability of being selected.

2. The one-dimensional feeding method based on gene evaluation genetic algorithm according to claim 1, characterized in that, The evolutionary conditions are: whether the number of iterations R has been reached or whether the stability flag and replication flag of all genes on all chromosomes of all individuals in the population are set to True.

3. The one-dimensional feeding method based on gene evaluation genetic algorithm according to claim 1, characterized in that, Step S3 includes the following sub-steps: S31. Randomly generate a decimal number between 0 and 1. If the randomly generated decimal number is less than the crossover probability p... c Then execute S32 and S33 if p is greater than or equal to p. c Then do nothing; S32. Randomly select two individuals from the population; S33. Randomly select one gene with a stable flag bit of False from each of the two individuals and perform a crossover operation. The crossover operation is as follows: Suppose chromosome A wants to obtain gene b from chromosome B, and chromosome B wants to obtain gene a from chromosome A. Then, determine whether all genes with stable markers set to False in chromosome A and gene a can be separated to form a crossover gene b. If they can, then separate those genes in chromosome A that can form gene b within a small range. If the separated genes can form gene b in chromosome B, then stop separating chromosome A. Then, combine a gene b and set the stable marker and replication marker of gene b to False. The remaining gene material after separation is combined according to steps S22 to S28 until the separated gene material is used up. If a crossover gene b cannot be formed, do nothing. Similarly, perform the same operation on chromosome B.

4. The one-dimensional feeding method based on gene evaluation genetic algorithm according to claim 1, characterized in that, The mutation operation includes: After obtaining the gene score for each gene on an individual chromosome, the gene scores are sorted from largest to smallest; the gene with the largest gene score is selected. If there are multiple genes with the same largest suml value, one of them is randomly selected; it is determined whether the selected gene meets the mutation conditions. If it meets the conditions, the mutation operation is performed; otherwise, nothing is done. The mutation conditions are as follows: First, determine if the current iteration number r is less than or equal to R / 10. If so, then determine if the suml value of the selected gene is equal to Len. If so, perform the mutation operation. If the current iteration number r is greater than R / 10, then determine if the suml value of the selected gene is greater than or equal to Lc*r*(Len / 10). If so, perform the mutation operation. Otherwise, do nothing. The gene that meets the mutation condition in the current iteration round is the gene to be mutated. The stable marker and replication marker of the gene to be mutated are both set to True. Then, all genes with stable markers of False in the individual chromosome are disassembled. Gene materials with the same elements as the gene to be mutated are selected from the disassembled gene materials and replicated. The stable marker and replication marker of the replicated gene are also set to True. This process continues until replication is no longer possible. Whether the gene to be mutated can be replicated depends on whether the disassembled gene materials can be combined to form a gene with all markers of True. If they can be combined, they can be replicated; if they cannot be combined, they cannot be replicated. The remaining gene materials are combined according to steps S22 to S28 to form new genes with both stable markers of False. This process continues until all the disassembled gene materials are used up.

5. The one-dimensional feeding method based on gene evaluation genetic algorithm according to claim 1, characterized in that, The specific process of selecting individuals for the next iteration based on their fitness values ​​and selection probabilities is as follows: The fitness values ​​are arranged from smallest to largest, and the selection probability is determined using an exponential function based on the ranking. The selection probability of the chromosome of the individual ranked i is pi, where pi = m·(1-m). i-1 i = 1, 2, ..., n, m is a constant less than 1, and individual chromosomes are selected iteratively according to the selection probability.

6. The one-dimensional feeding method based on gene evaluation genetic algorithm according to claim 1, characterized in that, The value of m is 4 / n.

Citation Information

Patent Citations

  • Novel one-dimensional layout blanking method based on genetic algorithm

    CN106934485A

  • Cloud computing resource allocation method based on improved genetic algorithm

    CN110308993A