Two-dimensional rectangular piece discharging method for improving simulated annealing algorithm
By improving the simulated annealing algorithm and combining adaptive and greedy algorithms, the problem of difficult balance between plate use, number of cutting plans and running time in the existing technology is solved, and a fast convergence and efficient two-dimensional rectangular part nesting method is achieved, which is suitable for Factory production.
Patent Information
- Application Number
- CN202410629430.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-21
- Publication Date
- 2024-09-20
Smart Images

Figure CN118674091A
Abstract
Description
Technical Field
[0001] The present application relates to the field of rectangular piece nesting, and in particular to a two-dimensional rectangular piece nesting method using an improved simulated annealing algorithm. Background Art
[0002] The two-dimensional rectangular parts arrangement problem is a common optimization problem that occurs in many practical applications, such as sheet metal cutting, wood cutting, glass cutting, etc. The goal of this problem is to arrange as many two-dimensional rectangular sub-parts as possible on a given two-dimensional motherboard to maximize utilization and reduce material waste.
[0003] This type of problem can be described from a mathematical point of view: Now we need M blanks, with width and length w respectively. i ,l i (i=1,2,3...M), the required order quantities are c i (i=1,2,3...M), the width and length of the plate are W and L respectively. Assuming that the overall solution consists of N kinds of layout solutions, x j (j=1,2,3...N) is the number of times the j-th arrangement scheme is used, a ij (i=1,2,3...M;j=1,2,3...N) is the number of times the i-th blank is used in the j-th layout scheme. The mathematical model for this type of problem is as follows:
[0004]
[0005] A good two-dimensional rectangular parts layout plan must meet the requirements of using as few plates as possible while ensuring that the types of cutting plans are as few as possible. However, the above mathematical model only ensures that the number of plates used is as small as possible. However, this patent can greatly reduce the number of cutting plans while ensuring that the number of raw material plates used remains unchanged. It is difficult for the existing technology to find a balance between the number of consumed plates, the number of layout plans, and the running time. It often takes into account two or one of the three while ignoring the other points.
[0006] Therefore, the purpose of this application is to propose a two-dimensional rectangular parts nesting method with an improved simulated annealing algorithm to solve the above problems. Summary of the invention
[0007] In order to overcome the above technical problems, the purpose of the present invention is to provide a two-dimensional rectangular piece nesting method with an improved simulated annealing algorithm. Compared with the existing technology, the number of nesting schemes is reduced when the same number of plates are consumed. The present invention also adopts an adaptive algorithm design idea, which can converge quickly compared with traditional simulated annealing. In the normal time when the three factors are taken into consideration, the lack of the lack of the good is achieved, and the good is better. The purpose of the present invention can be achieved through the following technical solutions:
[0008] The present application provides a two-dimensional rectangular parts nesting method using an improved simulated annealing algorithm, wherein the blank number is selected based on the Metropoli criterion, and the method comprises the following steps:
[0009] Step 1: Number the blanks to be produced, and number them 1, 2, 3...M according to their models. Blanks with two widths and lengths that are the same or whose length is equal to another width and whose width is equal to another length are considered to have the same number;
[0010] Step 2: Generate a suitable fitIndex array according to the width and length of the current plate, which stores the blank numbers that can be cut from the current plate, to prevent meaningless search calculations and speed up the convergence of the algorithm;
[0011] Step 3: Randomly extract a blank number that can be cut from fitIndex;
[0012] Step 4: Define the fitness function func, its value is Among them, UsedArea represents the area of the blank with the current number, TotalArea represents the total area of the current plate, and the value of func represents the ratio of waste;
[0013] Step 5: Set the initial value minVal of the func function to 1, so that the blank number minIndex with the smallest func function value is 0;
[0014] Step 6: If the new objective function takes the value Y - If it is less than the current value minVal, update If the new objective function takes the value Y - If it is greater than the current value minVal, the suboptimal solution is accepted with a certain probability according to the Metropoli criterion; the probability function is set to Where i is the number of loops. This probability function ensures that the value gradually decreases as the algorithm progresses, making it more difficult to obtain a suboptimal solution, thereby retaining the better solutions that have been searched. A random decimal is taken between 0 and 1. If this decimal is less than the current probability function value, an update is performed. Otherwise, keep the existing solution;
[0015] Step 7: Replace the length of the Markov chain in the traditional simulated annealing algorithm with 100*M, and adaptively traverse the number of times according to the order, so as to reduce the search time while maintaining the search performance. After the traversal is completed, a final blank number minIndex is returned.
[0016] Further, the selected blank is cut from the current plate, including the following steps:
[0017] Step 1: First, standardize the shapes of the blank and the plate. Both the blank and the plate must meet the requirement that the length is greater than or equal to the width, otherwise they must be rotated to meet this condition;
[0018] Step 2: After step 1 is completed, there are four situations for cutting the blank on the board;
[0019] Step 3: Each time the current plate is cut into a corresponding blank, two new plates will be recursively generated. These two new plates are called Raw1 and Raw2. For the choice between X-cut and Y-cut in the horizontal direction, a judge function is defined to judge the impact of the current cutting on the subsequent cutting. If a plate Raw can cut a blank under the current order quantity, the function takes the value of 1, otherwise it takes the value of 0. The value of judge(Raw1)+judge(Raw2) after X-cut is calculated, and then the value of judge(Raw1)+judge(Raw2) after Y-cut is calculated. If the former is greater than the latter, X-cut is performed; if the former is less than the latter, Y-cut is performed. Through cutter; if the two are equal, randomly select one from X through cutter and Y through cutter, and choose whether to rotate the blank longitudinally, until after step one, the blank and the plate both meet the condition that the length is greater than or equal to the width. Therefore, if the blank meets condition three or condition four after rotation, then it can definitely be converted into condition one or condition two for cutting, and vice versa. Therefore, it is necessary to give priority to the cutting of condition three and condition four, and at the same time, there is a certain probability to select condition one and condition two for cutting. When condition three and condition four cannot be realized, directly select from condition one and condition two. Through the above double selection, a unique cutting scheme can be determined on the current plate, and then the two new sub-plates generated by cutting are added to the candidate queue;
[0020] Step 4: Among the sub-plates generated above, waste will inevitably be generated, that is, under the current order quantity conditions, it is no longer possible to cut out the blank plate. Therefore, the waste plate must be deleted after each cutting to ensure that the plates in the candidate queue can be used normally.
[0021] Further, generating a blank layout plan on a whole plate includes the following steps:
[0022] Step 1: Initialize the current plate to be a whole plate required for actual production, record its total area TotalArea, and product UsedArea = 0;
[0023] Step 2: Set the initial temperature T s for End temperature T e for Temperature decay rate α = 0.98, and the gradual cooling process begins;
[0024] Step 3: Each time the temperature decreases, a blank is found from the previous process 1 or 2, and a cutting scheme is selected for cutting. After the cutting of the blank is completed, the corresponding blank order quantity is reduced by one;
[0025] Step 4: After each cutting is completed, the cut rough surface is accumulated and added to the UsedArea;
[0026] Step 5: Record the required quantity of each numbered blank into the layout plan Solution;
[0027] Step 6: When all sub-sheets on the initial sheet have become waste and cannot be cut further, or the current order quantity has been completed, there is no need to continue cooling down, and the loop is directly exited to speed up the algorithm convergence time;
[0028] Step 7: Calculate the utilization rate of this sample arrangement solution And put the current nesting plan into a nesting plan set Solutions.
[0029] Further, all possible layout plans under the current order quantity limit are generated, including the following steps:
[0030] S1: Initialize the current order quantity, that is, how many blanks of various numbers are left;
[0031] S2: Generate a layout solution on a plate and record it in the set Solutions;
[0032] S3: until the current order is completed, that is, the number of blank orders for each number is 0, otherwise repeat S1 and S2;
[0033] S4: Select the arrangement plan with the highest utilization rate from the arrangement plan set Solutions.
[0034] Further, a complete set of layout plans is obtained, and the quantity to be produced for each layout plan is calculated respectively, including the following steps:
[0035] Step A: Initialize the order quantity, that is, the number of blanks with various numbers that need to be produced in this batch;
[0036] Step B: Pass the current order quantity to S4 to obtain the layout plan with the highest utilization rate;
[0037] Step C: Based on the above arrangement plan, adopt the greedy idea and continue to produce the plan with the highest utilization rate until the order quantity cannot be met. Assume that the current order quantities of the blanks numbered 1 to M are (y1, y2, ...y M ), the number of blanks in the layout being produced is (x1, x2, ... x M ), then the quantity to be produced by this layout plan is easily obtained as:
[0038]
[0039] Step D: Produce according to the previous layout plan After times, the remaining order quantity can be obtained as:
[0040]
[0041] Step E: Set the remaining order quantity as the current order quantity to be produced, and repeat steps B, C, and D until the remaining order quantity is all reset to zero (0, 0, ... 0).
[0042] In summary, this application includes the following beneficial technical effects:
[0043] The algorithm proposed by the present invention combines the improved adaptive simulated annealing algorithm with the greedy algorithm, and is different from the traditional linear cutting model. Instead, a random cutting model based on probability search is proposed, thereby further reducing the use of the number of plates, improving the utilization rate of the plates, making the algorithm converge faster, reducing the number of layout schemes, and more in line with factory needs. In the adaptive simulated annealing algorithm module, the important parameters in the simulated annealing are replaced by the type of blanks of the order, the number of orders, etc., and the cooling process is actively exited when the number of orders or the plates cannot be used, so that large orders have a larger search range, and small orders appropriately reduce the search range, thereby improving the search speed, so that the convergence speed of the algorithm of the present invention is significantly improved compared with the traditional simulated annealing. In the greedy algorithm module, when the present invention finds the layout scheme with the highest utilization rate at each stage, it always greedily produces this layout scheme until the number of orders no longer meets the conditions, thereby greatly reducing the layout scheme compared with other algorithms on the market, and reducing the number of calls to simulated annealing to further reduce the search time, thereby making it more convenient for factories to process. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 It is a schematic diagram of the first arrangement scheme of the present invention;
[0045] Figure 2 It is a schematic diagram of a second arrangement scheme of the present invention;
[0046] Figure 3 It is a schematic diagram of a third arrangement scheme of the present invention;
[0047] Figure 4 It is a schematic diagram of a fourth arrangement scheme of the present invention;
[0048] Figure 5 It is a schematic diagram of the fifth arrangement scheme of the present invention;
[0049] Figure 6 It is a schematic diagram of the sixth arrangement scheme of the present invention;
[0050] Figure 7 It is a schematic diagram of the seventh arrangement scheme of the present invention;
[0051] Figure 8 It is a schematic diagram of the eighth arrangement scheme of the present invention;
[0052] Fig. 9 It is a schematic diagram of the ninth arrangement scheme of the present invention;
[0053] Fig.10 It is a flow chart of the adaptive traversal times of the present invention;
[0054] Fig.11 Schematic diagrams of four situations of cutting the blank on the plate of the present invention;
[0055] Fig.12 It is a flow chart of calculating the utilization rate of the sample arrangement solution Solution of the present invention;
[0056] Fig.13 It is a flow chart of selecting the arrangement scheme with the highest utilization rate according to the present invention;
[0057] Fig.14 This is a schematic diagram of testing an actual order of glass cutting of the present invention;
[0058] Fig.15 The present invention Fig.14 Schematic diagram of the results generated by the test. DETAILED DESCRIPTION
[0059] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0060] The present invention provides an embodiment, such as Figure 1-15 As shown in the figure, a two-dimensional rectangular parts nesting method based on an improved simulated annealing algorithm is proposed.
[0061] The blank number is selected based on the Metropoli criterion, and the method comprises the following steps:
[0062] Step 1: Number the blanks to be produced, and number them 1, 2, 3...M according to their models. Blanks with two widths and lengths that are the same or whose length is equal to another width and whose width is equal to another length are considered to have the same number;
[0063] Step 2: Generate a suitable fitIndex array according to the width and length of the current plate, which stores the blank numbers that can be cut from the current plate, to prevent meaningless search calculations and speed up the convergence of the algorithm;
[0064] Step 3: Randomly extract a blank number that can be cut from fitIndex;
[0065] Step 4: Define the fitness function func, its value is Among them, UsedArea represents the area of the blank with the current number, TotalArea represents the total area of the current plate, and the value of func represents the ratio of waste;
[0066] Step 5: Set the initial value minVal of the func function to 1, so that the blank number minIndex with the smallest func function value is 0;
[0067] Step 6: If the new objective function takes the value Y - If it is less than the current value minVal, update If the new objective function takes the value Y - If it is greater than the current value minVal, the suboptimal solution is accepted with a certain probability according to the Metropoli criterion; the probability function is set to Where i is the number of loops. This probability function ensures that the value gradually decreases as the algorithm progresses, making it more difficult to obtain a suboptimal solution, thereby retaining the better solutions that have been searched. A random decimal is taken between 0 and 1. If this decimal is less than the current probability function value, an update is performed. Otherwise, keep the existing solution;
[0068] Step 7: Replace the length of the Markov chain in the traditional simulated annealing algorithm with 100*M, and adaptively traverse the number of times according to the order, so as to reduce the search time while maintaining the search performance. After the traversal is completed, a final blank number minIndex is returned. See the flowchart. Fig.10 ;
[0069] Specifically, cutting the selected blank from the current plate includes the following steps:
[0070] Step 1: First, standardize the shapes of the blank and the plate. Both the blank and the plate must meet the requirement that the length is greater than or equal to the width, otherwise they must be rotated to meet this condition;
[0071] Step 2: After step 1 is completed, there are four situations for cutting the blank on the board. Fig.11 ;
[0072] Step 3: It can be seen that each time the current plate is cut into a corresponding blank, two new plates will be recursively generated. These two new plates are called Raw1 and Raw2. For the choice between X-cut and Y-cut in the horizontal direction, a judge function is defined to judge the impact of the current cutting on the subsequent cutting. If a plate Raw can cut a blank under the current order quantity, the function takes the value of 1, otherwise it takes the value of 0. The value of judge(Raw1)+judge(Raw2) after X-cut is calculated, and then the value of judge(Raw1)+judge(Raw2) after Y-cut is calculated. If the former is greater than the latter, X-cut is performed; if the former is less than the latter, Perform Y-pass cutting; if the two are equal, then randomly select one from X-pass cutting and Y-pass cutting, and choose whether to rotate the blank longitudinally, until after passing step 1, the blank and the plate both meet the condition that the length is greater than or equal to the width. Therefore, if the blank meets condition 3 or condition 4 after rotation, then it can definitely be converted into condition 1 or condition 2 for cutting, and vice versa. Therefore, it is necessary to give priority to the cutting of condition 3 and condition 4, and at the same time, there is a certain probability of selecting condition 1 and condition 2 for cutting. When condition 3 and condition 4 cannot be achieved, directly select from condition 1 and condition 2. Through the above double selection, a unique cutting scheme can be determined on the current plate, and then the two new sub-plates generated by cutting are added to the candidate queue;
[0073] Step 4: Among the sub-plates generated above, waste will inevitably be generated, that is, under the current order quantity conditions, it is no longer possible to cut out the blank plate. Therefore, the waste plate must be deleted after each cutting to ensure that the plates in the candidate queue can be used normally.
[0074] Specifically, generating a blank layout plan on a whole plate includes the following steps:
[0075] Step 1: Initialize the current plate to be a whole plate required for actual production, record its total area TotalArea, and product UsedArea = 0;
[0076] Step 2: Set the initial temperature T s for End temperature T e for Temperature decay rate α = 0.98, and the gradual cooling process begins;
[0077] Step 3: Each time the temperature decreases, a blank is found from the previous process 1 or 2, and a cutting scheme is selected for cutting. After the cutting of the blank is completed, the corresponding blank order quantity is reduced by one;
[0078] Step 4: After each cutting is completed, the cut rough surface is accumulated and added to the UsedArea;
[0079] Step 5: Record the required quantity of each numbered blank into the layout plan Solution;
[0080] Step 6: When all sub-sheets on the initial sheet have become waste and cannot be cut further, or the current order quantity has been completed, there is no need to continue cooling down, and the loop is directly exited to speed up the algorithm convergence time;
[0081] Step 7: Calculate the utilization rate of this sample arrangement solution And put the current nesting plan into a nesting plan set Solutions, see the flowchart Fig.12 ;
[0082] Specifically, generating all possible layout plans under the current order quantity limit includes the following steps:
[0083] S1: Initialize the current order quantity, that is, how many blanks of various numbers are left;
[0084] S2: Generate a layout solution on a plate and record it in the set Solutions;
[0085] S3: until the current order is completed, that is, the number of blank orders for each number is 0, otherwise repeat S1 and S2;
[0086] S4: Select the one with the highest utilization rate from the set of solutions. See the flowchart for details. Fig.13 ;
[0087] Specifically, obtaining a complete set of layout plans and calculating the quantity to be produced for each layout plan respectively include the following steps:
[0088] Step A: Initialize the order quantity, that is, the number of blanks with various numbers that need to be produced in this batch;
[0089] Step B: Pass the current order quantity to S4 to obtain the layout plan with the highest utilization rate;
[0090] Step C: Based on the above arrangement plan, adopt the greedy idea and continue to produce the plan with the highest utilization rate until the order quantity cannot be met. Assume that the current order quantities of the blanks numbered 1 to M are (y1, y2, ...y M ), the number of blanks in the layout being produced is (x1, x2, ... x M ), then the quantity to be produced by this layout plan is easily obtained as:
[0091]
[0092] Step D: Produce according to the previous layout plan After times, the remaining order quantity can be obtained as:
[0093]
[0094] Step E: Set the remaining order quantity as the current order quantity to be produced, and repeat steps B, C, and D until the remaining order quantity is all reset to zero (0, 0, ... 0).
[0095] As a specific implementation example, in the random cutting model, the present invention proposes four cutting models of the blank on the plate, and gives the mutual conversion relationship between them. Moreover, this conversion is based on specific constraints and probability calculation. Under the premise that the above convergence has taken a long time, it can traverse almost all layout situations, so as to search for the optimal layout plan. An actual glass cutting order is used for testing. Fig.14 ;
[0096] The generated results are shown in Fig.15 .
[0097] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments. The above embodiments and descriptions are only preferred examples of the present invention and are not intended to limit the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A two-dimensional rectangular parts nesting method based on an improved simulated annealing algorithm, characterized in that: The blank number is selected based on the Metropoli criterion, and the method comprises the following steps: Step 1: Number the blanks to be produced, and number them 1, 2, 3...M according to their models. Blanks with two widths and lengths that are the same or whose length is equal to another width and whose width is equal to another length are considered to have the same number; Step 2: Generate a suitable fitIndex array according to the width and length of the current plate, which stores the blank numbers that can be cut from the current plate, to prevent meaningless search calculations and speed up the convergence of the algorithm; Step 3: Randomly extract a blank number that can be cut from fitIndex; Step 4: Define the fitness function func, its value is Among them, UsedArea represents the area of the blank with the current number, TotalArea represents the total area of the current plate, and the value of func represents the ratio of waste; Step 5: Set the initial value of the func function, min Val, to 1, and the blank number min Index that can make the func function have the smallest value to 0; Step 6: If the new objective function value Y_ is less than the current value min Val, update it If the new objective function value Y_ is greater than the current value min Val, then the suboptimal solution is accepted with a certain probability according to the Metropoli criterion; set the probability function to e -(Y_-minVal)*i , where i is the number of cycles. This probability function can ensure that the value gradually becomes smaller as the algorithm progresses, making it more difficult to obtain a suboptimal solution, thereby retaining the better solutions that have been searched. A random decimal is taken between 0 and 1. If this decimal is less than the current probability function value, it is updated. Otherwise, keep the existing solution; Step 7: Replace the length of the Markov chain in the traditional simulated annealing algorithm with 100*M, and adaptively traverse the number of times according to the order, so as to reduce the search time while maintaining the search performance. After the traversal is completed, a final blank number min Index is returned.
2. The two-dimensional rectangular parts nesting method of the improved simulated annealing algorithm according to claim 1 is characterized in that: Cut the selected blank from the current plate, including the following steps: Step 1: First, standardize the shapes of the blank and the plate. Both the blank and the plate must meet the requirement that the length is greater than or equal to the width, otherwise they must be rotated to meet this condition; Step 2: After step 1 is completed, there are four situations for cutting the blank on the board; Step 3: Each time the current plate is cut into a corresponding blank, two new plates will be recursively generated. These two new plates are called Raw1 and Raw2. For the choice between X-cut and Y-cut in the horizontal direction, a judge function is defined to judge the impact of the current cutting on the subsequent cutting. If a plate Raw can cut a blank under the current order quantity, the function takes the value of 1, otherwise it takes the value of 0. The value of judge(Raw1)+judge(Raw2) after X-cut is calculated, and then the value of judge(Raw1)+judge(Raw2) after Y-cut is calculated. If the former is greater than the latter, X-cut is performed; if the former is less than the latter, Y-cut is performed. Through cutter; if the two are equal, randomly select one from X through cutter and Y through cutter, and choose whether to rotate the blank longitudinally, until after step one, the blank and the plate both meet the condition that the length is greater than or equal to the width. Therefore, if the blank meets condition three or condition four after rotation, then it can definitely be converted into condition one or condition two for cutting, and vice versa. Therefore, it is necessary to give priority to the cutting of condition three and condition four, and at the same time, there is a certain probability to select condition one and condition two for cutting. When condition three and condition four cannot be realized, directly select from condition one and condition two. Through the above double selection, a unique cutting scheme can be determined on the current plate, and then the two new sub-plates generated by cutting are added to the candidate queue; Step 4: Among the sub-plates generated above, waste will inevitably be generated, that is, under the current order quantity conditions, it is no longer possible to cut out the blank plate. Therefore, the waste plate must be deleted after each cutting to ensure that the plates in the candidate queue can be used normally.
3. The two-dimensional rectangular parts nesting method of the improved simulated annealing algorithm according to claim 1 is characterized in that: Generating a blank layout plan for a whole plate includes the following steps: Step 1: Initialize the current plate to be a whole plate required for actual production, record its total area TotalArea, and product UsedArea = 0; Step 2: Set the initial temperature T s for End temperature T e for Temperature decay rate α = 0.98, and the gradual cooling process begins; Step 3: Each time the temperature decreases, a blank is found from the previous process 1 or 2, and a cutting scheme is selected for cutting. After the cutting of the blank is completed, the corresponding blank order quantity is reduced by one; Step 4: After each cutting is completed, the cut rough surface is accumulated and added to the UsedArea; Step 5: Record the required quantity of each numbered blank into the layout plan Solution; Step 6: When all sub-sheets on the initial sheet have become waste and cannot be cut further, or the current order quantity has been completed, there is no need to continue cooling down, and the loop is directly exited to speed up the algorithm convergence time; Step 7: Calculate the utilization rate of this sample arrangement solution And put the current nesting plan into a nesting plan set Solutions.
4. The two-dimensional rectangular parts nesting method of the improved simulated annealing algorithm according to claim 1 is characterized in that: Generate all possible layout plans under the current order quantity limit, including the following steps: S1: Initialize the current order quantity, that is, how many blanks of various numbers are left; S2: Generate a layout solution on a plate and record it in the set Solutions; S3: until the current order is completed, that is, the number of blank orders for each number is 0, otherwise repeat S1 and S2; S4: Select the arrangement plan with the highest utilization rate from the arrangement plan set Solutions.
5. The two-dimensional rectangular parts nesting method of the improved simulated annealing algorithm according to claim 1 is characterized in that: Obtain a complete set of layout plans and calculate the quantity to be produced for each layout plan, including the following steps: Step A: Initialize the order quantity, that is, the number of blanks with various numbers that need to be produced in this batch; Step B: Pass the current order quantity to S4 to obtain the layout plan with the highest utilization rate; Step C: Based on the above arrangement plan, adopt the greedy idea and continue to produce the plan with the highest utilization rate until the order quantity cannot be met. Assume that the current order quantities of the blanks numbered 1 to M are (y1, y2, ...y M ), the number of blanks in the layout being produced is (x1, x2, ... x M ), then the quantity to be produced by this layout plan is easily obtained as: Step D: Produce according to the previous layout plan After times, the remaining order quantity can be obtained as: Step E: Set the remaining order quantity as the current order quantity to be produced, and repeat Step 2, Step 3, and Step 4 until the remaining order quantity is all reset to zero (0, 0, ... 0).
