Sponge layout algorithm based on improved genetic algorithm
Through improved genetic algorithm and Bezier curve optimization technology, the efficiency and quality problems of complex shape cutting and layout of sponge materials are solved, and efficient material utilization and production process optimization are achieved.
Patent Information
- Application Number
- CN202410801573.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-10-22
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When the existing technology handles the cutting and layout of complex shapes and diverse sponge materials, it is difficult to quickly converge to find the optimal solution, resulting in low material utilization and low production efficiency, especially in a production environment with frequent changes in demand.
Using an improved genetic algorithm, combined with multi-point crossover and mutation operations, a high-quality initial population is generated through a greedy algorithm. Fitness evaluation, population diversity evaluation and compression characteristic feedback analysis are used to dynamically adjust the mutation rate, and the Bezier curve generates smooth cuts. path to optimize cutting efficiency.
It improves the cutting and layout efficiency of sponge materials, ensures high material utilization, reduces vibration and errors of the robotic arm and laser cutting head, and improves production efficiency and product quality.
Smart Images

Figure CN118821996A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of sponge production monitoring, and more specifically to a sponge arrangement algorithm based on an improved genetic algorithm. Background Art
[0002] The processing of sponge materials involves sponge layout, which requires cutting products of the required shape and size from soft and changeable raw materials to maximize the use of materials and reduce waste. Existing cutting optimization uses standard linear programming and simple heuristic algorithms to optimize the layout, but there are limitations in adaptability and efficiency when dealing with complex shapes and in production environments where demand changes frequently. With the expansion of production scale and the increase in the diversity of product shapes, more efficient and material-saving cutting algorithms are needed. Genetic algorithms are a search algorithm that simulates the principles of natural selection and genetics. They find the optimal solution to the problem by simulating the principle of "survival of the fittest". This algorithm can be better applied to complex and changeable sponge cutting and layout requirements after specific improvement measures. However, when traditional genetic algorithms deal with diverse and irregular sponge raw materials, the irregular arrangement involves extremely complex spatial position relationships and interactions, and it is often difficult to converge quickly. Find the real optimal solution. Specifically, in the process of cutting seat cushions, circular, elliptical, L-shaped, etc. are involved. These shapes need to be placed in a specific direction to ensure the mechanical properties and appearance quality of the sponge material. When circular and elliptical shapes are arranged together, they need to be in contact along the outer edge of the shape and arranged closely to reduce waste, but they must not overlap. When the sponge used to make the seat cushion has a directional compression characteristic, the cushion surface of the seat cushion must be arranged according to this characteristic to ensure comfort and durability during use. Near the boundary of the material, the edge effect of the sponge material needs to be considered during arrangement. Complex cutting needs to be avoided on the part close to the edge to prevent damage to the material during processing. When the cutting arm and laser cutting head are used for automatic cutting, it is necessary to select an effective path with the shortest moving time and the lowest cutting difficulty based on the arrangement of the shape. How to use the improved genetic algorithm to effectively solve this problem is a difficult problem that needs to be solved urgently. Summary of the invention
[0003] In order to overcome the above-mentioned defects of the prior art, the present invention provides a sponge packing algorithm based on an improved genetic algorithm, which makes the sponge material packing more efficient by combining the improved genetic algorithm with multi-point crossover and mutation operations, and uses a greedy algorithm to generate a high-quality initial population to ensure high material utilization. Fitness evaluation, population diversity evaluation and compression characteristic feedback analysis are used to prevent falling into local optimality, dynamic mutation rate adjustment improves adaptability, and Bezier curves generate smooth cutting paths to reduce vibration and errors and optimize cutting efficiency.
[0004] To achieve the above object, the present invention provides the following technical solutions:
[0005] A sponge packing algorithm based on an improved genetic algorithm comprises the following steps:
[0006] Step 1: Initialize input data: Generate an initial population for the arrangement of seat cushion sponge raw materials. Each individual is a pattern arrangement scheme. Use a two-dimensional array to encode the position, direction, and compression characteristics of the shape. Use a specific heuristic method to determine the initial solution set.
[0007] Step 2: Fitness evaluation, population diversity evaluation, compression characteristic feedback analysis and dynamic mutation rate adjustment: Considering the material utilization rate and waste volume, the sponge raw material packing fitness of each packing scheme is obtained using the preset sponge packing fitness evaluation function, and the population diversity is analyzed using the preset population diversity evaluation formula. Based on the compression ratio of the design target and the actual measured compression ratio, the compression characteristic feedback adjustment is performed, and a comprehensive evaluation is performed;
[0008] Step 3, selection operation: based on the comprehensive evaluation results of sponge raw material sampling for each sampling scheme obtained in step 2, the tournament selection method is used to select the better individuals of the individual scheme in the population for subsequent genetic operations;
[0009] Step 4, genetic operation: for the selected individuals, use multi-point crossover and mutation operations to change the genetic structure of the individuals, and the mutation rate is dynamically adjusted according to the changes in the comprehensive evaluation results of the population;
[0010] Step 5, path optimization: Use Bezier curve to optimize the cutting path. By adjusting the middle control point, the shape of the cutting path can be accurately controlled to meet the cutting requirements of irregular sponge shapes, minimize the length of the cutting path, generate a smooth curve path, reduce the cutting vibration and error of the robot arm and laser joint, and determine a smooth and efficient cutting path.
[0011] Step 6: Population update and iteration: Update the population based on the newly generated individuals and discard individuals whose fitness is lower than the preset threshold;
[0012] Step 7, termination condition detection: Execute the improved genetic algorithm to optimize the sponge packing scheme and check whether the termination condition of the algorithm is met. The termination condition is that the maximum number of iterations is reached or the fitness improvement is less than the threshold set in advance. If the termination condition is met, proceed to the next step. If not, continue to repeat steps 2 to 6 until the termination condition is met.
[0013] Step 8, output the optimal solution: output the optimal sponge arrangement plan.
[0014] As a further solution of the present invention, in step 1, the specific heuristic method for determining the initial solution set is a greedy algorithm, and the specific process includes:
[0015] Step A1, input data preparation: record the size of the sponge material, and list in detail the shapes and sizes of all seat cushions, including the specific quantity and compression characteristics requirements for each shape;
[0016] Step A2, shape sorting: sort all seat cushion shapes by area from large to small, and arrange the shapes with large areas first. When the area difference is within 5%, consider the complexity of the shapes and arrange the more complex shapes first;
[0017] Step A3, nesting algorithm: Represent the raw material on a virtual two-dimensional plane, with all positions initially empty. Select shapes from the sorted list, starting with the largest and most complex shapes. For each selected shape, try to find a suitable position on the current nesting board so that the shape does not exceed the material boundary and does not overlap with other shapes that have been placed. Traverse each starting point of the nesting board, consider all directions, and select a direction and position that maximizes material utilization. Consider all rotation and inversion states of each shape before placement.
[0018] Step A4, Evaluate and Optimize: After all major shapes are placed, check the remaining space on the material and try to put in smaller and more irregular shapes to further optimize material utilization.
[0019] As a further solution of the present invention, in step 2, the preset sponge packing fitness evaluation function takes the difference between the material utilization rate and the adjustment impact value of the waste area as the sponge raw material packing fitness of each packing scheme, and the formula of the sponge packing fitness evaluation function is:
[0020] f fit (R used S waste )=R used -λ×S waste
[0021] Where: f fit (R used , S waste ) is the fitness function value based on material utilization and waste area, R used is the utilization rate of sponge material, which is equal to the ratio of the utilized material area to the total material area, S waste is the waste area, λ is the coefficient for adjusting the impact of the waste area, which is set according to actual production requirements.
[0022] As a further solution of the present invention, in step 2, the preset population diversity evaluation formula uses the difference between 1 and the mean of the sum of the squares of the occurrence frequencies of all specified features in the sampling scheme, and the population diversity evaluation formula is:
[0023]
[0024] Where: D t is the characteristic population diversity analysis value of each sponge sampling scheme, i is the serial number of the sponge’s specified characteristic, n is the number of specified characteristics, and p is i For the i-th sponge, specify the frequency of occurrence of the characteristic in each sponge arrangement.
[0025] As a further solution of the present invention, in step 2, based on the compression ratio of the design target and the compression ratio actually measured, the formula for feedback adjustment of the compression characteristic is:
[0026]
[0027] Where: C t is the compression characteristic adjustment value of the seat cushion sponge raw material, r descr The compression ratio of the sponge raw material for the design target, r actcr is the compression ratio of the sponge raw materials measured in actual production, and k is the adjustment coefficient, which is obtained through numerical analysis based on production test data.
[0028] As a further solution of the present invention, in step 2, the method of comprehensively evaluating each sponge raw material arrangement scheme is to use the fitness function value, characteristic population diversity analysis value, and weighted conversion value of the seat cushion sponge raw material compression characteristic adjustment value of each sponge raw material arrangement scheme. The weighted conversion formula for the comprehensive evaluation is:
[0029] Z a =ω1·f fit (R used , S waste )-ω2·D t +ω3·C t
[0030] Where: Z a is the comprehensive analysis value, ω1, ω2, ω3 are f fit (R used , S waste )、D t , C t The target weight can be adjusted according to actual needs.
[0031] As a further solution of the present invention, in step 3, the specific process of selecting the better individual of the individual solution in the population by using the competitive bidding selection method includes:
[0032] Step B1, determine the scale of the competition: select the scale of the competition to be set as m, which is the number of individuals of the sponge arrangement schemes participating in the comparison in each competition;
[0033] Step B2, randomly select contestants: randomly select m individuals from the current sponge sampling scheme population without replacement as contestants;
[0034] Step B3, comparing the comprehensive performance of each sponge arrangement scheme individual: for each tournament, based on the comprehensive analysis result in step 2, i.e., the comprehensive analysis value, compare the comprehensive performance of the m individuals participating, select the individual with a comprehensive analysis value greater than or equal to a preset threshold as the winner, and perform subsequent genetic operations on the winner scheme;
[0035] Step B4, repeat process: Repeat the above steps B1 to B3 until a sufficient number of individuals are selected for the next generation of reproduction, which is equal to the number of individuals in the population.
[0036] As a further solution of the present invention, in step 4, the specific process of dynamic adjustment is to first select two individuals from the winners selected by the tournament selection method as parents, select multiple points in the gene segments of the parents to cut and exchange the gene segments, select three designated rows as intersection points in the arrangement scheme represented by the two-dimensional array, exchange the data on these rows between the two parents, randomly select a gene site in the gene string of the individual, change the values of these points, that is, change the position and rotation angle of the designated shape in the arrangement, and then select the comprehensive analysis value as the adjustment index, calculate the new mutation rate according to the selected index, and dynamically adjust the mutation rate based on the basic mutation rate of the selected index, the performance improvement between three generations, and the ratio between the preset improvement threshold using the mutation rate dynamic adjustment formula. The mutation rate dynamic adjustment formula is:
[0037]
[0038] Where: R mut is the dynamic adjustment value of the mutation rate, R base is the basic mutation rate, obtained through experiments in the early stage of the algorithm, μ is the adjustment factor, which is set according to the specific needs of the algorithm and previous tuning experience, and changes dynamically according to the performance of the population, I i0g is the performance improvement value between the three generations, obtained by continuously comparing the highest comprehensive analysis value of the three generations of populations, I thr It is a preset improvement threshold, set based on previous test results.
[0039] As a further solution of the present invention, in step 5, the specific process of optimizing the cutting path using the Bezier curve includes:
[0040] Step 1, determine the control points: According to the sponge arrangement plan, determine the starting point and end point of the cutting path of each seat cushion, the starting point is P0, the end point is P3, and select 2 intermediate control points, the intermediate control points are P1 and P2;
[0041] Step 2, calculate the Bezier curve: use the cubic Bezier curve formula to generate a complete cutting path, optimize the control points P1 and P2, and ensure the path is smooth and shortest;
[0042] Step 3, simulate the cutting path on the simulation platform: use simulation software to simulate the cutting path in a virtual environment, verify its feasibility and efficiency, and further adjust the control points of the Bezier curve according to the simulation results.
[0043] As a further solution of the present invention, in step 2, the cubic Bezier curve formula is:
[0044] Bézier(t)=(1-t) 3 P0+3(1-t) 2 tP1+3(1-t)t 2 P2+t 3 P3
[0045] Where: Bézier(t) is the generated cubic Bezier curve, and t is a value between 0 and 1.
[0046] The technical effects of the present invention compared with the prior art are as follows: the present invention makes the arrangement of sponge materials more efficient through the combination of an improved genetic algorithm with multi-point crossover and mutation operations, generates a high-quality initial population through a greedy algorithm, ensures a high material utilization rate from the beginning, and can evaluate the fitness, diversity and compression characteristic feedback adjustment analysis data of the population in real time through a fitness evaluation function, a population diversity evaluation formula, a compression characteristic feedback analysis and a comprehensive analysis formula to prevent the algorithm from falling into a local optimum, and ensures that high adaptability and search efficiency can be maintained at different stages in combination with dynamic mutation rate adjustment, and generates a smooth cutting path using a Bezier curve, which reduces the vibration and error of the robot arm and the laser cutting head during the cutting process, minimizes the cutting time and the cutting path, and improves the production efficiency of sponge cutting after arrangement. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 It is the algorithm flow chart of the present invention. DETAILED DESCRIPTION
[0048] The following will be combined with the drawings in the present invention to clearly and completely describe the technical solutions in the present invention. Obviously, the described technical solutions are only part of the present invention, not all of it. Based on the content of the present invention, all other technical solutions obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0049] In the sponge patterning of seat cushions, there are high requirements for material utilization, cutting accuracy and final product quality. Seat cushions have complex shapes (circular, oval, L-shaped and other irregular shapes) to meet different design and ergonomic requirements, and the patterning of these shapes is more complicated, requiring precise cutting paths. At the same time, the sponge material is soft and easy to deform. During the cutting process, it is easily affected by the vibration and extrusion of the robot arm and the laser cutting head, resulting in uneven cutting edges and material waste. In the sponge material of the seat cushion, specific compression characteristics are required to ensure proper support and comfort during use. The compression characteristics of the material need to be considered during the patterning process so that the various parts after cutting perform consistently during use.
[0050] Regarding the above content, Figure 1 As shown, the present invention proposes a sponge packing algorithm based on an improved genetic algorithm, comprising the following steps:
[0051] Step 1: Initialize input data: Generate an initial population for the arrangement of seat cushion sponge raw materials. Each individual is a pattern arrangement scheme. Use a two-dimensional array to encode the position, direction, and compression characteristics of the shape. Use a specific heuristic method to determine the initial solution set.
[0052] Step 2: Fitness evaluation, population diversity evaluation, compression characteristic feedback analysis and dynamic mutation rate adjustment: Considering the material utilization rate and waste volume, the sponge raw material packing fitness of each packing scheme is obtained using the preset sponge packing fitness evaluation function, and the population diversity is analyzed using the preset population diversity evaluation formula. Based on the compression ratio of the design target and the actual measured compression ratio, the compression characteristic feedback adjustment is performed, and a comprehensive evaluation is performed;
[0053] Step 3, selection operation: based on the comprehensive evaluation results of sponge raw material sampling for each sampling scheme obtained in step 2, the tournament selection method is used to select the better individuals of the individual scheme in the population for subsequent genetic operations;
[0054] Step 4, genetic operation: for the selected individuals, use multi-point crossover and mutation operations to change the genetic structure of the individuals, and the mutation rate is dynamically adjusted according to the changes in the comprehensive evaluation results of the population;
[0055] Step 5, path optimization: Use Bezier curve to optimize the cutting path. By adjusting the middle control point, the shape of the cutting path can be accurately controlled to meet the cutting requirements of irregular sponge shapes, minimize the length of the cutting path, generate a smooth curve path, reduce the cutting vibration and error of the robot arm and laser joint, and determine a smooth and efficient cutting path.
[0056] Step 6: Population update and iteration: Update the population based on the newly generated individuals and discard individuals whose fitness is lower than the preset threshold;
[0057] Step 7, termination condition detection: Execute the improved genetic algorithm to optimize the sponge packing scheme and check whether the termination condition of the algorithm is met. The termination condition is that the maximum number of iterations is reached or the fitness improvement is less than the threshold set in advance. If the termination condition is met, proceed to the next step. If not, continue to repeat steps 2 to 6 until the termination condition is met.
[0058] Step 8, output the optimal solution: output the optimal sponge arrangement plan.
[0059] Use the greedy algorithm to initialize the solution set to ensure that the initial population has a high material utilization rate; the comprehensive evaluation function combines material utilization and waste volume to continuously optimize the nesting plan, maximizing material utilization to directly reduce production costs and reduce material waste; use the Bezier curve to optimize the cutting path, generate a smooth cutting path, reduce the vibration and error of the robot arm and laser cutting head during the cutting process, and the precise cutting reduces material waste and defective products caused by uneven edges, thereby improving product quality; the genetic algorithm combines multi-point crossover and mutation operations to dynamically adjust the mutation rate to ensure efficient arrangement of complex shapes in the nesting, adapt to various complex shapes of seat cushions, and meet design and ergonomic requirements; feedback adjustment is performed based on the design goals and the actual measured compression ratio to ensure that each nesting plan meets the specific The algorithm meets certain compression characteristics requirements to ensure that the cut sponge material has consistent compression characteristics when used, providing appropriate support and comfort; dynamically adjust the mutation rate, and adjust it according to the comprehensive evaluation results and improvement range of the population to ensure that the algorithm maintains the best state at different stages, adapts to changes in production needs, and maintains the efficient operation of the algorithm in different production environments; the population diversity evaluation formula monitors population diversity in real time, maintains the extensive search ability of the population through a dynamic adjustment mechanism, prevents the algorithm from converging to the local optimum too early, and increases the possibility of finding the global optimal solution; the automated operation of the genetic algorithm and the optimization algorithm, from the initial solution set generation, fitness evaluation, selection operation to the final output of the optimal solution, are all automatically completed by the algorithm, reducing manual intervention and improving production efficiency and consistency. The comprehensive evaluation function comprehensively considers material utilization, waste volume, population diversity and compression characteristics to provide a fully optimized layout solution.
[0060] It should be noted that in step 1, the specific heuristic method for determining the initial solution set is a greedy algorithm, and the specific process includes:
[0061] Step A1, input data preparation: record the size of the sponge material, and list in detail the shapes and sizes of all seat cushions, including the specific quantity and compression characteristics requirements for each shape;
[0062] Step A2, shape sorting: sort all seat cushion shapes by area from large to small, and arrange the shapes with large areas first. When the area difference is within 5%, consider the complexity of the shapes and arrange the more complex shapes first;
[0063] Step A3, nesting algorithm: Represent the raw material on a virtual two-dimensional plane, with all positions initially empty. Select shapes from the sorted list, starting with the largest and most complex shapes. For each selected shape, try to find a suitable position on the current nesting board so that the shape does not exceed the material boundary and does not overlap with other shapes that have been placed. Traverse each starting point of the nesting board, consider all directions, and select a direction and position that maximizes material utilization. Consider all rotation and inversion states of each shape before placement.
[0064] Step A4, Evaluate and Optimize: After all major shapes are placed, check the remaining space on the material and try to put in smaller and more irregular shapes to further optimize material utilization.
[0065] At the beginning of the genetic algorithm, a set of high-quality initial solutions is provided to ensure that the algorithm can optimize at a higher starting point, shorten the convergence time and improve the optimization efficiency; give priority to seat cushions with large areas and complex shapes, so that these shapes can be reasonably arranged at the material boundaries and large gaps, and small fragments and irregular corners that are difficult to utilize during the nesting process can be reduced; through reasonable shape sorting and optimized nesting, material waste can be minimized, material utilization efficiency can be improved, and production costs can be reduced. The greedy algorithm is used to reasonably sort and arrange shapes, maximize material utilization, reduce waste, save production costs, and reasonably arrange large areas and complex shapes in the initial stage to reduce small fragments and corners that are difficult to handle in the subsequent optimization process, thereby reducing material waste. The greedy algorithm provides a fast and effective solution in the initial layout, provides a high-quality initial population for the genetic algorithm, makes subsequent optimization more efficient, and shortens the convergence time. By considering the rotation and inversion state of the shape, it ensures that the position and direction of each shape are optimal when placed, reduces cutting errors, ensures cutting accuracy, and improves the quality of the final product. Priority is given to large areas and complex shapes to ensure that these shapes can be reasonably arranged in the material, reduce difficult-to-use gaps caused by complex shapes, and improve the overall efficiency of the layout. By considering the specific quantity and compression characteristics of each shape, it ensures that the layout plan is not only optimal in material utilization, but also meets product design and functional requirements, and flexibly responds to diverse production needs.
[0066] It should be noted that in step 2, the preset sponge packing fitness evaluation function takes the difference between the material utilization rate and the adjustment impact value of the waste area as the sponge raw material packing fitness of each packing scheme, and the formula of the sponge packing fitness evaluation function is:
[0067] f fit (R used S waste )=R used -λ×Swaste
[0068] Where: f fit (R used , S waste ) is the fitness function value based on material utilization and waste area, R used is the utilization rate of sponge material, which is equal to the ratio of the utilized material area to the total material area, S waste is the waste area, λ is the coefficient for adjusting the impact of the waste area, which is set according to actual production requirements.
[0069] The fitness function takes into account both material utilization and waste volume, providing a comprehensive evaluation index that helps balance the two during the optimization process and avoids simply pursuing a certain index while ignoring the overall optimization goal. Under different production environments and requirements, the tolerance for waste is different. By adjusting the λ value, these requirements can be dynamically adapted in the algorithm to ensure that the layout plan meets the actual production requirements. The fitness function value f fit (R used , Swaste ) is used as the optimization goal of the genetic algorithm to guide the algorithm to continuously select and generate high-fitness solutions during the evolution process, and finally output a scheduling solution with higher overall quality. It provides clear evaluation criteria for each solution, so that the genetic algorithm can more effectively screen out high-quality solutions during the selection and crossover process and speed up the optimization process.
[0070] It should be noted that in step 2, the preset population diversity evaluation formula uses the difference between 1 and the mean of the sum of the squares of the occurrence frequencies of all specified features in the sampling scheme. The population diversity evaluation formula is:
[0071]
[0072] Where: D t is the characteristic population diversity analysis value of each sponge sampling scheme, i is the serial number of the sponge’s specified characteristic, n is the number of specified characteristics, and p is i For the i-th sponge, specify the frequency of occurrence of the characteristic in each sponge arrangement.
[0073] Diversity Assessment Formula D t By measuring the distribution of characteristic frequencies, we can ensure the diversity of different sampling schemes in the population, thereby increasing the robustness and effectiveness of the algorithm. Population diversity is an important guarantee for genetic algorithms to avoid premature convergence and fall into local optimality. By evaluating and maintaining population diversity, we can ensure that the algorithm searches in a wider solution space and increase the possibility of finding the global optimal solution. Premature convergence to the local optimal solution is a common problem of genetic algorithms. Evaluating and maintaining population diversity can effectively avoid this problem. The diversity evaluation formula D tIt helps detect the reduction of population diversity, triggers the adjustment of mutation rate or other operations, maintains population diversity, avoids premature convergence, and helps generate more innovative solutions, thereby discovering new and better sampling schemes.
[0074] It should be noted that in step 2, based on the design target compression ratio and the actual measured compression ratio, the formula for adjusting the compression characteristic feedback is:
[0075]
[0076] Where: C t is the compression characteristic adjustment value of the seat cushion sponge raw material, r descr The compression ratio of the sponge raw material for the design target, r actcr is the compression ratio of the sponge raw materials measured in actual production, and k is the adjustment coefficient, which is obtained through numerical analysis based on production test data.
[0077] Ensure that each seat cushion produced has consistent compression characteristics during use, providing stable support and comfort. By comparing the compression ratio of the design target and the actual measured compression ratio, calculate the compression characteristic adjustment value, and dynamically adjust the layout plan so that the sponge material after cutting meets the expected compression characteristics; consistent product quality improves customer satisfaction and ensures that each product can meet the expectations and needs of users. Through the feedback adjustment mechanism, ensure that the compression characteristics of each production batch of seat cushions are consistent, improve product reliability and user experience; optimize the production process through real-time feedback and adjustment, reduce the production of defective products, reduce rework and material waste, dynamically adjust the layout plan and cutting parameters, and timely discover and correct deviations based on the actual measured compression characteristics to ensure stability and consistency in the production process, so that the production process can adapt to the variation of materials in different batches and ensure the consistency and high quality of the final product; calculate and apply C according to the actual measured compression characteristics. t The value is adjusted through feedback, so that the layout plan and cutting path can adapt to the actual situation of the material, enhance the flexibility and adaptability of the production process, and optimize based on actual data to make the production process more scientific and efficient; using production test data, the adjustment coefficient κ is determined through numerical analysis to ensure that the adjustment value C t The scientificity and effectiveness of the process will improve the accuracy and reliability of production optimization.
[0078] It should be noted that in step 2, the method for comprehensively evaluating each sponge raw material arrangement scheme is to use the fitness function value, characteristic population diversity analysis value, and weighted conversion value of the compression characteristic adjustment value of the seat cushion sponge raw material of each sponge raw material arrangement scheme. The weighted conversion formula for the comprehensive evaluation is:
[0079] Z a =ω1·f fit(R used , S waste )-ω2·D t +ω3·C t
[0080] Where: Z a is the comprehensive analysis value, ω1, ω2, ω3 are f fit (R used , S waste )、D t , C t The target weight can be adjusted according to actual needs.
[0081] The comprehensive evaluation formula combines different objectives to ensure that the optimization scheme performs well in all aspects, rather than simply optimizing a single objective. By simultaneously considering material utilization, waste area, population diversity and compression characteristic adjustment values, a comprehensive evaluation standard is provided to make the optimization process more comprehensive and balanced. According to current production goals and needs, the weights can be dynamically adjusted to strengthen the optimization of a specific goal and ensure that the scheme best meets actual production needs. By adjusting the weights ω1, ω2, and ω3, the focus of optimization can be flexibly adjusted according to actual needs to adapt to different production needs and strategies, quickly screen out individuals with high fitness, accelerate the population evolution process, and improve the overall optimization efficiency. It can identify high-quality solutions more quickly, improve the convergence efficiency of the genetic algorithm, reduce the computing time and resource consumption in the optimization process, make the algorithm more robust, and reduce the instability of optimization results caused by excessive concentration on a certain goal.
[0082] It should be noted that in step 3, the specific process of selecting the better individual among the individual solutions in the population using the competitive bidding selection method includes:
[0083] Step B1, determine the scale of the competition: select the required tournament scale as m, which is the number of individuals of the sponge arrangement schemes participating in the comparison in each competition. Set an appropriate scale of the competition to balance the selection pressure and ensure that the algorithm effectively selects high-quality individuals while maintaining the diversity of the population;
[0084] Step B2, randomly select contestants: randomly select m individuals from the current sponge sampling scheme population as contestants without replacement. Sampling without replacement ensures that each individual can only participate in the competition once, which increases the randomness of the selection, prevents individuals from being selected repeatedly, and maintains the diversity of the population;
[0085] Step B3, comparing the comprehensive performance of individuals in each sponge arrangement scheme: for each tournament, based on the comprehensive analysis result in step 2, i.e., the comprehensive analysis value, compare the comprehensive performance of the m individuals participating, select the individual with a comprehensive analysis value greater than or equal to a preset threshold as the winner, and perform subsequent genetic operations on the winner scheme. By comparing the comprehensive analysis values, ensure that the selected individuals perform well in multiple evaluation indicators, thereby improving the overall quality of the population and the optimization effect;
[0086] Step B4, repeat process: Repeat the above steps B1 to B3 until a sufficient number of individuals are selected for the next generation of reproduction. This number is equal to the number of individuals in the population. Repeat the bidding selection to ensure that each generation of the population contains high-quality individuals, promote the population to evolve towards a better solution, and accelerate the convergence of the algorithm.
[0087] It should be noted that in step 4, the specific process of dynamic adjustment is to first select two individuals from the winners selected by the tournament selection method as parents, select multiple points in the gene segments of the parents to cut and exchange the gene segments, select the specified three rows as intersection points in the arrangement scheme represented by the two-dimensional array, exchange the data on these rows between the two parents, randomly select a gene site in the gene string of the individual, change the values of these points, that is, change the position and rotation angle of the specified shape in the arrangement, and then select the comprehensive analysis value as the adjustment index, calculate the new mutation rate according to the selected index, and use the mutation rate dynamic adjustment formula to dynamically adjust the mutation rate based on the basic mutation rate of the selected indicator, the performance improvement between three generations, and the ratio between the preset improvement threshold. The mutation rate dynamic adjustment formula is:
[0088]
[0089] Where: R mut is the dynamic adjustment value of the mutation rate, R base is the basic mutation rate, obtained through experiments in the early stage of the algorithm, μ is the adjustment factor, which is set according to the specific needs of the algorithm and previous tuning experience, and changes dynamically according to the performance of the population, I i0g is the performance improvement value between the three generations, obtained by continuously comparing the highest comprehensive analysis value of the three generations of populations, I thr It is a preset improvement threshold, set based on previous test results.
[0090] By selecting individuals with better performance as parents, we ensure that the basic quality of genetic operations is high and improve the overall fitness of offspring individuals; multi-point crossover can produce more diverse offspring, improve the diversity of the population, and increase the chances of finding high-quality solutions; introduce new gene combinations through mutation operations to further increase the diversity of the population and prevent the algorithm from falling into local optimality; dynamically adjust the mutation rate so that the algorithm can flexibly adjust the mutation rate according to the performance status of the current population, thereby improving the adaptability and efficiency of the optimization process.
[0091] It should be noted that in step 5, the specific process of using the Bezier curve to optimize the cutting path includes:
[0092] Step 1, determine the control points: According to the sponge arrangement plan, determine the starting point and end point of the cutting path of each seat cushion, the starting point is P0, the end point is P3, and select 2 intermediate control points, the intermediate control points are P1 and P2;
[0093] Step 2, calculate the Bezier curve: use the cubic Bezier curve formula to generate a complete cutting path, optimize the control points P1 and P2, and ensure the path is smooth and shortest;
[0094] Step 3, simulate the cutting path on the simulation platform: use simulation software to simulate the cutting path in a virtual environment, verify its feasibility and efficiency, and further adjust the control points of the Bezier curve according to the simulation results.
[0095] Smooth cutting paths reduce vibration and errors caused by the robot arm and laser cutting head during the cutting process, ensuring the neatness and quality of the cutting edge; the shortest path reduces cutting time, improves production efficiency, and reduces cutting costs; simulating the cutting path on the simulation platform can detect and solve potential problems in advance to ensure the smooth progress of the actual cutting process; smooth and accurate cutting paths reduce material waste, improve material utilization, and reduce production costs; optimized cutting paths reduce the number and time of movements of the robot arm and laser cutting head, improving production efficiency; by adjusting the control points of the Bezier curve, it can flexibly respond to different shapes and layout requirements to ensure the best effect of the cutting path. Common simulation platforms include but are not limited to computer-aided design software (CAD), computer-aided manufacturing software (CAM), and specialized cutting path simulation tools (ArtCAM, Rhino, VCarve).
[0096] It should be noted that in step 2, the cubic Bezier curve formula is:
[0097] Bézier(t)=(1-t) 3 P0+3(1-t) 2 tP1+3(1-t)t 2 P2+t 3 P3
[0098] Where: Bézier(t) is the generated cubic Bezier curve, and t is a value between 0 and 1.
[0099] t is a parameter that gradually changes from 0 to 1 and is used to generate points at different positions on the Bezier curve. (t) is calculated by the weight coefficient (1-t) 3 、3(1-t) 2 t, 3(1-t)t2 ,t 3 Control the influence of each control point on the generated curve. The continuous change of tt ensures the smoothness and continuity of the Bezier curve. The generated curve is smooth and continuous without breakpoints or mutations. This feature is very important for the optimization of the cutting path. It can reduce mechanical vibration and errors during the cutting process. On the simulation platform, by continuously changing the value of t, animation effects or progressive cutting on the path can be achieved. The process of the robot arm or laser cutting head moving along the Bezier curve can be dynamically displayed, which helps to intuitively understand and optimize the cutting path.
[0100] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0101] Finally: The above description is only the preferred technical solution of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A sponge packing algorithm based on an improved genetic algorithm, characterized in that: The steps include: Step 1: Initialize input data: Generate an initial population for the arrangement of seat cushion sponge raw materials. Each individual is a pattern arrangement scheme. Use a two-dimensional array to encode the position, direction, and compression characteristics of the shape. Use a specific heuristic method to determine the initial solution set. Step 2: Fitness evaluation, population diversity evaluation, compression characteristic feedback analysis and dynamic mutation rate adjustment: Considering the material utilization rate and waste volume, the sponge raw material packing fitness of each packing scheme is obtained using the preset sponge packing fitness evaluation function, and the population diversity is analyzed using the preset population diversity evaluation formula. Based on the compression ratio of the design target and the actual measured compression ratio, the compression characteristic feedback adjustment is performed, and a comprehensive evaluation is performed; Step 3, selection operation: based on the comprehensive evaluation results of sponge raw material sampling for each sampling scheme obtained in step 2, the tournament selection method is used to select the better individuals of the individual scheme in the population for subsequent genetic operations; Step 4, genetic operation: for the selected individuals, use multi-point crossover and mutation operations to change the genetic structure of the individuals, and the mutation rate is dynamically adjusted according to the changes in the comprehensive evaluation results of the population; Step 5, path optimization: Use Bezier curve to optimize the cutting path. By adjusting the middle control point, the shape of the cutting path can be accurately controlled to meet the cutting requirements of irregular sponge shapes, minimize the length of the cutting path, generate a smooth curve path, reduce the cutting vibration and error of the robot arm and laser joint, and determine a smooth and efficient cutting path. Step 6: Population update and iteration: Update the population based on the newly generated individuals and discard individuals whose fitness is lower than the preset threshold; Step 7, termination condition detection: Execute the improved genetic algorithm to optimize the sponge packing scheme and check whether the termination condition of the algorithm is met. The termination condition is that the maximum number of iterations is reached or the fitness improvement is less than the threshold set in advance. If the termination condition is met, proceed to the next step. If not, continue to repeat steps 2 to 6 until the termination condition is met. Step 8, output the optimal solution: output the optimal sponge arrangement plan.
2. The sponge packing algorithm based on an improved genetic algorithm according to claim 1, characterized in that: In step 1, the specific heuristic method for determining the initial solution set is a greedy algorithm. The specific process includes: Step A1, input data preparation: record the size of the sponge material, and list in detail the shapes and sizes of all seat cushions, including the specific quantity and compression characteristics requirements for each shape; Step A2, shape sorting: sort all seat cushion shapes by area from large to small, and arrange the shapes with large areas first. When the area difference is within 5%, consider the complexity of the shapes and arrange the more complex shapes first; Step A3, nesting algorithm: Represent the raw material on a virtual two-dimensional plane, with all positions initially empty. Select shapes from the sorted list, starting with the largest and most complex shapes. For each selected shape, try to find a suitable position on the current nesting board so that the shape does not exceed the material boundary and does not overlap with other shapes that have been placed. Traverse each starting point of the nesting board, consider all directions, and select a direction and position that maximizes material utilization. Consider all rotation and inversion states of each shape before placement. Step A4, Evaluate and Optimize: After all major shapes are placed, check the remaining space on the material and try to put in smaller and more irregular shapes to further optimize material utilization.
3. The sponge packing algorithm based on improved genetic algorithm according to claim 1, characterized in that: In step 2, the preset sponge packing fitness evaluation function takes the difference between the material utilization rate and the adjustment impact value of the waste area as the sponge raw material packing fitness of each packing scheme. The formula of the sponge packing fitness evaluation function is: f fit (R used S waste )=R used -×S waste Where: f fit (R used ,S waste ) is the fitness function value based on material utilization and waste area, R used is the utilization rate of sponge material, which is equal to the ratio of the utilized material area to the total material area, S waste is the waste area, λ is the coefficient for adjusting the impact of the waste area, which is set according to actual production requirements.
4. The sponge packing algorithm based on improved genetic algorithm according to claim 3 is characterized in that: In step 2, the preset population diversity evaluation formula uses the difference between 1 and the mean of the sum of the squares of the occurrence frequencies of all specified features in the sampling scheme. The population diversity evaluation formula is: Where: D t is the characteristic population diversity analysis value of each sponge sampling scheme, i is the serial number of the sponge’s specified characteristic, n is the number of specified characteristics, and p i For the i-th sponge, specify the frequency of occurrence of the characteristic in each sponge arrangement.
5. The sponge packing algorithm based on improved genetic algorithm according to claim 4 is characterized in that: In step 2, based on the design target compression ratio and the actual measured compression ratio, the formula for compression characteristic feedback adjustment is: Where: C t is the compression characteristic adjustment value of the seat cushion sponge raw material, r descr The compression ratio of the sponge raw material for the design target, r actcr is the compression ratio of the sponge raw materials measured in actual production, and κ is the adjustment coefficient, which is obtained through numerical analysis based on production test data.
6. The sponge packing algorithm based on improved genetic algorithm according to claim 5, characterized in that: In step 2, the method of comprehensively evaluating each sponge raw material arrangement scheme is to use the fitness function value, characteristic population diversity analysis value, and weighted conversion value of the compression characteristic adjustment value of the seat cushion sponge raw material of each sponge raw material arrangement scheme. The weighted conversion formula for the comprehensive evaluation is: Z a =ω1·f fit (R used ,S waste )-ω2·D t +ω3·C t Where: Z a is the comprehensive analysis value, ω1, ω2, ω3 are f fit (R used ,S waste )、D t , C t The target weight can be adjusted according to actual needs.
7. The sponge packing algorithm based on improved genetic algorithm according to claim 6, characterized in that: In step 3, the specific process of selecting the better individual among the individual solutions in the population by using the competitive bidding selection method includes: Step B1, determine the scale of the competition: select the scale of the competition to be set as m, which is the number of individuals of the sponge arrangement schemes participating in the comparison in each competition; Step B2, randomly select contestants: randomly select m individuals from the current sponge sampling scheme population without replacement as contestants; Step B3, comparing the comprehensive performance of each sponge arrangement scheme individual: for each tournament, based on the comprehensive analysis result in step 2, i.e., the comprehensive analysis value, compare the comprehensive performance of the m individuals participating, select the individual with a comprehensive analysis value greater than or equal to a preset threshold as the winner, and perform subsequent genetic operations on the winner scheme; Step B4, repeat process: Repeat the above steps B1 to B3 until a sufficient number of individuals are selected for the next generation of reproduction, which is equal to the number of individuals in the population.
8. The sponge packing algorithm based on improved genetic algorithm according to claim 7, characterized in that: In step 4, the specific process of dynamic adjustment is to first select two individuals from the winners selected by the tournament selection method as parents, select multiple points in the gene segments of the parents to cut and exchange the gene segments, select the specified three rows as intersection points in the arrangement scheme represented by the two-dimensional array, exchange the data on these rows between the two parents, randomly select a gene site in the gene string of the individual, change the values of these points, that is, change the position and rotation angle of the specified shape in the arrangement, and then select the comprehensive analysis value as the adjustment index, calculate the new mutation rate according to the selected index, and use the mutation rate dynamic adjustment formula to dynamically adjust the mutation rate based on the basic mutation rate of the selected index, the performance improvement between three generations, and the ratio between the preset improvement threshold. The mutation rate dynamic adjustment formula is: Where: R mut is the dynamic adjustment value of the mutation rate, R base is the basic mutation rate, obtained by experiment in the early stage of the algorithm, μ is the adjustment factor, which is set according to the specific needs of the algorithm and previous tuning experience, and changes dynamically according to the performance of the population, I iog is the performance improvement value between the three generations, obtained by continuously comparing the highest comprehensive analysis value of the three generations of populations, I thr It is a preset improvement threshold, set based on previous test results.
9. The sponge packing algorithm based on improved genetic algorithm according to claim 8, characterized in that: In step 5, the specific process of using Bezier curve to optimize the cutting path includes: Step 1, determine the control points: According to the sponge arrangement plan, determine the starting point and end point of the cutting path of each seat cushion, the starting point is P0, the end point is P3, and select 2 intermediate control points, the intermediate control points are P1 and P2; Step 2, calculate the Bezier curve: use the cubic Bezier curve formula to generate a complete cutting path, optimize the control points P1 and P2, and ensure the path is smooth and shortest; Step 3, simulate the cutting path on the simulation platform: use simulation software to simulate the cutting path in a virtual environment, verify its feasibility and efficiency, and further adjust the control points of the Bezier curve according to the simulation results.
10. The sponge packing algorithm based on improved genetic algorithm according to claim 9, characterized in that: In step 2, the cubic Bezier curve formula is: Bézier(t)=(1-t) 3 P0+3(1-t) 2 tP1+3(1-0)t 2 P2+t 3 P3 Where: Bézier(t) is the generated cubic Bezier curve, and t is a value between 0 and 1.
Citation Information
Cited By
Dam seepage prediction method based on improved long-short term memory deep learning model
CN119646935A
Ultra-precision laser cutting path optimization method and system
CN120502887A
Dynamic planning method and device for air-ground cooperative end distribution, and medium
CN120688967A
Fabric typesetting optimization method and device
CN120705928A
Two-dimensional layout and cutting path combination method and system based on digital twinning
CN120974736A
