Rectangular part layout method, device and equipment based on genetic algorithm and storage medium
Through the rectangular parts arrangement method based on genetic algorithm, chain coding genetic algorithm is used to optimize the arrangement of rectangular parts, which solves the problem of low space utilization in the existing technology, achieves efficient arrangement of rectangular parts, and improves production efficiency. and cost-effectiveness.
Patent Information
- Application Number
- CN202310293136.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-23
- Publication Date
- 2024-09-24
AI Technical Summary
The reference layout scheme obtained by the existing rectangular part layout method has a low space utilization rate and cannot effectively improve the production efficiency of ship surface processing enterprises and logistics and freight enterprises.
A rectangular piece layout method based on genetic algorithm is used to optimize the target layout plan by generating an initial layout plan population and using a chain coding genetic algorithm for iterative evolution to improve site space utilization.
It achieves a rectangular parts arrangement scheme with high space utilization, reduces production costs, improves efficiency, and is suitable for application scenarios such as two-dimensional layout and cartoning.
Smart Images

Figure CN118690888A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of production and manufacturing, and in particular to a rectangular parts arrangement method, device, equipment and storage medium based on genetic algorithm. Background Art
[0002] With the advancement of information technology, the trend of industrial informatization and intelligent transformation is becoming more and more obvious. Advanced planning and scheduling is one of the key technologies for the intelligent transformation of manufacturing enterprises. Packing and boxing rectangular (or cuboid) objects of different sizes is an important part of logistics and freight. Therefore, the rectangular piece packing problem has received extensive attention and research.
[0003] The existing rectangular parts layout method provides a reference layout scheme for the ship surface segment production scheduling and rectangular (cuboid) packing problem, and obtains high site space utilization through layout, thereby improving the production efficiency of ship surface processing enterprises and logistics and freight enterprises. However, the existing rectangular parts layout method is often based on sequence coding genetic algorithms combined with heuristic rule-based spatial layout technology. Its optimization algorithm is essentially a local search, and the reference layout scheme obtained often has low space utilization. Summary of the invention
[0004] The embodiment of the present invention provides a rectangular piece arrangement method, device, equipment and storage medium based on a genetic algorithm, so as to solve the problem of low space utilization in a reference layout scheme obtained by an existing rectangular piece arrangement method.
[0005] In order to solve the above technical problems, the embodiments of the present invention provide the following technical solutions:
[0006] The embodiment of the present invention provides a rectangular component arrangement method based on a genetic algorithm, comprising:
[0007] Generate an initial arrangement scheme population according to geometric information of a plurality of rectangular pieces to be arranged and geometric information of a rectangular arrangement site, wherein the initial arrangement scheme population includes at least one initial arrangement scheme;
[0008] Using a preset chain coding genetic algorithm, the initial arrangement scheme population is iteratively evolved to obtain a target arrangement scheme population, wherein the target arrangement scheme population includes at least one target arrangement scheme;
[0009] According to the site space utilization rate corresponding to each of the target arrangement schemes, a final arrangement scheme among the target arrangement schemes is determined.
[0010] Optionally, the geometric information of the arrangement site includes the geometric information of the entire arrangement site and the geometric information of an inner site in the arrangement site that cannot be used to arrange the rectangular pieces to be arranged;
[0011] According to the geometric information of multiple rectangular pieces to be arranged and the geometric information of a rectangular arrangement site, an initial arrangement scheme population is generated, including:
[0012] Randomly generate at least one rectangular piece sequence from the plurality of rectangular pieces to be arranged;
[0013] By using a preset coordinate combination point placement algorithm, one of the initial arrangement schemes in the initial arrangement scheme population is generated according to the overall geometric information of the arrangement site, the geometric information of the inner site, the geometric information of the rectangular pieces to be arranged and a sequence of the rectangular pieces.
[0014] Optionally, using a preset coordinate combination point placement algorithm, according to the geometric information of the entire arrangement site, the geometric information of the inner site, the geometric information of the rectangular pieces to be arranged, and a rectangular piece sequence, generating one of the initial arrangement schemes in the population of initial arrangement schemes, including:
[0015] Determine at least one first position coordinate according to the geometric information of the first target rectangular piece, the geometric information of the entire arrangement field and the geometric information of the inner field;
[0016] Sorting at least one first position coordinate according to a preset order to obtain a first coordinate sequence;
[0017] Generate an initial arrangement plan according to the first coordinate sequence, the geometric information of the second target rectangular piece, the geometric information of the entire arrangement site and the geometric information of the inner site;
[0018] Wherein, the first target rectangular piece is a rectangular piece in the rectangular piece sequence and is located in the sample arrangement area;
[0019] The second target rectangular piece is the first rectangular piece in the rectangular piece sequence that is not located in the arrangement site and is to be arranged.
[0020] Optionally, generating an initial arrangement scheme according to the first coordinate sequence, the geometric information of the second target rectangular piece, the geometric information of the entire arrangement site and the geometric information of the inner site includes:
[0021] Determine the placement of the second target rectangular piece according to the first coordinate sequence, the geometric information of the second target rectangular piece, the geometric information of the entire arrangement site, and the geometric information of the inner site;
[0022] When the placement situation indicates that the placement of the second target rectangular piece is feasible, determining to place the second target rectangular piece in the arrangement site;
[0023] When the placement situation indicates that the placement of the second target rectangular piece is not feasible, determining to place the second target rectangular piece into the set of sites that have not entered the arrangement site;
[0024] An initial arrangement scheme is obtained according to the geometric information of the rectangular pieces in the arrangement area, the geometric information of the rectangular pieces adjacent to each rectangular piece in the arrangement area, and the geometric information of the rectangular pieces that are not in the arrangement area set.
[0025] Optionally, determining the placement of the second target rectangular piece according to the first coordinate sequence, the geometric information of the second target rectangular piece, the geometric information of the entire arrangement site, and the geometric information of the inner site includes:
[0026] Sequentially taking the first position coordinates in the first coordinate sequence as the first target corner coordinates of the second target rectangular object, and for each of the first position coordinates, placing the second target rectangular object into the arrangement site in a first preset posture and a second preset posture respectively;
[0027] When the second target rectangular piece satisfies the first condition, determining that the placement of the second target rectangular piece is feasible;
[0028] When the second target rectangular piece satisfies at least one of the second conditions, it is indeed not feasible to place the second target rectangular piece;
[0029] The first condition includes:
[0030] The second target rectangular piece is located in the sample arrangement field and does not collide with the inner field;
[0031] The first rectangular side of the second target rectangular piece is adjacent to the edge of the first target rectangular piece, the edge of the sample arrangement field, or the edge of the inner field;
[0032] The second rectangular side of the second target rectangular piece is adjacent to the edge of the first target rectangular piece, the edge of the sample arrangement field, or the edge of the inner field;
[0033] The second target rectangular piece does not collide with any of the first target rectangular pieces;
[0034] The second condition includes:
[0035] The second target rectangular piece exceeds the edge of the sample arrangement site;
[0036] The second target rectangular piece collides with the inner field;
[0037] The first rectangular side of the second target rectangular piece is not adjacent to the edge of the first target rectangular piece, the edge of the sample arrangement field, or the edge of the inner field;
[0038] The second rectangular side of the second target rectangular piece is not adjacent to the edge of the first target rectangular piece, the edge of the sample arrangement field, or the edge of the inner field;
[0039] The second target rectangular piece collides with any rectangular piece of the first target rectangular pieces;
[0040] The first rectangular side and the second rectangular side are respectively rectangular sides adjacent to the first target corner point.
[0041] Optionally, using a preset chain coding genetic algorithm, the initial arrangement scheme population is iteratively evolved to obtain a target arrangement scheme population, including:
[0042] The initial arrangement scheme is encoded by using the preset chain coding genetic algorithm to obtain the encoded initial arrangement scheme; the encoded initial arrangement scheme includes the geometric information of each rectangular piece in the arrangement site and the geometric information of the rectangular pieces that have a neighbor relationship with each rectangular piece, and the geometric information of each rectangular piece that has not entered the arrangement site;
[0043] The initial arrangement scheme after the encoding representation is subjected to a preset number of iterative evolution processes to obtain the at least one target arrangement scheme.
[0044] Optionally, performing a preset number of iterative evolution processing on the initial arrangement scheme after the encoding representation to obtain the at least one target arrangement scheme includes:
[0045] In the iterative evolution process of the first target times, the first arrangement scheme is subjected to a crossover process of a first crossover number of times to obtain a second arrangement scheme; the first crossover number of times is determined according to the preset crossover probability and the number of the first arrangement schemes;
[0046] Performing mutation processing on the third arrangement scheme according to a preset mutation probability to obtain a fourth arrangement scheme; the third arrangement scheme includes the first arrangement scheme and the second arrangement scheme;
[0047] Performing selection processing on the fourth arrangement scheme to obtain a fifth arrangement scheme corresponding to the iterative evolution processing of the first target time;
[0048] Wherein, the first target iterative evolution process is any one of the preset number of iterative evolution processes;
[0049] In the case where the first target iterative evolution process is the first iterative evolution process, the first arrangement scheme is the initial arrangement scheme after the encoding representation;
[0050] In the case where the first target time is not the first iterative evolutionary process, the first arrangement scheme is the fifth arrangement scheme corresponding to the iterative evolutionary process of the second target time, and the iterative evolutionary process of the second target time is an iterative evolutionary process before the iterative evolutionary process of the first target time;
[0051] In the case where the first target time is the last iterative evolutionary process, the fifth arrangement scheme corresponding to the first target time iterative evolutionary process is the target arrangement scheme.
[0052] Optionally, performing a crossover process of a first crossover number on the first arrangement scheme to obtain a second arrangement scheme includes:
[0053] In the third target cross processing process, according to the rectangular pieces with neighbor relationship in the arrangement field in the first target arrangement scheme, the first hereditary sub-scheme in the first target arrangement scheme is determined;
[0054] Determine a second genetic sub-scheme in the second target arrangement scheme according to the rectangular pieces having a neighbor relationship in the arrangement site in the second target arrangement scheme;
[0055] Determine a first crossover sub-scheme according to the neighbor relationship between the rectangular pieces in the first target arrangement scheme that are located in the arrangement site and do not belong to the second genetic sub-scheme and the rectangular pieces in the arrangement site in the first target arrangement scheme;
[0056] Determine a second crossover sub-scheme according to the neighbor relationship between the rectangular pieces in the second target arrangement scheme that are located in the arrangement site and do not belong to the first genetic sub-scheme and the rectangular pieces in the arrangement site in the second target arrangement scheme;
[0057] Using a preset coordinate combination point placement algorithm, the rectangular pieces in the first crossover sub-scheme are placed in the second inheritance sub-scheme, and the rectangular pieces in the second crossover sub-scheme are placed in the first inheritance sub-scheme, to obtain a second arrangement scheme;
[0058] Wherein, the first target arrangement scheme and the second target arrangement scheme are any two arrangement schemes in the first arrangement scheme;
[0059] The third target number of cross processing is any one of the first number of cross processing.
[0060] Optionally, using a preset coordinate combination point placement algorithm, placing the rectangular pieces in the first cross sub-scheme into the second inheritance sub-scheme, and placing the rectangular pieces in the second cross sub-scheme into the first inheritance sub-scheme to obtain a second arrangement scheme, including:
[0061] Using a preset coordinate combination point placement algorithm, the rectangular pieces in the first cross sub-scheme are placed in the second inheritance sub-scheme, and a third target rectangular piece whose placement is not feasible is determined;
[0062] Adaptively process the third target rectangular piece to obtain a sixth arrangement scheme;
[0063] Determine a fourth target rectangular piece corresponding to the sixth arrangement scheme and located in the set of sites that have not entered the arrangement site;
[0064] Using a preset coordinate combination point placement algorithm, each of the fourth target rectangular pieces is placed in the arrangement site in turn to obtain the second arrangement scheme;
[0065] Using a preset coordinate combination point placement algorithm, the rectangular pieces in the second cross sub-scheme are placed in the first genetic sub-scheme, and a fifth target rectangular piece whose placement is not feasible is determined;
[0066] Adaptively process the fifth target rectangular piece to obtain a seventh arrangement scheme;
[0067] Determine a sixth target rectangular piece corresponding to the seventh arrangement scheme and located in the set of sites that have not entered the arrangement site;
[0068] Using a preset coordinate combination point placement algorithm, each of the sixth target rectangular pieces is placed in the arrangement site in turn to obtain the second arrangement scheme.
[0069] Optionally, using a preset coordinate combination point placement algorithm, placing the rectangular pieces in the first cross sub-scheme into the second inheritance sub-scheme, and determining a third target rectangular piece whose placement is not feasible, comprises:
[0070] According to the neighbor relationship of the rectangular pieces in the arrangement field in the first target arrangement scheme, the rectangular pieces in the first intersection sub-scheme are divided into at least one first rectangular piece cluster;
[0071] Using a preset coordinate combination point placement algorithm, the first rectangular component clusters are placed in the second genetic sub-scheme respectively, and the third target rectangular component whose placement is not feasible is determined for each of the first rectangular component clusters;
[0072] Using a preset coordinate combination point placement algorithm, placing the rectangular piece in the second cross sub-scheme into the first genetic sub-scheme, and determining a fifth target rectangular piece whose placement is not feasible, including:
[0073] According to the neighbor relationship of the rectangular pieces in the arrangement field in the second target arrangement scheme, the rectangular pieces in the second cross sub-scheme are divided into at least one second rectangular piece cluster;
[0074] The second rectangular component clusters are placed in the first genetic sub-scheme respectively by using a preset coordinate combination point placement algorithm, and the fifth target rectangular component whose placement is not feasible corresponding to each second rectangular component cluster is determined.
[0075] Optionally, the method further comprises:
[0076] In the case where the first target piece is a rectangular piece partially located outside the arrangement site, the first target piece is placed in the set that does not enter the arrangement site corresponding to the third target arrangement scheme;
[0077] In the case where the first target part overlaps with the second target part, according to the principle of minimum moving distance, the first target part or the second target part is moved according to one of the following moving methods until the first target part and the second target part are attached to each other: the first target part is moved along the first rectangular side in a direction away from the first target corner point; the first target part is moved along the second rectangular side in a direction away from the first target corner point; the second target part is moved along the first rectangular side in a direction away from the first target corner point; the second target part is moved along the second rectangular side in a direction away from the first target corner point;
[0078] When the first rectangular side of the first target part does not fit with the boundary of the sample arrangement site or other rectangular parts except the first target part, or the second rectangular side of the first target part does not fit with the boundary of the sample arrangement site or other rectangular parts except the first target part, the first target part is moved to fit with the boundary of the sample arrangement site or other rectangular parts except the first target part according to the principle of minimum moving distance;
[0079] Wherein, the first target piece is any one of the third target rectangular piece and the fourth target rectangular piece;
[0080] In the case where the first target piece is any rectangular piece among the third target rectangular pieces, the third target arrangement scheme is the sixth arrangement scheme, and the second target piece is any rectangular piece among the third target rectangular pieces except the first target piece;
[0081] In the case where the first target piece is any rectangular piece among the fourth target rectangular pieces, the third target arrangement scheme is the seventh arrangement scheme, and the second target piece is any rectangular piece among the fourth target rectangular pieces except the first target piece.
[0082] Optionally, the third arrangement scheme is mutated according to a preset mutation probability to obtain a fourth arrangement scheme, including:
[0083] According to the preset mutation probability, the seventh target rectangular piece in the third target arrangement scheme is rotated by a preset angle to obtain an eighth arrangement scheme; the seventh target rectangular piece is any rectangular piece in the arrangement site corresponding to the third target arrangement scheme;
[0084] Determine an eighth target rectangular piece that is not feasible to place in the eighth arrangement scheme;
[0085] Adaptively process the eighth target rectangular piece to obtain a ninth arrangement scheme;
[0086] Determine a ninth target rectangular piece corresponding to the ninth arrangement scheme and located in the set of sites that have not entered the arrangement site;
[0087] Using a preset coordinate combination point placement algorithm, each of the ninth target rectangular pieces is placed in the arrangement site in turn to obtain the fourth arrangement scheme;
[0088] Among them, the third target arrangement scheme is any arrangement scheme among the third arrangement schemes.
[0089] Optionally, adaptive processing is performed on the eighth target rectangular piece to obtain a ninth arrangement scheme, including:
[0090] In the case where the third target piece is a rectangular piece partially located outside the arrangement site, the third target piece is placed in the set that does not enter the arrangement site corresponding to the ninth target arrangement scheme;
[0091] In the case where the third target part overlaps with the fourth target part, according to the principle of minimum moving distance, the third target part or the fourth target part is moved according to one of the following moving methods until the third target part is in contact with the fourth target part: moving the third target part along the first rectangular side toward a direction away from the first target corner point; moving the third target part along the second rectangular side toward a direction away from the first target corner point; moving the fourth target part along the first rectangular side toward a direction away from the first target corner point; moving the fourth target part along the second rectangular side toward a direction away from the first target corner point;
[0092] When the first rectangular side of the third target part does not fit with the boundary of the sample arrangement site or other rectangular parts except the third target part, or the second rectangular side of the third target part does not fit with the boundary of the sample arrangement site or other rectangular parts except the third target part, the third target part is moved to fit with the boundary of the sample arrangement site or other rectangular parts except the third target part according to the principle of minimum moving distance;
[0093] The third target part is any rectangular part among the eighth target rectangular parts, and the fourth target part is any rectangular part among the eighth target rectangular parts except the third target part.
[0094] Optionally, the fourth arrangement scheme is selected to obtain a fifth arrangement scheme corresponding to the first target iterative evolution process, including:
[0095] Determining the site space utilization rate of each of the fourth arrangement schemes;
[0096] According to the site space utilization rate of each of the fourth arrangement schemes, a roulette wheel selection process is performed on the fourth arrangement schemes to obtain a tenth arrangement scheme;
[0097] Sorting the site space utilization rates of each of the fourth arrangement schemes in descending order, and determining an eleventh arrangement scheme that is within the first preset ratio and is not within the tenth arrangement scheme;
[0098] According to the tenth arrangement scheme and the eleventh arrangement scheme, the fifth arrangement scheme is obtained.
[0099] Optionally, the method further comprises:
[0100] The final arrangement scheme is decoded to obtain a decoded final arrangement scheme.
[0101] Optionally, decoding the final arrangement scheme to obtain a decoded final arrangement scheme includes:
[0102] The second target corner point of the arrangement site is taken as the origin, and the decoded final arrangement plan is obtained according to the geometric information of the rectangular pieces in the arrangement site and the neighbor relationship of the rectangular pieces in the arrangement site in the final arrangement plan.
[0103] The embodiment of the present invention further provides a rectangular piece arrangement device based on a genetic algorithm, comprising:
[0104] A first processing module, for generating an initial arrangement scheme population according to geometric information of a plurality of rectangular pieces to be arranged and geometric information of a rectangular arrangement site, wherein the initial arrangement scheme population includes at least one initial arrangement scheme;
[0105] A second processing module is used to use a preset chain coding genetic algorithm to perform iterative evolution processing on the initial arrangement scheme population to obtain a target arrangement scheme population, wherein the target arrangement scheme population includes at least one target arrangement scheme;
[0106] The determination module is used to determine a final arrangement scheme among the target arrangement schemes according to the site space utilization rate corresponding to each of the target arrangement schemes.
[0107] An embodiment of the present invention also provides a rectangular piece arrangement device based on a genetic algorithm, comprising: a transceiver, a processor, a memory, and a program or instruction stored in the memory and executable on the processor; when the processor executes the program or instruction, the rectangular piece arrangement method based on a genetic algorithm as described above is implemented.
[0108] An embodiment of the present invention further provides a readable storage medium having a program or instruction stored thereon, and when the program or instruction is executed by a processor, the steps in the rectangular piece arrangement method based on a genetic algorithm as described above are implemented.
[0109] The beneficial effects of the present invention are:
[0110] The rectangular parts arrangement method based on genetic algorithm provided by the scheme of the present invention generates an initial population according to the geometric information of multiple rectangular parts to be arranged and the geometric information of a rectangular arrangement site, wherein the initial population includes at least one initial arrangement scheme, and iteratively evolves the initial arrangement scheme population using a preset chain coding genetic algorithm, continuously optimizes the target arrangement scheme population, and determines the final arrangement scheme in the target arrangement scheme population according to the site space utilization rate corresponding to each of the target arrangement schemes. The scheme of the present invention can efficiently search in the solution space to finally obtain a high-quality arrangement scheme, and the final arrangement scheme is an arrangement scheme with high space utilization, and the final arrangement scheme can reduce costs and improve efficiency in application scenarios such as two-dimensional arrangement and packing. BRIEF DESCRIPTION OF THE DRAWINGS
[0111] Figure 1 A flowchart showing a rectangular piece packing method based on a genetic algorithm provided by an embodiment of the present invention;
[0112] Figure 2 A schematic diagram showing a coordinate combination point placement algorithm provided by an embodiment of the present invention;
[0113] Figure 3 A schematic diagram showing an initial arrangement scheme provided by an embodiment of the present invention;
[0114] Figure 4 A schematic diagram showing a first target arrangement scheme provided by an embodiment of the present invention;
[0115] Figure 5 A schematic diagram showing a second target arrangement scheme provided by an embodiment of the present invention;
[0116] Figure 6 A schematic diagram showing a first genetic sub-scheme provided in an embodiment of the present invention;
[0117] Figure 7 A schematic diagram showing a second genetic sub-scheme provided in an embodiment of the present invention;
[0118] Figure 8 A schematic diagram showing a first crossover sub-scheme provided in an embodiment of the present invention;
[0119] Fig. 9 A schematic diagram showing a second crossover sub-scheme provided in an embodiment of the present invention;
[0120] Fig.10 A schematic diagram showing the placement of rectangular pieces in the second crossover sub-scheme provided by an embodiment of the present invention into the arrangement site of the first genetic sub-scheme;
[0121] Fig.11 A schematic diagram showing a sixth arrangement scheme provided by an embodiment of the present invention;
[0122] Fig.12 One of the schematic diagrams showing the second arrangement scheme provided by the embodiment of the present invention;
[0123] Fig.13 A schematic diagram showing the placement of rectangular pieces in the first crossover sub-scheme provided by an embodiment of the present invention into a sample arrangement site of the second genetic sub-scheme;
[0124] Fig.14 A schematic diagram showing a seventh arrangement scheme provided in an embodiment of the present invention;
[0125] Fig.15 A second schematic diagram showing a second arrangement scheme provided by an embodiment of the present invention;
[0126] Fig.16 A schematic diagram showing a third target arrangement scheme provided by an embodiment of the present invention;
[0127] Fig.17 A schematic diagram showing an eighth arrangement scheme provided by an embodiment of the present invention;
[0128] Fig.18 A schematic diagram showing a ninth arrangement scheme provided in an embodiment of the present invention;
[0129] Fig.19 A schematic diagram showing a fourth arrangement scheme provided by an embodiment of the present invention;
[0130] Fig. 20 A specific flow chart showing a rectangular piece arrangement method based on a genetic algorithm provided in an embodiment of the present invention;
[0131] Fig.21 A schematic diagram showing the structure of a rectangular piece arrangement device provided in an embodiment of the present invention;
[0132] Fig. 22 A schematic diagram showing the structure of a rectangular piece arrangement device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0133] In order to make the objectives, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0134] Aiming at the problem of low space utilization in a reference layout scheme obtained by an existing rectangular piece arrangement method, the present invention provides a rectangular piece arrangement method, device, equipment and storage medium.
[0135] like Figure 1 As shown, an embodiment of the present invention provides a rectangular component arrangement method based on a genetic algorithm, comprising:
[0136] Step 101: Generate an initial arrangement scheme population according to geometric information of a plurality of rectangular pieces to be arranged and geometric information of a rectangular arrangement site, wherein the initial arrangement scheme population includes at least one initial arrangement scheme.
[0137] It should be noted that the rectangular pieces to be arranged in the rectangular piece arrangement method based on genetic algorithm provided in the embodiment of the present invention can be two-dimensional rectangular pieces or three-dimensional cuboid pieces. In this embodiment, the rectangular pieces to be arranged are two-dimensional rectangular pieces and there is no inner field as an example for explanation.
[0138] In this step, the geometric information of the rectangular pieces to be arranged is obtained, that is, the length l of each rectangular piece is obtained. i , width w i , obtain the geometric information of the arrangement site, the geometric information of the arrangement site includes the geometric information of the entire arrangement site and the geometric information of the inner field in the arrangement site that cannot be used to arrange the rectangular pieces to be arranged, wherein the geometric information of the entire arrangement site is the length l0 and width w0 of the rectangular envelope of the processing site, and the geometric information of the inner field is the length l of each rectangular block of the inner field k , width w k .
[0139] In this embodiment, the constraint conditions are that the rectangular segments (rectangular pieces to be arranged) do not collide with each other, the rectangular segments are all within the site, and the objective function is an optimization model of the site space utilization rate η.
[0140] In this step, before genetic evolution, several layout schemes (initial arrangement schemes) are randomly generated as the initial arrangement scheme population according to the geometric information of the rectangular pieces to be arranged and the geometric information of the arrangement site. Each initial solution (initial arrangement scheme) in the initial arrangement scheme population must ensure that the left side and bottom side of each rectangular piece are connected to the edges of other rectangular pieces or the arrangement site.
[0141] Step 102: using a preset chain coding genetic algorithm, iteratively evolving the initial arrangement scheme population to obtain a target arrangement scheme population, wherein the target arrangement scheme population includes at least one target arrangement scheme.
[0142] It should be noted that the genetic algorithm is a heuristic optimization algorithm. Its idea is to draw on the evolutionary law of "survival of the fittest" in the biological world. It encodes the optimization variables, and then uses an iterative method to perform selection, crossover and mutation operations, exchange information of individuals in the population, and after several iterative evolutions, obtain the current optimal solution.
[0143] In this step, a chain coding genetic algorithm is used to encode the placement positions of the rectangular pieces in the initial arrangement scheme population using a linked list method and perform iterative evolution processing until a preset maximum evolutionary generation is reached, thereby obtaining an evolved target arrangement scheme population, wherein the target arrangement scheme population includes at least one target arrangement scheme.
[0144] Step 103: Determine a final arrangement scheme among the target arrangement schemes according to the site space utilization rate corresponding to each of the target arrangement schemes.
[0145] In this step, after obtaining the evolved target arrangement scheme, the fitness of each target arrangement scheme is calculated. The fitness of each target arrangement scheme refers to the total area of the rectangular pieces in the venue divided by the venue area to obtain the venue space utilization rate η of each target arrangement scheme. The specific calculation formula is as follows:
[0146]
[0147] Among them, ∑l i w i Represents the total area of the rectangular pieces in the site, l i represents the length of each rectangular piece, w i represents the width of each rectangular piece, l0w0-∑l k w k represents the site area, l0 represents the length of the rectangular envelope of the processing site (layout site), and the width w0 represents the width of the rectangular envelope of the processing site. k represents the length of the rectangular envelope of each inner field, w k The width of the rectangular envelope of each inner field. In actual scenarios, the inner field often refers to non-field areas such as fixed tire frames and passages, which cannot be used to place rectangular parts.
[0148] In this embodiment, the target arrangement scheme with the highest site space utilization rate may be selected as the final arrangement scheme.
[0149] The rectangular parts arrangement method based on the chain genetic coding algorithm provided by the embodiment of the present invention provides a reference layout scheme for the ship surface segment production planning and scheduling and rectangular (cuboid) packing problems, so that the final scheme has a higher space utilization rate.
[0150] In an optional embodiment of the present invention, an initial arrangement scheme population is generated according to geometric information of a plurality of rectangular pieces to be arranged and geometric information of a rectangular arrangement site, including:
[0151] Randomly generate at least one rectangular piece sequence from the plurality of rectangular pieces to be arranged;
[0152] By using a preset coordinate combination point placement algorithm, one of the initial arrangement schemes in the initial arrangement scheme population is generated according to the overall geometric information of the arrangement site, the geometric information of the inner site, the geometric information of the rectangular pieces to be arranged and a sequence of the rectangular pieces.
[0153] In this embodiment, a plurality of rectangular pieces to be arranged are randomly generated into N rectangular piece sequences, where N is an integer greater than or equal to 1, and a sampling coordinate combination point placement algorithm is used. According to the geometric information of the overall site, the geometric information of the inner site and the geometric information of the rectangular pieces to be arranged, the rectangular pieces are placed one by one in the arrangement site in the order of the rectangular pieces to be arranged in a rectangular piece sequence to generate an initial arrangement plan, that is, N rectangular piece sequences, and N initial arrangement plans are generated accordingly.
[0154] Further, using a preset coordinate combination point placement algorithm, according to the geometric information of the entire arrangement site, the geometric information of the inner site, the geometric information of the rectangular pieces to be arranged and a rectangular piece sequence, one of the initial arrangement schemes in the initial arrangement scheme population is generated, including:
[0155] Determine at least one first position coordinate according to the geometric information of the first target rectangular piece, the geometric information of the entire arrangement site, and the geometric information of the inner site, wherein the first target rectangular piece is a rectangular piece in the rectangular piece sequence that is located in the arrangement site, and the extracted first position coordinate is a set of rectangular piece corner point coordinates, including an x-axis coordinate set and a y-axis coordinate set;
[0156] Specifically, taking the lower left corner of the sample arrangement site as the origin (0, 0), by continuously backtracking the rectangular piece of its left neighbor until it reaches the site and stops, the horizontal length of its left neighbor (the length of the side parallel to the x-axis) is accumulated in the process to obtain the x-axis coordinate of the first position coordinate, and by continuously backtracking the lower neighbor until it reaches the site and stops, the vertical length of its lower neighbor (the length of the side parallel to the y-axis) is accumulated in the process to obtain the y-axis coordinate of the first position coordinate.
[0157] For example, see Figure 2 , the rectangular pieces in the current rectangular piece sequence located in the arrangement site include rectangular piece 1, rectangular piece 2, rectangular piece 3 and rectangular piece 4, wherein the origin coordinate is (x1, y1). By tracing back the rectangular pieces in the arrangement site, the first position coordinates can be obtained: (x1, y1), (x1, y2), (x1, y3), (x1, y4), (x1, y5), (x2, y1), (x2, y2), (x2, y3), (x2, y4), (x2, y5 ), (x3, y1), (x3, y2), (x3, y3), (x3, y4), (x3, y5), (x4, y1), (x4, y2), (x4, y3), (x4, y4), (x4, y5), (x5, y1), (x5, y2), (x5, y3), (x5, y4), (x5, y5), the set of rectangular pieces that are not located in the sampling site or are not successfully placed in the sampling site include rectangular piece 5 and rectangular piece 6.
[0158] At least one first position coordinate is sorted in a preset order to obtain a first coordinate sequence. In this embodiment, the pairwise combinations of elements in the x-axis coordinate set and the y-axis coordinate set are traversed to obtain a "coordinate combination point set", which is arranged from small to large according to the y-axis coordinate. When the y-axis coordinates are the same, a "coordinate combination point" sequence is obtained in ascending order of the x-axis coordinates, i.e., the first coordinate sequence.
[0159] An initial arrangement plan is generated based on the first coordinate sequence, the geometric information of the second target rectangular piece, the overall geometric information of the arrangement site, and the geometric information of the inner site, wherein the second target rectangular piece is the first rectangular piece in the rectangular piece sequence that is not located in the arrangement site among the rectangular pieces to be arranged, that is, the second target rectangular piece is the rectangular piece currently to be placed.
[0160] When generating the initial arrangement plan, in order to reflect the differences of the random sequence, rectangular pieces are selected in sequence as the second target rectangular pieces according to the order of the current rectangular piece sequence.
[0161] Further, when the second target rectangular piece is the rectangular piece to be currently placed, that is, when the second target rectangular piece is arranged, an initial arrangement scheme is generated according to the first coordinate sequence, the geometric information of the second target rectangular piece, the geometric information of the entire arrangement site, and the geometric information of the inner site, including:
[0162] Determine the placement of the second target rectangular piece according to the first coordinate sequence, the geometric information of the second target rectangular piece, the geometric information of the entire arrangement site, and the geometric information of the inner site;
[0163] Preferably, determining the placement of the second target rectangular piece according to the first coordinate sequence, the geometric information of the second target rectangular piece, the geometric information of the entire arrangement site and the geometric information of the inner site includes:
[0164] The first position coordinates in the first coordinate sequence are sequentially used as the first target corner point coordinates of the second target rectangular piece, and for each of the first position coordinates, the second target rectangular piece is placed in the arrangement field in a first preset posture and a second preset posture, respectively. In this embodiment, the first target corner point is the lower left corner point of the second target rectangular piece, and the first preset posture is a horizontal placement posture (l i ||l0), the second preset posture is the vertical placement posture (l i ⊥l0);
[0165] When the second target rectangular piece satisfies the first condition, determining that the placement of the second target rectangular piece is feasible;
[0166] When the second target rectangular piece satisfies at least one of the second conditions, it is indeed not feasible to place the second target rectangular piece;
[0167] The first condition includes:
[0168] The second target rectangular piece is located in the sample arrangement field and does not collide with the inner field;
[0169] The first rectangular side of the second target rectangular piece is adjacent to the edge of the first target rectangular piece, the edge of the sample arrangement field, or the edge of the inner field;
[0170] The second rectangular side of the second target rectangular piece is adjacent to the edge of the first target rectangular piece, the edge of the sample arrangement field, or the edge of the inner field;
[0171] The second target rectangular piece does not collide with any of the first target rectangular pieces;
[0172] The second condition includes:
[0173] The second target rectangular piece exceeds the edge of the sample arrangement site;
[0174] The second target rectangular piece collides with the inner field;
[0175] The first rectangular side of the second target rectangular piece is not adjacent to the edge of the first target rectangular piece, the edge of the sample arrangement field, or the edge of the inner field;
[0176] The second rectangular side of the second target rectangular piece is not adjacent to the edge of the first target rectangular piece, the edge of the sample arrangement field, or the edge of the inner field;
[0177] The second target rectangular piece collides with any rectangular piece of the first target rectangular pieces;
[0178] The first rectangular side and the second rectangular side are respectively rectangular sides adjacent to the first target corner point.
[0179] Specifically, the first first position coordinate arranged in sequence in the first coordinate sequence is used as the coordinate of the lower left corner point of the second target rectangular piece, and the second target rectangular piece is tried to be placed in the sample arrangement site in a horizontal position. If the second target rectangular piece meets the above-mentioned first condition, it is determined that the placement of the second target rectangular piece is feasible. If the first first position coordinate is used as the coordinate of the lower left corner point of the second target rectangular piece, and the second target rectangular piece is tried to be placed in the sample arrangement site in a horizontal position, if the second target rectangular piece meets at least one of the above-mentioned second conditions, it is considered that the horizontal placement of the second target rectangular piece at the current first position coordinate is not feasible, and then the second target rectangular piece is placed in a vertical placement posture. If the second target rectangular piece meets at least one of the above-mentioned second conditions, it is considered that the vertical placement of the second target rectangular piece at the current first position coordinate is also not feasible, and then the next first position coordinate in the first coordinate sequence is tried as the coordinate of the lower left corner point of the second target rectangular piece, and the second target rectangular piece is tried to be placed in the sample arrangement site in a horizontal position until the second target rectangular piece meets the above-mentioned first condition.
[0180] When the placement situation indicates that the placement of the second target rectangular piece is feasible, determining to place the second target rectangular piece in the arrangement site;
[0181] When the placement situation indicates that the second target rectangular piece is not feasible to be placed at all the first position coordinates and in any placement posture, determining to place the second target rectangular piece into the set of sites that have not entered the arrangement site;
[0182] An initial arrangement scheme is obtained according to the geometric information of the rectangular pieces in the arrangement area, the geometric information of the rectangular pieces adjacent to each rectangular piece in the arrangement area, and the geometric information of the rectangular pieces that are not in the arrangement area set.
[0183] Among them, in this embodiment, the geometric information of the rectangular pieces in the sample arrangement site includes the position coordinates of the first target corner point of each rectangular piece (that is, the position coordinates of the lower left corner point), placement posture, length and width, and the geometric information of the rectangular pieces that have not entered the sample arrangement site set includes the placement posture, length and width of each rectangular piece.
[0184] When the placement of the second target rectangular piece is feasible, the second target rectangular piece is placed in the arrangement site, and the first coordinate sequence is updated. For the next second target rectangular piece in the rectangular piece sequence, the above steps are repeated to determine the placement of the next second target rectangular piece. When the placement of the second target rectangular piece is not feasible, the placement of the next second target rectangular piece in the rectangular piece sequence is determined according to the above process until all the rectangular pieces in the rectangular piece sequence are placed in the arrangement site or in the set that has not entered the arrangement site. When the random sequence (rectangular piece sequence) generated by the rectangular pieces to be arranged is traversed and all the arrangement is completed, the current site and the rectangular piece layout in the site and the set of rectangular pieces that have not successfully entered the arrangement site are taken together as a complete solution (a complete initial arrangement plan).
[0185] Specifically, in this embodiment, for an arrangement plan, judging whether the arrangement of the current rectangular pieces in the venue is feasible includes the following two situations:
[0186] (1) Two rectangular pieces collide, that is, whether the projection of the second target rectangular piece and a rectangular piece in the first target rectangular piece in the x-axis direction and the projection in the y-axis direction overlap;
[0187] (2) The second target rectangular piece is out of bounds, which means that the maximum x-axis coordinate of the second target rectangular piece is greater than the maximum x-axis coordinate of the rectangular envelope of the venue, or the maximum y-axis coordinate of the second target rectangular piece is greater than the maximum y-axis coordinate of the rectangular envelope of the venue. Alternatively, the second target rectangular piece collides with a rectangular block in a certain inner venue.
[0188] The above two conditions for judging whether the second target rectangular piece in the field is feasible are still applicable in the adaptive link in the subsequent crossover mutation operator.
[0189] In an optional embodiment of the present invention, a preset chain coding genetic algorithm is used to iteratively evolve the initial arrangement scheme population to obtain a target arrangement scheme population, including:
[0190] The initial arrangement scheme is encoded by using the preset chain coding genetic algorithm to obtain the encoded initial arrangement scheme; the encoded initial arrangement scheme includes the geometric information of each rectangular piece in the arrangement site and the geometric information of the rectangular pieces that have a neighbor relationship with each rectangular piece, and the geometric information of each rectangular piece that has not entered the arrangement site;
[0191] Specifically, in this embodiment, the gene information in the initial arrangement scheme after encoding includes: rectangular piece number n i , Rectangular piece length l i 、Rectangular piece width w i , the placement of rectangular pieces in the venuei , the sequence number of the rectangular piece connected to the left (left neighbor) n li The length of the rectangular piece connected to the left side is h li , the serial number of the rectangular piece connected to the right (right neighbor) n ri The length of the rectangular piece connected to the right side is h ri , the number of the rectangular piece connected to the lower side (lower neighbor) n bi Length h of the rectangular piece connected to the lower side bi , the serial number of the upper rectangular piece (upper neighbor) ti Length h of the rectangular piece connected to the upper side ti .
[0192] In the feasible solution (initial arrangement scheme) discussed in this embodiment, there can only be one of the following three relationships between the rectangular pieces in the field and between the rectangular pieces and the field: non-adjacent, left and right neighbors, and upper and lower neighbors.
[0193] In the embodiment of the present invention, it is required that in the initial arrangement scheme, the rectangular pieces in the field must have a lower neighbor and a left neighbor (which may be other rectangular pieces or the edge of the field).
[0194] For example, an initial arrangement scheme is as follows Figure 3 As shown, 101, 102, 103, 104, 105, 106, 107, and 108 respectively represent the serial numbers of the rectangular pieces to be arranged, 101, 102, 103, 104, 105, and 106 respectively represent the serial numbers of the rectangular pieces in the arrangement site, and 107 and 108 respectively represent the serial numbers of the rectangular pieces in the set of rectangular pieces that have not been successfully placed in the arrangement site corresponding to the initial arrangement plan. Figure 3 The encoded data structure for encoding the initial arrangement scheme shown is shown in Table 1.
[0195] Table 1 Encoding data structure table
[0196] serial number long Width posture Left neighbor Right Neighbor Lower Neighbor Upper Neighbor 101 3 1 1 [(000,1)] [(102,1)] [(000,3)] [(104,3)] 102 3 2 0 [(101,1),(104,2)] [(106,2)] [(000,2)] [(103,2)] 103 4 4 1 [(104,2)] [] [(102,2)] [] 104 4 3 0 [(000,4)] [(102,2),(103,2)] [(101,3)] [] 105 4 2 1 [(102,2)] [(106,2)] [(000,4)] [] 106 2.5 2 0 [(105,2)] [] [(000,2)] [] 107 6.5 1 / [] [] [] [] 108 6 3 / [] [] [] []
[0197] Among them, 000 represents the field number, a posture of 1 means that the long side of the rectangular piece is parallel to the long side of the field, a posture of 0 means that the long side of the rectangular piece is perpendicular to the long side of the field, and "[]" means that the corresponding neighbor is empty.
[0198] The initial arrangement scheme after the encoding representation is subjected to a preset number of iterative evolution processes to obtain the at least one target arrangement scheme.
[0199] In an optional embodiment of the present invention, the initial arrangement scheme after the encoding representation is subjected to a preset number of iterative evolution processing to obtain the at least one target arrangement scheme, including:
[0200] In the iterative evolution process of the first target times, the first arrangement scheme is subjected to a crossover process of a first crossover number of times to obtain a second arrangement scheme; the first crossover number of times is determined according to the preset crossover probability and the number of the first arrangement schemes;
[0201] Performing mutation processing on the third arrangement scheme according to a preset mutation probability to obtain a fourth arrangement scheme; the third arrangement scheme includes the first arrangement scheme and the second arrangement scheme;
[0202] Performing selection processing on the fourth arrangement scheme to obtain a fifth arrangement scheme corresponding to the iterative evolution processing of the first target time;
[0203] Wherein, the first target iterative evolution process is any one of the preset number of iterative evolution processes;
[0204] In the case where the first target iterative evolution process is the first iterative evolution process, the first arrangement scheme is the initial arrangement scheme after the encoding representation;
[0205] In the case where the first target time is not the first iterative evolutionary process, the first arrangement scheme is the fifth arrangement scheme corresponding to the iterative evolutionary process of the second target time, and the iterative evolutionary process of the second target time is an iterative evolutionary process before the iterative evolutionary process of the first target time;
[0206] In the case where the first target time is the last iterative evolutionary process, the fifth arrangement scheme corresponding to the first target time iterative evolutionary process is the target arrangement scheme.
[0207] Specifically, in the process of performing a preset number of iterative evolution processing on the initial arrangement scheme after the encoding representation, the following steps need to be performed in sequence for each iterative evolution processing:
[0208] A first crossover number is obtained by multiplying a preset crossover probability by a population size, and the arrangement scheme after the coding mark is crossovered for the first crossover number of times to obtain a second arrangement scheme;
[0209] Perform mutation processing on each third arrangement scheme (including the first arrangement scheme and the second arrangement scheme) with a preset mutation probability to obtain a fourth arrangement scheme;
[0210] The fourth arrangement scheme is selected.
[0211] In an embodiment of the present invention, after the initial arrangement plan is encoded, a genetic algorithm based on chain coding is executed to solve it, with the site space utilization rate as the fitness function, and crossover processing, mutation processing and selection processing are performed in each generation. After reaching the preset maximum number of evolutionary generations, the target layout plan (target arrangement plan) is obtained.
[0212] The following is a detailed description of the cross processing process:
[0213] The first arrangement scheme is cross-processed with a first cross-number of times to obtain a second arrangement scheme, including:
[0214] In the third target cross processing process (the third target cross processing is any cross processing in the first cross processing), according to the rectangular pieces with neighbor relationship in the sample arrangement field in the first target arrangement plan, the first genetic sub-scheme in the first target arrangement plan is determined, and the number of rectangular pieces contained in the first genetic sub-scheme should be half of the total number of rectangular pieces in the sample arrangement field in the first target arrangement plan;
[0215] Determine a second hereditary sub-scheme in the second target arrangement scheme according to the rectangular pieces with neighbor relationship in the arrangement site in the second target arrangement scheme, and the number of rectangular pieces contained in the second hereditary sub-scheme should be half of the total number of rectangular pieces in the arrangement site in the second target arrangement scheme;
[0216] The first target arrangement scheme and the second target arrangement scheme are any two arrangement schemes in the first arrangement scheme;
[0217] According to the rectangular pieces in the first target arrangement scheme that are located in the arrangement site and do not belong to the second genetic sub-scheme, a first crossover sub-scheme is determined according to the neighbor relationship of the rectangular pieces in the arrangement site in the first target arrangement scheme;
[0218] According to the rectangular pieces in the second target arrangement scheme that are located in the arrangement site and do not belong to the first genetic sub-scheme, a second crossover sub-scheme is determined according to the neighbor relationship of the rectangular pieces in the arrangement site in the second target arrangement scheme;
[0219] Using a preset coordinate combination point placement algorithm, the rectangular pieces in the first cross sub-scheme that inherits the local characteristics of the first target arrangement scheme are placed into the second genetic sub-scheme that inherits the local layout characteristics of the second target arrangement scheme, and the rectangular pieces in the second cross sub-scheme that inherits the local layout characteristics of the second target arrangement scheme are placed into the first genetic sub-scheme that inherits the local layout characteristics of the first target arrangement scheme, to obtain a second arrangement scheme.
[0220] For example, see Figure 4 and Figure 5 , Figure 4 This is a schematic diagram of the first target arrangement scheme (parent 1). Figure 5 is a schematic diagram of the second target arrangement scheme (parent 1), wherein, Figure 4 As shown, in the first target arrangement scheme, the rectangular pieces located in the arrangement site include rectangular piece 1, rectangular piece 2, rectangular piece 3, rectangular piece 4, rectangular piece 5, rectangular piece 6 and rectangular piece 7, and the set of rectangular pieces that have not been successfully placed in the arrangement site includes rectangular piece 8, as shown in FIG. Figure 5 As shown, in the second target arrangement scheme, the rectangular pieces located in the arrangement site include rectangular piece 1, rectangular piece 3, rectangular piece 4, rectangular piece 5, rectangular piece 6, rectangular piece 7 and rectangular piece 8, and the set of rectangular pieces that have not been successfully placed in the arrangement site includes rectangular piece 2. About half of the rectangular pieces that have neighbor relationships with each other in the first target arrangement scheme are determined as the first genetic sub-scheme, that is, the genetic sub-scheme from parent 1 to offspring 1, as shown in FIG. Figure 6 As shown, the first target arrangement scheme corresponds to the first genetic sub-scheme including rectangular pieces 1, 2 and 3, and about half of the rectangular pieces that have neighbor relationships with each other in the second target arrangement scheme are determined as the second genetic sub-scheme, that is, the genetic sub-scheme from parent 2 to offspring 2, as shown in Figure 7 As shown, the second genetic sub-scheme corresponding to the second target arrangement scheme includes rectangular piece 8, rectangular piece 5 and rectangular piece 3.
[0221] Afterwards, the rectangular pieces (rectangular piece 6, rectangular piece 7, rectangular piece 1, rectangular piece 2, rectangular piece 4) in the first target arrangement scheme that are located in the arrangement site and do not belong to the second genetic sub-scheme retain the original neighbor relationship in the first target arrangement scheme to obtain the following Figure 8 The first crossover sub-scheme shown is the crossover sub-scheme from parent 1 to parent 2; the rectangular pieces (rectangular piece 7, rectangular piece 6, rectangular piece 4, rectangular piece 5, rectangular piece 8) in the second target arrangement scheme that are located in the arrangement site and do not belong to the first inheritance sub-scheme retain the original neighbor relationship in the second target arrangement scheme to obtain the following Fig. 9 The second crossover sub-plan shown is the crossover sub-plan from parent 2 to parent 1.
[0222] Using the above-mentioned preset coordinate combination point placement algorithm, the rectangular pieces in the first cross sub-scheme are placed in the second genetic sub-scheme, and the rectangular pieces in the second cross sub-scheme are placed in the first genetic sub-scheme to obtain a second arrangement scheme;
[0223] Further, using a preset coordinate combination point placement algorithm, the rectangular pieces in the first crossover sub-scheme are placed in the second inheritance sub-scheme, and the rectangular pieces in the second crossover sub-scheme are placed in the first inheritance sub-scheme, to obtain a second arrangement scheme, including:
[0224] Using a preset coordinate combination point placement algorithm, the rectangular pieces in the first cross sub-scheme are placed in the second inheritance sub-scheme, and a third target rectangular piece whose placement is not feasible is determined;
[0225] Adaptively process the third target rectangular piece to obtain a sixth arrangement scheme;
[0226] Determine a fourth target rectangular piece corresponding to the sixth arrangement scheme and located in the set of sites that have not entered the arrangement site;
[0227] Using a preset coordinate combination point placement algorithm, each of the fourth target rectangular pieces is placed in the arrangement site in turn to obtain the second arrangement scheme;
[0228] Using a preset coordinate combination point placement algorithm, the rectangular pieces in the second cross sub-scheme are placed in the first genetic sub-scheme, and a fifth target rectangular piece whose placement is not feasible is determined;
[0229] Adaptively process the fifth target rectangular piece to obtain a seventh arrangement scheme;
[0230] Determine a sixth target rectangular piece corresponding to the seventh arrangement scheme and located in the set of sites that have not entered the arrangement site;
[0231] Using a preset coordinate combination point placement algorithm, each of the sixth target rectangular pieces is placed in the arrangement site in turn to obtain the second arrangement scheme.
[0232] It should also be noted that the first crossover sub-scheme and the second crossover sub-scheme may include multiple rectangular piece clusters according to the neighbor relationship of the rectangular pieces. Therefore, further, in this embodiment, the specific process of crossover processing is as follows:
[0233] According to the neighbor relationship of the rectangular pieces in the arrangement field in the first target arrangement scheme, the rectangular pieces in the first intersection sub-scheme are divided into at least one first rectangular piece cluster;
[0234] Using a preset coordinate combination point placement algorithm, try to place the first rectangular piece clusters into the second genetic sub-scheme one by one, at this time, only the lower left corner rectangular piece in the current rectangular piece cluster is required to be feasible, and other rectangular pieces are not guaranteed to be feasible, and determine the third target rectangular piece whose placement is not feasible for each of the first rectangular piece clusters;
[0235] Adaptively process the third target rectangular piece to obtain a sixth arrangement scheme;
[0236] Specifically, each time a first rectangular cluster is placed, an adaptive process is performed, and then the next first rectangular cluster is placed, and the adaptive process is performed again, until all first rectangular clusters are tried to be placed in the sample arrangement sites corresponding to the second genetic sub-schemes respectively placed, and all are adaptively processed;
[0237] Determine a fourth target rectangular piece corresponding to the sixth arrangement scheme and located in the set of sites that have not entered the arrangement site;
[0238] Using a preset coordinate combination point placement algorithm, try to place each of the fourth target rectangular pieces into the arrangement site in turn, and finally obtain the second arrangement scheme.
[0239] According to the neighbor relationship of the rectangular pieces in the arrangement field in the second target arrangement scheme, the rectangular pieces in the second cross sub-scheme are divided into at least one second rectangular piece cluster;
[0240] Using a preset coordinate combination point placement algorithm, try to place the second rectangular piece clusters into the first genetic sub-scheme one by one, at this time, only the lower left corner rectangular piece in the current rectangular piece cluster is required to be feasible, and other rectangular pieces are not guaranteed to be feasible, and determine the fifth target rectangular piece corresponding to each second rectangular piece cluster that is not feasible to place;
[0241] Adaptively process the fifth target rectangular piece to obtain a seventh arrangement scheme;
[0242] Specifically, each time a second rectangular cluster is placed, an adaptive process is performed, and then the next second rectangular cluster is placed, and the adaptive process is performed again, until all the second rectangular clusters are tried to be placed in the sample arrangement sites corresponding to the first genetic sub-schemes respectively placed, and all are adaptively processed;
[0243] Determine a sixth target rectangular piece corresponding to the seventh arrangement scheme and located in the set of sites that have not entered the arrangement site;
[0244] Using a preset coordinate combination point placement algorithm, try to place each of the sixth target rectangular pieces into the arrangement site in turn, and finally obtain the second arrangement scheme.
[0245] Furthermore, the adaptive processing further includes:
[0246] In the case where the first target piece is a rectangular piece partially located outside the arrangement site, the first target piece is placed in the set that does not enter the arrangement site corresponding to the third target arrangement scheme;
[0247] In the case where the first target part overlaps with the second target part, according to the principle of minimum moving distance, the first target part or the second target part is moved according to one of the following moving methods until the first target part is in contact with the second target part: moving the first target part along the first rectangular side in a direction away from the first target corner point; moving the first target part along the second rectangular side in a direction away from the first target corner point; moving the second target part along the first rectangular side in a direction away from the first target corner point; moving the second target part along the second rectangular side in a direction away from the first target corner point; illustratively, in this embodiment, there are two specific implementation methods, the first is to determine the rectangular part located on the right side of the first target part and the second target part, and determine that the rectangular part located on the right side is moved right until the first target part and the second target part do not overlap (the The first target part fits with the second target part), even if the first target part and the second target part become left and right neighbors, the distance that the rectangular part on the right moves to the right, the second is to determine the rectangular part on the upper side of the first target part and the second target part, and determine that the rectangular part on the upper side moves up until the first target part and the second target part do not overlap (the first target part and the second target part fit), even if the first target part and the second target part become upper and lower neighbors, the distance that the rectangular part on the upper side moves up, if the rightward movement distance is less than the upward movement distance, then the moving method described in the first implementation method is selected, if the rightward movement distance is greater than or equal to the upward movement distance, then the moving method described in the second implementation method is selected, in short, the movement is performed according to the principle of minimum movement distance until the first target part and the second target part fit together;
[0248] When the first rectangular side of the first target piece does not fit with the boundary of the sample arrangement site or other rectangular pieces except the first target piece, or the second rectangular side of the first target piece does not fit with the boundary of the sample arrangement site or other rectangular pieces except the first target piece, the first target piece is moved rightward or upward in a direction parallel to or perpendicular to the long side of the site according to the principle of minimum moving distance until it just fits with the boundary of the sample arrangement site or other rectangular pieces except the first target piece;
[0249] Wherein, the first target piece is any one of the third target rectangular piece and the fourth target rectangular piece;
[0250] In the case where the first target piece is any rectangular piece among the third target rectangular pieces, the third target arrangement scheme is the sixth arrangement scheme, and the second target piece is any rectangular piece among the third target rectangular pieces except the first target piece;
[0251] In the case where the first target piece is any rectangular piece among the fourth target rectangular pieces, the third target arrangement scheme is the seventh arrangement scheme, and the second target piece is any rectangular piece among the fourth target rectangular pieces except the first target piece.
[0252] It should also be noted that in the adaptive processing, each rectangular piece in the field needs to be checked separately to see if the above three situations exist. If so, the corresponding adjustment of the first target piece and other rectangular pieces may cause new unfeasible situations, so it is necessary to recheck and adjust continuously. When none of the above three situations occur in a certain traversal check of the rectangular pieces in the field, the adaptive process ends, and the obtained arrangement plan must be feasible.
[0253] For example, according to Figure 5 The neighbor relationship of the rectangular pieces in the arrangement field in the second target arrangement scheme shown in FIG. Fig. 9 The rectangular pieces in the second cross sub-scheme shown are divided into a second rectangular piece cluster (including rectangular piece 8, rectangular piece 5, rectangular piece 7, rectangular piece 6, and rectangular piece 4). The rectangular pieces in the second rectangular piece cluster are placed as shown in FIG. Figure 6 In the sample arrangement of the first genetic sub-scheme shown, the following is obtained: Fig.10 The arrangement shown is as follows Fig.10 As shown in FIG. 1 , the third target rectangular pieces determined to be unfeasible to place include rectangular piece 7, rectangular piece 6, and rectangular piece 4, wherein rectangular piece 7, rectangular piece 6, and rectangular piece 4 are partially located outside the venue, which is an out-of-bounds situation. The above adaptive processing is performed on the above rectangular piece 7, rectangular piece 6, and rectangular piece 4, and the following is obtained: Fig.11 The sixth arrangement scheme is shown, wherein in the sixth arrangement scheme, the rectangular pieces located in the arrangement site include rectangular piece 1, rectangular piece 2, rectangular piece 3, rectangular piece 4, rectangular piece 5 and rectangular piece 8, and the rectangular pieces in the set of rectangular pieces that have not successfully entered the arrangement site include rectangular piece 7, rectangular piece 6 and rectangular piece 4, and the neighbor relationship between rectangular piece 7, rectangular piece 6 and rectangular piece 4 is cancelled. For each of rectangular pieces 7, rectangular piece 6 and rectangular piece 4, according to the above-mentioned coordinate combination point placement algorithm, rectangular piece 7, rectangular piece 6 and rectangular piece 4 are sequentially tried to be placed in the arrangement site corresponding to the sixth arrangement scheme. As a result, rectangular piece 7 and rectangular piece 6 are successfully placed in the site, while rectangular piece 4 is not successfully placed in the site, and the following is obtained. Fig.12 The second arrangement shown is progeny 1;
[0254] According to Figure 4 The neighbor relationship of the rectangular pieces in the arrangement field in the first target arrangement scheme shown in FIG. Figure 8The rectangular pieces in the first cross sub-scheme shown are divided into two first rectangular piece clusters, and the two first rectangular piece clusters respectively include: (1) rectangular piece 1, rectangular piece 2, rectangular piece 6, rectangular piece 7; (2) rectangular piece 4.
[0255] Using the above coordinate combination point placement algorithm, the first rectangular piece cluster (including rectangular piece 1, rectangular piece 2, rectangular piece 6, and rectangular piece 7) in the first cross sub-scheme is placed as follows: Figure 7 In the sample arrangement of the second genetic sub-scheme shown, the following is obtained: Fig.13 The arrangement shown is as follows Fig.13 As shown, the third target rectangular piece determined to be unfeasible to place includes rectangular piece 6 and rectangular piece 7, wherein rectangular piece 6 lacks a left neighbor and a bottom neighbor, and rectangular piece 7 is out of bounds. The above-mentioned adaptive processing is performed on the above-mentioned rectangular pieces 6 and 7, wherein the adaptive processing first moves rectangular piece 6 downward until it just encounters rectangular piece 2, so that rectangular piece 2 becomes the bottom neighbor of rectangular piece 6, and then moves rectangular piece 6 to the left until it just encounters the boundary of the field, so that the boundary of the field becomes the left neighbor of rectangular piece 6. Next, it is detected that both rectangular piece 6 and rectangular piece 7 are out of bounds, so rectangular piece 6 and rectangular piece 7 are taken away. The last global detection does not find any unfeasible places, and the adaptive processing ends. Then another rectangular piece cluster (including rectangular piece 4) is placed in the arrangement field of the second genetic sub-scheme, and it can be found that the placement of rectangular piece 4 is feasible as shown below. Fig.14 The seventh arrangement scheme is shown, wherein in the seventh arrangement scheme, the rectangular pieces located in the arrangement site include rectangular piece 1, rectangular piece 2, rectangular piece 3, rectangular piece 8, rectangular piece 5, rectangular piece 4 and rectangular piece 3, and the rectangular pieces in the set of rectangular pieces that have not successfully entered the arrangement site include rectangular piece 6 and rectangular piece 7, and the neighbor relationship between rectangular piece 6 and rectangular piece 7 is cancelled. For each of rectangular pieces 6 and 7, according to the above-mentioned coordinate combination point placement algorithm, rectangular piece 6, rectangular piece 7 and rectangular piece 4 are sequentially tried to be placed in the arrangement site corresponding to the seventh arrangement scheme, and as a result, rectangular piece 6 is successfully placed in the site, while rectangular piece 7 is not successfully placed in the site, and the following is obtained. Fig.15 The second arrangement shown is that of Offspring 2.
[0256] It should be noted that the roles played by the two parent solutions in generating sub-solutions are not equivalent, so at each crossover, two sub-solutions are generated each time, with the two parent solutions being used as the "first parent" and "second parent" to retain their general number of rectangular pieces layout.
[0257] The following is a detailed description of the mutation process:
[0258] The third arrangement scheme is mutated according to a preset mutation probability to obtain a fourth arrangement scheme, including:
[0259] According to the preset variation probability, the seventh target rectangular piece in the third target arrangement scheme is rotated by a preset angle to obtain an eighth arrangement scheme; wherein the third target arrangement scheme is any arrangement scheme in the third arrangement scheme; and the seventh target rectangular piece is a rectangular piece randomly selected from the arrangement site of the third target arrangement scheme;
[0260] Determine an eighth target rectangular piece that is not feasible to place in the eighth arrangement scheme;
[0261] Adaptively process the eighth target rectangular piece to obtain a ninth arrangement scheme;
[0262] Determine a ninth target rectangular piece corresponding to the ninth arrangement scheme and located in the set of sites that have not entered the arrangement site;
[0263] By using a preset coordinate combination point placement algorithm, each of the ninth target rectangular pieces is placed in the arrangement site in turn to obtain the fourth arrangement scheme.
[0264] Furthermore, the eighth target rectangular piece is adaptively processed to obtain a ninth arrangement scheme, including:
[0265] In the case where the third target piece is a rectangular piece partially located outside the arrangement site, the third target piece is placed in the set that does not enter the arrangement site corresponding to the ninth target arrangement scheme;
[0266] When the third target part overlaps with the fourth target part, according to the principle of minimum moving distance, the first target part or the second target part is moved according to one of the following moving methods until the first target part is in contact with the second target part: the first target part is moved along the first rectangular side in a direction away from the first target corner point; the first target part is moved along the second rectangular side in a direction away from the first target corner point; the second target part is moved along the first rectangular side in a direction away from the first target corner point; the second target part is moved along the second rectangular side in a direction away from the first target corner point; illustratively, in this embodiment, there are two specific implementation methods. The first is to determine the rectangular part located on the right side of the third target part and the fourth target part, and determine that the rectangular part located on the right side is moved rightward until the third target part and the fourth target part do not overlap (the The third target part is fitted with the fourth target part), even if the third target part and the fourth target part become left and right neighbors, the distance that the rectangular part located on the right side moves to the right, the second method is to determine the rectangular part located on the upper side of the third target part and the fourth target part, and determine that the rectangular part located on the upper side moves up until the third target part and the fourth target part do not overlap (the third target part and the fourth target part are fitted), even if the third target part and the fourth target part become upper and lower neighbors, the distance that the rectangular part located on the upper side moves up, if the distance of the right movement is less than the distance of the upward movement, the moving method described in the first implementation method is selected, if the distance of the right movement is greater than or equal to the distance of the upward movement, the moving method described in the second implementation method is selected, in short, the movement is carried out according to the principle of minimum movement distance until the third target part and the fourth target part are fitted;
[0267] When the first rectangular side of the third target piece does not fit with the boundary of the sample arrangement site or other rectangular pieces except the third target piece, or the second rectangular side of the third target piece does not fit with the boundary of the sample arrangement site or other rectangular pieces except the third target piece, the third target piece is moved rightward or upward in a direction parallel to or perpendicular to the long side of the site according to the principle of minimum moving distance until it just fits with the boundary of the sample arrangement site or other rectangular pieces except the third target piece;
[0268] The third target part is any rectangular part among the eighth target rectangular parts, and the fourth target part is any rectangular part among the eighth target rectangular parts except the third target part.
[0269] It should also be noted that in the adaptive processing, each rectangular piece in the field needs to be checked separately to see if the above three situations exist. If so, the corresponding adjustment of the second target piece and other rectangular pieces may cause new unfeasible situations, so it is necessary to recheck and adjust continuously. When none of the above three situations occurs in a certain traversal check of the rectangular pieces in the field, the adaptive process ends, and the obtained ninth arrangement scheme must be feasible.
[0270] Specifically, Fig.16 As shown, Fig.16 This is a schematic diagram of the third target arrangement scheme, such as Fig.16 As shown, the rectangular pieces in the arrangement site include rectangular piece 101, rectangular piece 102, rectangular piece 103, rectangular piece 104, rectangular piece 104 and rectangular piece 106. The rectangular pieces in the set of rectangular pieces that have not been successfully placed in the arrangement site include rectangular piece 107 and rectangular piece 108. A rectangular piece (the seventh target rectangular piece) is randomly selected. In this embodiment, rectangular piece 104 is selected to rotate 90° (i.e., change the placement posture). Before and after the rotation, the position coordinates of the lower left corner of the second target rectangular piece are kept unchanged, and the following is obtained: Fig.17 The eighth arrangement scheme shown in the figure determines that the eighth target rectangular pieces that are not feasible to place in the eighth arrangement scheme include rectangular piece 102, rectangular piece 104 and rectangular piece 107, and the above-mentioned adaptive processing is performed on the arrangement of the rectangular pieces in the current field, that is, all the rectangular pieces in the arrangement field are checked one by one (including checking whether the rectangular pieces in the arrangement field are out of bounds or partially out of bounds, whether the rectangular pieces in the arrangement field collide with each other, and whether the first rectangular sides and second rectangular sides of the rectangular pieces in the arrangement field are aligned with other rectangular pieces or the edge of the field), and it is known that the placement of rectangular pieces 102, rectangular pieces 104 and rectangular pieces 107 is not feasible, and adaptive processing is performed on each rectangular piece that is not feasible to place according to the above-mentioned adaptive process, until at a certain inspection, all the rectangular pieces in the arrangement field are feasible, and no rectangular pieces need to be moved or adjusted, then the adaptive processing ends, and the result is as shown in the figure. Fig.18 The ninth arrangement scheme shown is feasible as a whole. It is determined that the ninth target rectangular pieces that have not entered the arrangement site set in the ninth arrangement scheme include rectangular pieces 107 and 108. Using the above-mentioned coordinate combination point placement algorithm, rectangular pieces 107 and 108 are tried to be placed in the arrangement site corresponding to the ninth arrangement scheme in turn. As a result, rectangular piece 108 is successfully placed, while rectangular piece 107 is not successfully placed, and the following is obtained: Fig.19 The fourth arrangement shown.
[0271] The following is a detailed description of the selection process:
[0272] In an optional embodiment of the present invention, the fourth arrangement scheme is selected to obtain a fifth arrangement scheme corresponding to the first target iterative evolution process, including:
[0273] Determining the site space utilization rate of each of the fourth arrangement schemes;
[0274] According to the site space utilization rate of each of the fourth arrangement schemes, a roulette wheel selection process is performed on the fourth arrangement schemes to obtain a tenth arrangement scheme;
[0275] Sorting the site space utilization rates of each of the fourth arrangement schemes in descending order, and determining an eleventh arrangement scheme that is within the first preset ratio and is not within the tenth arrangement scheme;
[0276] According to the tenth arrangement scheme and the eleventh arrangement scheme, the fifth arrangement scheme is obtained.
[0277] Preferably, in this optional embodiment, when performing the selection process, the site space utilization rate corresponding to each fourth arrangement scheme is determined as the fitness of the fourth arrangement scheme. A roulette wheel selection is performed according to the size of the fitness corresponding to each fourth arrangement scheme, that is, according to the site space utilization rate of each fourth arrangement scheme and a corresponding randomly generated number between 0 and 1, if the site space utilization rate of the fourth arrangement scheme is greater than the randomly generated number, the fourth arrangement scheme is retained, otherwise the fourth arrangement scheme is eliminated. In addition, an elite retention strategy of the top 10% of the site space utilization rate is adopted, and the top 10% of the initial arrangement schemes of the site space utilization rate are retained to obtain the next generation population, that is, preferably, the first preset ratio is 10%.
[0278] In an optional embodiment of the present invention, the method further includes:
[0279] The final arrangement scheme is decoded to obtain a decoded final arrangement scheme.
[0280] In this embodiment, after the initial layout plan is encoded using a chain genetic algorithm and subjected to crossover, mutation and selection processing, a target layout plan is obtained, and after the final layout plan is obtained according to the site utilization rate, the final layout plan is decoded to obtain the final rectangular piece layout result.
[0281] Furthermore, the final arrangement scheme is decoded to obtain the decoded final arrangement scheme, including:
[0282] The second target corner point of the arrangement site is taken as the origin, and the decoded final arrangement plan is obtained according to the geometric information of the rectangular pieces in the arrangement site and the neighbor relationship of the rectangular pieces in the arrangement site in the final arrangement plan.
[0283] Preferably, in the decoding link, the second target corner point is the lower left corner point, that is, the lower left corner point of the site envelope is taken as the origin (0,0), and the coordinates of the four vertices of all rectangular pieces in the site are to be obtained. For each rectangular piece in the site, the horizontal coordinate of the lower left corner point of the current rectangular piece is obtained by continuously tracing back the rectangular piece of its left neighbor until it reaches the site and stops, and the horizontal length of its left neighbor (the length of the side parallel to the x-axis) is accumulated in the process. The vertical coordinate of the lower left corner point of the current rectangular piece is obtained by continuously tracing back the lower neighbor until it reaches the site and stops, and the vertical coordinate of the lower neighbor (the length of the side parallel to the y-axis) is accumulated in the process. The coordinates of the remaining three vertices can be easily obtained based on the horizontal length and vertical length of the current rectangular piece itself. Output the current final solution of the rectangular piece layout, that is, the final arrangement plan after decoding.
[0284] Combine the following Fig. 20 , specifically describes the process of the rectangular piece arrangement method based on genetic algorithm provided by an embodiment of the present invention:
[0285] The geometric information of the rectangular pieces and the layout site is obtained, and the initial layout population is randomly generated. After chain coding (the initial layout population is encoded by the chain coding method), crossover, mutation, and selection are performed until the maximum evolutionary generation (maximum number of iterations) is reached, and the final solution (final layout plan) is determined. Finally, the layout plan of the rectangular pieces in the horizontal and vertical site is decoded, and the coordinate data and diagram of the current final solution are output.
[0286] The embodiments of the present invention can be applied to the production planning and scheduling of ship curved surface segmentation production workshops, and can also be applied to the rectangular or cuboid packing problem at the abstract geometric level, and can obtain a layout solution with high space utilization, meeting the needs of enterprises to reduce costs and improve efficiency.
[0287] The embodiment of the present invention is different from the traditional method of using genetic algorithm to optimize the sequence and then placing the segments one by one according to the heuristic rules. A rectangular segment layout method based on chain coding genetic algorithm is proposed, and the placement position of the rectangular segments is creatively encoded using a linked list method. At the same time, a coordinate combination point algorithm, a semi-conservative crossover strategy and an adaptive adjustment algorithm are proposed to respectively realize the efficient generation, evolution and maintenance of the solution represented by the chain coding, thereby realizing a better application of the genetic algorithm in the rectangular layout problem, and is a high-quality layout algorithm.
[0288] like Fig.21 As shown, the embodiment of the present invention also provides a rectangular piece arrangement device based on genetic algorithm, which is characterized by comprising:
[0289] The first processing module 2101 is used to generate an initial arrangement scheme population according to geometric information of a plurality of rectangular pieces to be arranged and geometric information of a rectangular arrangement site, wherein the initial arrangement scheme population includes at least one initial arrangement scheme;
[0290] The second processing module 2102 is used to use a preset chain coding genetic algorithm to perform iterative evolution processing on each of the initial arrangement schemes to obtain a target arrangement scheme population, wherein the target arrangement scheme population includes at least one target arrangement scheme;
[0291] The determination module 2103 is used to determine a final arrangement scheme among the target arrangement schemes according to the site space utilization rate corresponding to each of the target arrangement schemes.
[0292] Optionally, the geometric information of the arrangement site includes the geometric information of the entire arrangement site and the geometric information of an inner site in the arrangement site that cannot be used to arrange the rectangular pieces to be arranged;
[0293] The first processing module 2101 includes:
[0294] A first generating unit is used to randomly generate at least one rectangular piece sequence from the plurality of rectangular pieces to be arranged;
[0295] The second generating unit is used to generate one of the initial arrangement schemes in the population of initial arrangement schemes by using a preset coordinate combination point placement algorithm according to the overall geometric information of the arrangement site, the geometric information of the inner site, the geometric information of the rectangular pieces to be arranged and a sequence of the rectangular pieces.
[0296] Optionally, the second generating unit is specifically configured to:
[0297] Determine at least one first position coordinate according to the geometric information of the first target rectangular piece, the geometric information of the entire arrangement field and the geometric information of the inner field;
[0298] Sorting at least one first position coordinate according to a preset order to obtain a first coordinate sequence;
[0299] Generate an initial arrangement plan according to the first coordinate sequence, the geometric information of the second target rectangular piece, the geometric information of the entire arrangement site and the geometric information of the inner site;
[0300] Wherein, the first target rectangular piece is a rectangular piece in the rectangular piece sequence and is located in the sample arrangement area;
[0301] The second target rectangular piece is the first rectangular piece in the rectangular piece sequence that is not located in the arrangement site and is to be arranged.
[0302] Optionally, the second generating unit is specifically configured to:
[0303] Determine the placement of the second target rectangular piece according to the first coordinate sequence, the geometric information of the second target rectangular piece, the geometric information of the entire arrangement site, and the geometric information of the inner site;
[0304] When the placement situation indicates that the placement of the second target rectangular piece is feasible, determining to place the second target rectangular piece in the arrangement site;
[0305] When the placement situation indicates that the placement of the second target rectangular piece is not feasible, determining to place the second target rectangular piece into the set of sites that have not entered the arrangement site;
[0306] An initial arrangement scheme is obtained according to the geometric information of the rectangular pieces in the arrangement area, the geometric information of the rectangular pieces adjacent to each rectangular piece in the arrangement area, and the geometric information of the rectangular pieces that are not in the arrangement area set.
[0307] Optionally, the second generating unit is specifically configured to:
[0308] Sequentially taking the first position coordinates in the first coordinate sequence as the first target corner coordinates of the second target rectangular object, and for each of the first position coordinates, placing the second target rectangular object into the arrangement site in a first preset posture and a second preset posture respectively;
[0309] When the second target rectangular piece satisfies the first condition, determining that the placement of the second target rectangular piece is feasible;
[0310] When the second target rectangular piece satisfies at least one of the second conditions, it is indeed not feasible to place the second target rectangular piece;
[0311] The first condition includes:
[0312] The second target rectangular piece is located in the sample arrangement field and does not collide with the inner field;
[0313] The first rectangular side of the second target rectangular piece is adjacent to the edge of the first target rectangular piece, the edge of the sample arrangement field, or the edge of the inner field;
[0314] The second rectangular side of the second target rectangular piece is adjacent to the edge of the first target rectangular piece, the edge of the sample arrangement field, or the edge of the inner field;
[0315] The second target rectangular piece does not collide with any of the first target rectangular pieces; the second condition includes:
[0316] The second target rectangular piece exceeds the edge of the sample arrangement site;
[0317] The second target rectangular piece collides with the inner field;
[0318] The first rectangular side of the second target rectangular piece is not adjacent to the edge of the first target rectangular piece, the edge of the sample arrangement field, or the edge of the inner field;
[0319] The second rectangular side of the second target rectangular piece is not adjacent to the edge of the first target rectangular piece, the edge of the sample arrangement field, or the edge of the inner field;
[0320] The second target rectangular piece collides with any one of the first target rectangular pieces; wherein the first rectangular side and the second rectangular side are rectangular sides adjacent to the first target corner point.
[0321] Optionally, the second processing module 2102 includes:
[0322] The first processing unit is used to encode the initial arrangement plan by using the preset chain coding genetic algorithm to obtain the initial arrangement plan after encoding; the initial arrangement plan after encoding includes the geometric information of each rectangular piece in the arrangement site and the geometric information of the rectangular pieces that have a neighbor relationship with each rectangular piece, and the geometric information of each rectangular piece that has not entered the arrangement site;
[0323] The second processing unit is used to perform a preset number of iterative evolution processing on the initial arrangement scheme after the encoding representation to obtain the at least one target arrangement scheme.
[0324] Optionally, the second processing unit is specifically configured to:
[0325] In the iterative evolution process of the first target times, the first arrangement scheme is subjected to a crossover process of a first crossover number of times to obtain a second arrangement scheme; the first crossover number of times is determined according to the preset crossover probability and the number of the first arrangement schemes;
[0326] Performing mutation processing on the third arrangement scheme according to a preset mutation probability to obtain a fourth arrangement scheme; the third arrangement scheme includes the first arrangement scheme and the second arrangement scheme;
[0327] Performing selection processing on the fourth arrangement scheme to obtain a fifth arrangement scheme corresponding to the iterative evolution processing of the first target time;
[0328] Wherein, the first target iterative evolution process is any one of the preset number of iterative evolution processes;
[0329] In the case where the first target iterative evolution process is the first iterative evolution process, the first arrangement scheme is the initial arrangement scheme after the encoding representation;
[0330] In the case where the first target time is not the first iterative evolutionary process, the first arrangement scheme is the fifth arrangement scheme corresponding to the iterative evolutionary process of the second target time, and the iterative evolutionary process of the second target time is an iterative evolutionary process before the iterative evolutionary process of the first target time;
[0331] In the case where the first target time is the last iterative evolutionary process, the fifth arrangement scheme corresponding to the first target time iterative evolutionary process is the target arrangement scheme.
[0332] Optionally, the second processing unit is specifically configured to:
[0333] In the third target cross processing process, according to the rectangular pieces with neighbor relationship in the arrangement field in the first target arrangement scheme, the first hereditary sub-scheme in the first target arrangement scheme is determined;
[0334] Determine a second genetic sub-scheme in the second target arrangement scheme according to the rectangular pieces having a neighbor relationship in the arrangement site in the second target arrangement scheme;
[0335] Determine a first crossover sub-scheme according to the neighbor relationship between the rectangular pieces in the first target arrangement scheme that are located in the arrangement site and do not belong to the second genetic sub-scheme and the rectangular pieces in the arrangement site in the first target arrangement scheme;
[0336] Determine a second crossover sub-scheme according to the neighbor relationship between the rectangular pieces in the second target arrangement scheme that are located in the arrangement site and do not belong to the first genetic sub-scheme and the rectangular pieces in the arrangement site in the second target arrangement scheme;
[0337] Using a preset coordinate combination point placement algorithm, the rectangular pieces in the first crossover sub-scheme are placed in the second inheritance sub-scheme, and the rectangular pieces in the second crossover sub-scheme are placed in the first inheritance sub-scheme, to obtain a second arrangement scheme;
[0338] Wherein, the first target arrangement scheme and the second target arrangement scheme are any two arrangement schemes in the first arrangement scheme;
[0339] The third target number of cross processing is any one of the first number of cross processing.
[0340] Optionally, the second processing unit is specifically configured to:
[0341] Using a preset coordinate combination point placement algorithm, the rectangular pieces in the first cross sub-scheme are placed in the second inheritance sub-scheme, and a third target rectangular piece whose placement is not feasible is determined;
[0342] Adaptively process the third target rectangular piece to obtain a sixth arrangement scheme;
[0343] Determine a fourth target rectangular piece corresponding to the sixth arrangement scheme and located in the set of sites that have not entered the arrangement site;
[0344] Using a preset coordinate combination point placement algorithm, each of the fourth target rectangular pieces is placed in the arrangement site in turn to obtain the second arrangement scheme;
[0345] Using a preset coordinate combination point placement algorithm, the rectangular pieces in the second cross sub-scheme are placed in the first genetic sub-scheme, and a fifth target rectangular piece whose placement is not feasible is determined;
[0346] Adaptively process the fifth target rectangular piece to obtain a seventh arrangement scheme;
[0347] Determine a sixth target rectangular piece corresponding to the seventh arrangement scheme and located in the set of sites that have not entered the arrangement site;
[0348] Using a preset coordinate combination point placement algorithm, each of the sixth target rectangular pieces is placed in the arrangement site in turn to obtain the second arrangement scheme.
[0349] Optionally, the second processing unit is specifically configured to:
[0350] According to the neighbor relationship of the rectangular pieces in the arrangement field in the first target arrangement scheme, the rectangular pieces in the first intersection sub-scheme are divided into at least one first rectangular piece cluster;
[0351] Using a preset coordinate combination point placement algorithm, the first rectangular component clusters are placed in the second genetic sub-scheme respectively, and the third target rectangular component whose placement is not feasible is determined for each of the first rectangular component clusters;
[0352] The second processing unit is specifically configured to:
[0353] According to the neighbor relationship of the rectangular pieces in the arrangement field in the second target arrangement scheme, the rectangular pieces in the second cross sub-scheme are divided into at least one second rectangular piece cluster;
[0354] The second rectangular component clusters are placed in the first genetic sub-scheme respectively by using a preset coordinate combination point placement algorithm, and the fifth target rectangular component whose placement is not feasible corresponding to each second rectangular component cluster is determined.
[0355] Optionally, the second processing unit is further specifically configured to:
[0356] In the case where the first target piece is a rectangular piece partially located outside the arrangement site, the first target piece is placed in the set that does not enter the arrangement site corresponding to the third target arrangement scheme;
[0357] In the case where the first target part overlaps with the second target part, according to the principle of minimum moving distance, the first target part or the second target part is moved according to one of the following moving methods until the first target part and the second target part are attached to each other: the first target part is moved along the first rectangular side in a direction away from the first target corner point; the first target part is moved along the second rectangular side in a direction away from the first target corner point; the second target part is moved along the first rectangular side in a direction away from the first target corner point; the second target part is moved along the second rectangular side in a direction away from the first target corner point;
[0358] When the first rectangular side of the first target part does not fit with the boundary of the sample arrangement site or other rectangular parts except the first target part, or the second rectangular side of the first target part does not fit with the boundary of the sample arrangement site or other rectangular parts except the first target part, the first target part is moved to fit with the boundary of the sample arrangement site or other rectangular parts except the first target part according to the principle of minimum moving distance;
[0359] Wherein, the first target piece is any one of the third target rectangular piece and the fourth target rectangular piece;
[0360] In the case where the first target piece is any rectangular piece among the third target rectangular pieces, the third target arrangement scheme is the sixth arrangement scheme, and the second target piece is any rectangular piece among the third target rectangular pieces except the first target piece;
[0361] In the case where the first target piece is any rectangular piece among the fourth target rectangular pieces, the third target arrangement scheme is the seventh arrangement scheme, and the second target piece is any rectangular piece among the fourth target rectangular pieces except the first target piece.
[0362] Optionally, the second processing unit is specifically configured to:
[0363] According to the preset mutation probability, the seventh target rectangular piece in the third target arrangement scheme is rotated by a preset angle to obtain an eighth arrangement scheme; the seventh target rectangular piece is any rectangular piece in the arrangement site corresponding to the third target arrangement scheme;
[0364] Determine an eighth target rectangular piece that is not feasible to place in the eighth arrangement scheme;
[0365] Adaptively process the eighth target rectangular piece to obtain a ninth arrangement scheme;
[0366] Determine a ninth target rectangular piece corresponding to the ninth arrangement scheme and located in the set of sites that have not entered the arrangement site;
[0367] Using a preset coordinate combination point placement algorithm, each of the ninth target rectangular pieces is placed in the arrangement site in turn to obtain the fourth arrangement scheme;
[0368] Among them, the third target arrangement scheme is any arrangement scheme among the third arrangement schemes.
[0369] Optionally, the second processing unit is specifically configured to:
[0370] In the case where the third target piece is a rectangular piece partially located outside the arrangement site, the third target piece is placed in the set that does not enter the arrangement site corresponding to the ninth target arrangement scheme;
[0371] In the case where the third target part overlaps with the fourth target part, according to the principle of minimum moving distance, the third target part or the fourth target part is moved according to one of the following moving methods until the third target part is in contact with the fourth target part: moving the third target part along the first rectangular side toward a direction away from the first target corner point; moving the third target part along the second rectangular side toward a direction away from the first target corner point; moving the fourth target part along the first rectangular side toward a direction away from the first target corner point; moving the fourth target part along the second rectangular side toward a direction away from the first target corner point;
[0372] When the first rectangular side of the third target part does not fit with the boundary of the sample arrangement site or other rectangular parts except the third target part, or the second rectangular side of the third target part does not fit with the boundary of the sample arrangement site or other rectangular parts except the third target part, the third target part is moved to fit with the boundary of the sample arrangement site or other rectangular parts except the third target part according to the principle of minimum moving distance;
[0373] The third target part is any rectangular part among the eighth target rectangular parts, and the fourth target part is any rectangular part among the eighth target rectangular parts except the third target part.
[0374] Optionally, the second processing unit is specifically configured to:
[0375] Determining the site space utilization rate of each of the fourth arrangement schemes;
[0376] According to the site space utilization rate of each of the fourth arrangement schemes, a roulette wheel selection process is performed on the fourth arrangement schemes to obtain a tenth arrangement scheme;
[0377] Sorting the site space utilization rates of each of the fourth arrangement schemes in descending order, and determining an eleventh arrangement scheme that is within the first preset ratio and is not within the tenth arrangement scheme;
[0378] According to the tenth arrangement scheme and the eleventh arrangement scheme, the fifth arrangement scheme is obtained.
[0379] Optionally, the device further comprises:
[0380] The decoding module is used to decode the final arrangement scheme to obtain the decoded final arrangement scheme.
[0381] Optionally, the decoding module includes:
[0382] The decoding unit takes the second target corner point of the arrangement site as the origin, and obtains the decoded final arrangement plan according to the geometric information of the rectangular pieces located in the arrangement site and the neighbor relationship of the rectangular pieces in the arrangement site in the final arrangement plan.
[0383] It should be noted that the rectangular parts arrangement device based on genetic algorithm provided in the embodiment of the present invention is a device capable of executing the above-mentioned rectangular parts arrangement method based on genetic algorithm. All embodiments of the above-mentioned rectangular parts arrangement method based on genetic algorithm are applicable to the device and can achieve the same or similar technical effects.
[0384] The embodiment of the present invention also provides a rectangular piece arrangement device based on genetic algorithm, such as Fig. 22 As shown, it includes: a processor 2201; and a memory 2202 connected to the processor 2201 through a bus interface, the memory 2202 is used to store programs and data used by the processor 2201 when performing operations, and the processor 2201 calls and executes the programs and data stored in the memory 2202.
[0385] The transceiver 2203 is connected to the bus interface and is used to receive and send data under the control of the processor 2201.
[0386] Among them, Fig. 22In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically one or more processors represented by processor 2201 and various circuits of memory represented by memory 2202 are linked together. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides a user interface 2204. The transceiver 2203 may be a plurality of components, namely, a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission medium. For different user devices, the user interface 2204 may also be an interface capable of externally and internally connecting required devices, and the connected devices include but are not limited to a keypad, a display, a speaker, a microphone, a joystick, and the like.
[0387] The processor 2201 is responsible for managing the bus architecture and general processing, and the memory 2202 can store data used by the processor 2201 when performing operations.
[0388] The processor 2201 performs the following processes:
[0389] Generate an initial arrangement scheme population according to geometric information of a plurality of rectangular pieces to be arranged and geometric information of a rectangular arrangement site, wherein the initial arrangement scheme population includes at least one initial arrangement scheme;
[0390] Using a preset chain coding genetic algorithm, the initial arrangement scheme population is iteratively evolved to obtain a target arrangement scheme population, wherein the target arrangement scheme population includes at least one target arrangement scheme;
[0391] According to the site space utilization rate corresponding to each of the target arrangement schemes, a final arrangement scheme among the target arrangement schemes is determined.
[0392] Optionally, the geometric information of the arrangement site includes the geometric information of the entire arrangement site and the geometric information of an inner site in the arrangement site that cannot be used to arrange the rectangular pieces to be arranged;
[0393] The processor 2201 is configured to:
[0394] Randomly generate at least one rectangular piece sequence from the plurality of rectangular pieces to be arranged;
[0395] By using a preset coordinate combination point placement algorithm, one of the initial arrangement schemes in the initial arrangement scheme population is generated according to the overall geometric information of the arrangement site, the geometric information of the inner site, the geometric information of the rectangular pieces to be arranged and a sequence of the rectangular pieces.
[0396] Optionally, the processor 2201 is specifically configured to:
[0397] Determine at least one first position coordinate according to the geometric information of the first target rectangular piece, the geometric information of the entire arrangement field and the geometric information of the inner field;
[0398] Sorting at least one first position coordinate according to a preset order to obtain a first coordinate sequence;
[0399] Generate an initial arrangement plan according to the first coordinate sequence, the geometric information of the second target rectangular piece, the geometric information of the entire arrangement site and the geometric information of the inner site;
[0400] Wherein, the first target rectangular piece is a rectangular piece in the rectangular piece sequence and is located in the sample arrangement area;
[0401] The second target rectangular piece is the first rectangular piece in the rectangular piece sequence that is not located in the arrangement site and is to be arranged.
[0402] Optionally, the processor 2201 is specifically configured to:
[0403] Determine the placement of the second target rectangular piece according to the first coordinate sequence, the geometric information of the second target rectangular piece, the geometric information of the entire arrangement site, and the geometric information of the inner site;
[0404] When the placement situation indicates that the placement of the second target rectangular piece is feasible, determining to place the second target rectangular piece in the arrangement site;
[0405] When the placement situation indicates that the placement of the second target rectangular piece is not feasible, determining to place the second target rectangular piece into the set of sites that have not entered the arrangement site;
[0406] An initial arrangement scheme is obtained according to the geometric information of the rectangular pieces in the arrangement area, the geometric information of the rectangular pieces adjacent to each rectangular piece in the arrangement area, and the geometric information of the rectangular pieces that are not in the arrangement area set.
[0407] Optionally, the processor 2201 is specifically configured to:
[0408] Sequentially taking the first position coordinates in the first coordinate sequence as the first target corner coordinates of the second target rectangular object, and for each of the first position coordinates, placing the second target rectangular object into the arrangement site in a first preset posture and a second preset posture respectively;
[0409] When the second target rectangular piece satisfies the first condition, determining that the placement of the second target rectangular piece is feasible;
[0410] When the second target rectangular piece satisfies at least one of the second conditions, it is indeed not feasible to place the second target rectangular piece;
[0411] The first condition includes:
[0412] The second target rectangular piece is located in the sample arrangement field and does not collide with the inner field;
[0413] The first rectangular side of the second target rectangular piece is adjacent to the edge of the first target rectangular piece, the edge of the sample arrangement field, or the edge of the inner field;
[0414] The second rectangular side of the second target rectangular piece is adjacent to the edge of the first target rectangular piece, the edge of the sample arrangement field, or the edge of the inner field;
[0415] The second target rectangular piece does not collide with any of the first target rectangular pieces;
[0416] The second condition includes:
[0417] The second target rectangular piece exceeds the edge of the sample arrangement site;
[0418] The second target rectangular piece collides with the inner field;
[0419] The first rectangular side of the second target rectangular piece is not adjacent to the edge of the first target rectangular piece, the edge of the sample arrangement field, or the edge of the inner field;
[0420] The second rectangular side of the second target rectangular piece is not adjacent to the edge of the first target rectangular piece, the edge of the sample arrangement field, or the edge of the inner field;
[0421] The second target rectangular piece collides with any rectangular piece of the first target rectangular pieces;
[0422] The first rectangular side and the second rectangular side are respectively rectangular sides adjacent to the first target corner point.
[0423] Optionally, the processor 2201 is configured to:
[0424] The initial arrangement scheme is encoded by using the preset chain coding genetic algorithm to obtain the encoded initial arrangement scheme; the encoded initial arrangement scheme includes the geometric information of each rectangular piece in the arrangement site and the geometric information of the rectangular pieces that have a neighbor relationship with each rectangular piece, and the geometric information of each rectangular piece that has not entered the arrangement site;
[0425] The initial arrangement scheme after the encoding representation is subjected to a preset number of iterative evolution processes to obtain the at least one target arrangement scheme.
[0426] Optionally, the processor 2201 is specifically configured to:
[0427] In the iterative evolution process of the first target times, the first arrangement scheme is subjected to a crossover process of a first crossover number of times to obtain a second arrangement scheme; the first crossover number of times is determined according to the preset crossover probability and the number of the first arrangement schemes;
[0428] Performing mutation processing on the third arrangement scheme according to a preset mutation probability to obtain a fourth arrangement scheme; the third arrangement scheme includes the first arrangement scheme and the second arrangement scheme;
[0429] Performing selection processing on the fourth arrangement scheme to obtain a fifth arrangement scheme corresponding to the iterative evolution processing of the first target time;
[0430] Wherein, the first target iterative evolution process is any one of the preset number of iterative evolution processes;
[0431] In the case where the first target iterative evolution process is the first iterative evolution process, the first arrangement scheme is the initial arrangement scheme after the encoding representation;
[0432] In the case where the first target time is not the first iterative evolutionary process, the first arrangement scheme is the fifth arrangement scheme corresponding to the iterative evolutionary process of the second target time, and the iterative evolutionary process of the second target time is an iterative evolutionary process before the iterative evolutionary process of the first target time;
[0433] In the case where the first target time is the last iterative evolutionary process, the fifth arrangement scheme corresponding to the first target time iterative evolutionary process is the target arrangement scheme.
[0434] Optionally, the processor 2201 is specifically configured to:
[0435] In the third target cross processing process, according to the rectangular pieces with neighbor relationship in the arrangement field in the first target arrangement scheme, the first hereditary sub-scheme in the first target arrangement scheme is determined;
[0436] Determine a second genetic sub-scheme in the second target arrangement scheme according to the rectangular pieces having a neighbor relationship in the arrangement site in the second target arrangement scheme;
[0437] Determine a first crossover sub-scheme according to the neighbor relationship between the rectangular pieces in the first target arrangement scheme that are located in the arrangement site and do not belong to the second genetic sub-scheme and the rectangular pieces in the arrangement site in the first target arrangement scheme;
[0438] Determine a second crossover sub-scheme according to the neighbor relationship between the rectangular pieces in the second target arrangement scheme that are located in the arrangement site and do not belong to the first genetic sub-scheme and the rectangular pieces in the arrangement site in the second target arrangement scheme;
[0439] Using a preset coordinate combination point placement algorithm, the rectangular pieces in the first crossover sub-scheme are placed in the second inheritance sub-scheme, and the rectangular pieces in the second crossover sub-scheme are placed in the first inheritance sub-scheme, to obtain a second arrangement scheme;
[0440] Wherein, the first target arrangement scheme and the second target arrangement scheme are any two arrangement schemes in the first arrangement scheme;
[0441] The third target number of cross processing is any one of the first number of cross processing.
[0442] Optionally, the processor 2201 is specifically configured to:
[0443] Using a preset coordinate combination point placement algorithm, the rectangular pieces in the first cross sub-scheme are placed in the second inheritance sub-scheme, and a third target rectangular piece whose placement is not feasible is determined;
[0444] Adaptively process the third target rectangular piece to obtain a sixth arrangement scheme;
[0445] Determine a fourth target rectangular piece corresponding to the sixth arrangement scheme and located in the set of sites that have not entered the arrangement site;
[0446] Using a preset coordinate combination point placement algorithm, each of the fourth target rectangular pieces is placed in the arrangement site in turn to obtain the second arrangement scheme;
[0447] Using a preset coordinate combination point placement algorithm, the rectangular pieces in the second cross sub-scheme are placed in the first genetic sub-scheme, and a fifth target rectangular piece whose placement is not feasible is determined;
[0448] Adaptively process the fifth target rectangular piece to obtain a seventh arrangement scheme;
[0449] Determine a sixth target rectangular piece corresponding to the seventh arrangement scheme and located in the set of sites that have not entered the arrangement site;
[0450] Using a preset coordinate combination point placement algorithm, each of the sixth target rectangular pieces is placed in the arrangement site in turn to obtain the second arrangement scheme.
[0451] Optionally, the processor 2201 is specifically configured to:
[0452] According to the neighbor relationship of the rectangular pieces in the arrangement field in the first target arrangement scheme, the rectangular pieces in the first intersection sub-scheme are divided into at least one first rectangular piece cluster;
[0453] Using a preset coordinate combination point placement algorithm, the first rectangular component clusters are placed in the second genetic sub-scheme respectively, and the third target rectangular component whose placement is not feasible is determined for each of the first rectangular component clusters;
[0454] The processor 2201 is specifically configured to:
[0455] According to the neighbor relationship of the rectangular pieces in the arrangement field in the second target arrangement scheme, the rectangular pieces in the second cross sub-scheme are divided into at least one second rectangular piece cluster;
[0456] The second rectangular component clusters are placed in the first genetic sub-scheme respectively by using a preset coordinate combination point placement algorithm, and the fifth target rectangular component whose placement is not feasible corresponding to each second rectangular component cluster is determined.
[0457] Optionally, the processor 2201 is further specifically configured to:
[0458] In the case where the first target piece is a rectangular piece partially located outside the arrangement site, the first target piece is placed in the set that does not enter the arrangement site corresponding to the third target arrangement scheme;
[0459] In the case where the first target part overlaps with the second target part, according to the principle of minimum moving distance, the first target part or the second target part is moved according to one of the following moving methods until the first target part and the second target part are attached to each other: the first target part is moved along the first rectangular side in a direction away from the first target corner point; the first target part is moved along the second rectangular side in a direction away from the first target corner point; the second target part is moved along the first rectangular side in a direction away from the first target corner point; the second target part is moved along the second rectangular side in a direction away from the first target corner point;
[0460] When the first rectangular side of the first target part does not fit with the boundary of the sample arrangement site or other rectangular parts except the first target part, or the second rectangular side of the first target part does not fit with the boundary of the sample arrangement site or other rectangular parts except the first target part, the first target part is moved to fit with the boundary of the sample arrangement site or other rectangular parts except the first target part according to the principle of minimum moving distance;
[0461] Wherein, the first target piece is any one of the third target rectangular piece and the fourth target rectangular piece;
[0462] In the case where the first target piece is any rectangular piece among the third target rectangular pieces, the third target arrangement scheme is the sixth arrangement scheme, and the second target piece is any rectangular piece among the third target rectangular pieces except the first target piece;
[0463] In the case where the first target piece is any rectangular piece among the fourth target rectangular pieces, the third target arrangement scheme is the seventh arrangement scheme, and the second target piece is any rectangular piece among the fourth target rectangular pieces except the first target piece.
[0464] Optionally, the processor 2201 is specifically configured to:
[0465] According to the preset mutation probability, the seventh target rectangular piece in the third target arrangement scheme is rotated by a preset angle to obtain an eighth arrangement scheme;
[0466] Determine an eighth target rectangular piece that is not feasible to place in the eighth arrangement scheme;
[0467] Adaptively process the eighth target rectangular piece to obtain a ninth arrangement scheme;
[0468] Determine a ninth target rectangular piece corresponding to the ninth arrangement scheme and located in the set of sites that have not entered the arrangement site;
[0469] Using a preset coordinate combination point placement algorithm, each of the ninth target rectangular pieces is placed in the arrangement site in turn to obtain the fourth arrangement scheme;
[0470] Among them, the third target arrangement scheme is any arrangement scheme among the third arrangement schemes.
[0471] Optionally, the processor 2201 is specifically configured to:
[0472] In the case where the third target piece is a rectangular piece partially located outside the arrangement site, the third target piece is placed in the set that does not enter the arrangement site corresponding to the ninth target arrangement scheme;
[0473] In the case where the third target part overlaps with the fourth target part, according to the principle of minimum moving distance, the first target part or the second target part is moved according to one of the following moving methods until the first target part and the second target part are attached to each other: moving the first target part along the first rectangular side toward a direction away from the first target corner point; moving the first target part along the second rectangular side toward a direction away from the first target corner point; moving the second target part along the first rectangular side toward a direction away from the first target corner point; moving the second target part along the second rectangular side toward a direction away from the first target corner point;
[0474] When the first rectangular side of the third target part does not fit with the boundary of the sample arrangement site or other rectangular parts except the third target part, or the second rectangular side of the third target part does not fit with the boundary of the sample arrangement site or other rectangular parts except the third target part, the third target part is moved to fit with the boundary of the sample arrangement site or other rectangular parts except the third target part according to the principle of minimum moving distance;
[0475] The third target part is any rectangular part among the eighth target rectangular parts, and the fourth target part is any rectangular part among the eighth target rectangular parts except the third target part.
[0476] Optionally, the processor 2201 is specifically configured to:
[0477] Determining the site space utilization rate of each of the fourth arrangement schemes;
[0478] According to the site space utilization rate of each of the fourth arrangement schemes, a roulette wheel selection process is performed on the fourth arrangement schemes to obtain a tenth arrangement scheme;
[0479] Sorting the site space utilization rates of each of the fourth arrangement schemes in descending order, and determining an eleventh arrangement scheme that is within the first preset ratio and is not within the tenth arrangement scheme;
[0480] According to the tenth arrangement scheme and the eleventh arrangement scheme, the fifth arrangement scheme is obtained.
[0481] Optionally, the processor 2201 is further configured to:
[0482] The final arrangement scheme is decoded to obtain a decoded final arrangement scheme.
[0483] Optionally, the processor 2201 is specifically configured to:
[0484] The second target corner point of the arrangement site is taken as the origin, and the decoded final arrangement plan is obtained according to the geometric information of the rectangular pieces in the arrangement site and the neighbor relationship of the rectangular pieces in the arrangement site in the final arrangement plan.
[0485] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or may be accomplished by instructing related hardware through a program, wherein the program includes instructions for executing part or all of the steps of the above method; and the program may be stored in a readable storage medium, which may be any form of storage medium.
[0486] An embodiment of the present invention further provides a readable storage medium, wherein a program is stored on the readable storage medium, and when the program is executed by a processor, the rectangular component packing method based on a genetic algorithm as described in any one of the above items is implemented.
[0487] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0488] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be physically included separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0489] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform some steps of the sending and receiving methods described in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.
[0490] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary personnel in this technical field, several improvements and modifications can be made without departing from the principles described in the present invention. These improvements and modifications are also within the scope of protection of the present invention.
Claims
1. A rectangular parts layout method based on genetic algorithm, characterized in that: include: Generate an initial arrangement scheme population according to geometric information of a plurality of rectangular pieces to be arranged and geometric information of a rectangular arrangement site, wherein the initial arrangement scheme population includes at least one initial arrangement scheme; Using a preset chain coding genetic algorithm, the initial arrangement scheme population is iteratively evolved to obtain a target arrangement scheme population, wherein the target arrangement scheme population includes at least one target arrangement scheme; According to the site space utilization rate corresponding to each of the target arrangement schemes, a final arrangement scheme among the target arrangement schemes is determined.
2. The rectangular parts arrangement method based on genetic algorithm according to claim 1, characterized in that: The geometric information of the arrangement site includes the geometric information of the entire arrangement site and the geometric information of the inner area of the arrangement site that cannot be used to arrange the rectangular pieces to be arranged; According to the geometric information of multiple rectangular pieces to be arranged and the geometric information of a rectangular arrangement site, an initial arrangement scheme population is generated, including: Randomly generate at least one rectangular piece sequence from the plurality of rectangular pieces to be arranged; By using a preset coordinate combination point placement algorithm, one of the initial arrangement schemes in the initial arrangement scheme population is generated according to the overall geometric information of the arrangement site, the geometric information of the inner site, the geometric information of the rectangular pieces to be arranged and a sequence of the rectangular pieces.
3. The rectangular parts arrangement method based on genetic algorithm according to claim 2, characterized in that: Using a preset coordinate combination point placement algorithm, according to the geometric information of the entire arrangement site, the geometric information of the inner site, the geometric information of the rectangular pieces to be arranged, and a rectangular piece sequence, one of the initial arrangement schemes in the initial arrangement scheme population is generated, including: Determine at least one first position coordinate according to the geometric information of the first target rectangular piece, the geometric information of the entire arrangement field and the geometric information of the inner field; Sorting at least one first position coordinate according to a preset order to obtain a first coordinate sequence; Generate an initial arrangement plan according to the first coordinate sequence, the geometric information of the second target rectangular piece, the geometric information of the entire arrangement site and the geometric information of the inner site; Wherein, the first target rectangular piece is a rectangular piece in the rectangular piece sequence and is located in the sample arrangement area; The second target rectangular piece is the first rectangular piece in the rectangular piece sequence that is not located in the arrangement site and is to be arranged.
4. The rectangular parts arrangement method based on genetic algorithm according to claim 3 is characterized in that: According to the first coordinate sequence, the geometric information of the second target rectangular piece, the geometric information of the entire arrangement site and the geometric information of the inner site, an initial arrangement scheme is generated, including: Determine the placement of the second target rectangular piece according to the first coordinate sequence, the geometric information of the second target rectangular piece, the geometric information of the entire arrangement site, and the geometric information of the inner site; When the placement situation indicates that the placement of the second target rectangular piece is feasible, determining to place the second target rectangular piece in the arrangement site; When the placement situation indicates that the placement of the second target rectangular piece is not feasible, determining to place the second target rectangular piece into the set of sites that have not entered the arrangement site; An initial arrangement scheme is obtained according to the geometric information of the rectangular pieces in the arrangement area, the geometric information of the rectangular pieces adjacent to each rectangular piece in the arrangement area, and the geometric information of the rectangular pieces that are not in the arrangement area set.
5. The rectangular parts arrangement method based on genetic algorithm according to claim 4, characterized in that: Determining the placement of the second target rectangular piece according to the first coordinate sequence, the geometric information of the second target rectangular piece, the geometric information of the entire arrangement site, and the geometric information of the inner site includes: Sequentially taking the first position coordinates in the first coordinate sequence as the first target corner coordinates of the second target rectangular object, and for each of the first position coordinates, placing the second target rectangular object into the arrangement site in a first preset posture and a second preset posture respectively; When the second target rectangular piece satisfies the first condition, determining that the placement of the second target rectangular piece is feasible; When the second target rectangular piece satisfies at least one of the second conditions, it is indeed not feasible to place the second target rectangular piece; The first condition includes: The second target rectangular piece is located in the sample arrangement field and does not collide with the inner field; The first rectangular side of the second target rectangular piece is adjacent to the edge of the first target rectangular piece, the edge of the sample arrangement field, or the edge of the inner field; The second rectangular side of the second target rectangular piece is adjacent to the edge of the first target rectangular piece, the edge of the sample arrangement field, or the edge of the inner field; The second target rectangular piece does not collide with any of the first target rectangular pieces; The second condition includes: The second target rectangular piece exceeds the edge of the sample arrangement site; The second target rectangular piece collides with the inner field; The first rectangular side of the second target rectangular piece is not adjacent to the edge of the first target rectangular piece, the edge of the sample arrangement field, or the edge of the inner field; The second rectangular side of the second target rectangular piece is not adjacent to the edge of the first target rectangular piece, the edge of the sample arrangement field, or the edge of the inner field; The second target rectangular piece collides with any rectangular piece of the first target rectangular pieces; The first rectangular side and the second rectangular side are respectively rectangular sides adjacent to the first target corner point.
6. The rectangular parts arrangement method based on genetic algorithm according to claim 1, characterized in that: The initial arrangement scheme population is iteratively evolved using a preset chain coding genetic algorithm to obtain a target arrangement scheme population, including: The initial arrangement scheme is encoded by using the preset chain coding genetic algorithm to obtain the encoded initial arrangement scheme; the encoded initial arrangement scheme includes the geometric information of each rectangular piece in the arrangement site and the geometric information of the rectangular pieces that have a neighbor relationship with each rectangular piece, and the geometric information of each rectangular piece that has not entered the arrangement site; The initial arrangement scheme after the encoding representation is subjected to a preset number of iterative evolution processes to obtain the at least one target arrangement scheme.
7. The rectangular parts arrangement method based on genetic algorithm according to claim 6, characterized in that: The initial arrangement scheme after the encoding representation is subjected to a preset number of iterative evolution processing to obtain the at least one target arrangement scheme, including: In the iterative evolution process of the first target times, the first arrangement scheme is subjected to a crossover process of a first crossover number of times to obtain a second arrangement scheme; the first crossover number of times is determined according to the preset crossover probability and the number of the first arrangement schemes; Performing mutation processing on the third arrangement scheme according to a preset mutation probability to obtain a fourth arrangement scheme; the third arrangement scheme includes the first arrangement scheme and the second arrangement scheme; Performing selection processing on the fourth arrangement scheme to obtain a fifth arrangement scheme corresponding to the iterative evolution processing of the first target time; Wherein, the first target iterative evolution process is any one of the preset number of iterative evolution processes; In the case where the first target iterative evolution process is the first iterative evolution process, the first arrangement scheme is the initial arrangement scheme after the encoding representation; In the case where the first target time is not the first iterative evolutionary process, the first arrangement scheme is the fifth arrangement scheme corresponding to the iterative evolutionary process of the second target time, and the iterative evolutionary process of the second target time is an iterative evolutionary process before the iterative evolutionary process of the first target time; In the case where the first target time is the last iterative evolutionary process, the fifth arrangement scheme corresponding to the first target time iterative evolutionary process is the target arrangement scheme.
8. The rectangular parts arrangement method based on genetic algorithm according to claim 7, characterized in that: The first arrangement scheme is cross-processed with a first cross-number of times to obtain a second arrangement scheme, including: In the third target cross processing process, according to the rectangular pieces with neighbor relationship in the arrangement field in the first target arrangement scheme, the first hereditary sub-scheme in the first target arrangement scheme is determined; Determine a second genetic sub-scheme in the second target arrangement scheme according to the rectangular pieces having a neighbor relationship in the arrangement site in the second target arrangement scheme; Determine a first crossover sub-scheme according to the neighbor relationship between the rectangular pieces in the first target arrangement scheme that are located in the arrangement site and do not belong to the second genetic sub-scheme and the rectangular pieces in the arrangement site in the first target arrangement scheme; Determine a second crossover sub-scheme according to the neighbor relationship between the rectangular pieces in the second target arrangement scheme that are located in the arrangement site and do not belong to the first genetic sub-scheme and the rectangular pieces in the arrangement site in the second target arrangement scheme; Using a preset coordinate combination point placement algorithm, the rectangular pieces in the first crossover sub-scheme are placed in the second inheritance sub-scheme, and the rectangular pieces in the second crossover sub-scheme are placed in the first inheritance sub-scheme, to obtain a second arrangement scheme; Wherein, the first target arrangement scheme and the second target arrangement scheme are any two arrangement schemes in the first arrangement scheme; The third target number of cross processing is any one of the first number of cross processing.
9. The rectangular parts arrangement method based on genetic algorithm according to claim 8, characterized in that: Using a preset coordinate combination point placement algorithm, the rectangular pieces in the first crossover sub-scheme are placed in the second inheritance sub-scheme, and the rectangular pieces in the second crossover sub-scheme are placed in the first inheritance sub-scheme to obtain a second arrangement scheme, including: Using a preset coordinate combination point placement algorithm, the rectangular pieces in the first cross sub-scheme are placed in the second inheritance sub-scheme, and a third target rectangular piece whose placement is not feasible is determined; Adaptively process the third target rectangular piece to obtain a sixth arrangement scheme; Determine a fourth target rectangular piece corresponding to the sixth arrangement scheme and located in the set of sites that have not entered the arrangement site; Using a preset coordinate combination point placement algorithm, each of the fourth target rectangular pieces is placed in the arrangement site in turn to obtain the second arrangement scheme; Using a preset coordinate combination point placement algorithm, the rectangular pieces in the second cross sub-scheme are placed in the first genetic sub-scheme, and a fifth target rectangular piece whose placement is not feasible is determined; Adaptively process the fifth target rectangular piece to obtain a seventh arrangement scheme; Determine a sixth target rectangular piece corresponding to the seventh arrangement scheme and located in the set of sites that have not entered the arrangement site; Using a preset coordinate combination point placement algorithm, each of the sixth target rectangular pieces is placed in the arrangement site in turn to obtain the second arrangement scheme.
10. The rectangular parts arrangement method based on genetic algorithm according to claim 9, characterized in that: Using a preset coordinate combination point placement algorithm, placing the rectangular piece in the first cross sub-scheme into the second inheritance sub-scheme, and determining a third target rectangular piece whose placement is not feasible, including: According to the neighbor relationship of the rectangular pieces in the arrangement field in the first target arrangement scheme, the rectangular pieces in the first intersection sub-scheme are divided into at least one first rectangular piece cluster; Using a preset coordinate combination point placement algorithm, the first rectangular component clusters are placed in the second genetic sub-scheme respectively, and the third target rectangular component whose placement is not feasible is determined for each of the first rectangular component clusters; Using a preset coordinate combination point placement algorithm, placing the rectangular piece in the second cross sub-scheme into the first genetic sub-scheme, and determining a fifth target rectangular piece whose placement is not feasible, including: According to the neighbor relationship of the rectangular pieces in the arrangement field in the second target arrangement scheme, the rectangular pieces in the second cross sub-scheme are divided into at least one second rectangular piece cluster; The second rectangular component clusters are placed in the first genetic sub-scheme respectively by using a preset coordinate combination point placement algorithm, and the fifth target rectangular component whose placement is not feasible corresponding to each second rectangular component cluster is determined.
11. The rectangular parts arrangement method based on genetic algorithm according to claim 10, characterized in that: The method further comprises: In the case where the first target piece is a rectangular piece partially located outside the arrangement site, the first target piece is placed in the set that does not enter the arrangement site corresponding to the third target arrangement scheme; In the case where the first target part overlaps with the second target part, according to the principle of minimum moving distance, the first target part or the second target part is moved according to one of the following moving methods until the first target part and the second target part are attached to each other: the first target part is moved along the first rectangular side in a direction away from the first target corner point; the first target part is moved along the second rectangular side in a direction away from the first target corner point; the second target part is moved along the first rectangular side in a direction away from the first target corner point; the second target part is moved along the second rectangular side in a direction away from the first target corner point; When the first rectangular side of the first target part does not fit with the boundary of the sample arrangement site or other rectangular parts except the first target part, or the second rectangular side of the first target part does not fit with the boundary of the sample arrangement site or other rectangular parts except the first target part, the first target part is moved to fit with the boundary of the sample arrangement site or other rectangular parts except the first target part according to the principle of minimum moving distance; Wherein, the first target piece is any one of the third target rectangular piece and the fourth target rectangular piece; In the case where the first target piece is any rectangular piece among the third target rectangular pieces, the third target arrangement scheme is the sixth arrangement scheme, and the second target piece is any rectangular piece among the third target rectangular pieces except the first target piece; In the case where the first target piece is any rectangular piece among the fourth target rectangular pieces, the third target arrangement scheme is the seventh arrangement scheme, and the second target piece is any rectangular piece among the fourth target rectangular pieces except the first target piece.
12. The rectangular parts arrangement method based on genetic algorithm according to claim 9, characterized in that: The third arrangement scheme is mutated according to a preset mutation probability to obtain a fourth arrangement scheme, including: According to the preset mutation probability, the seventh target rectangular piece in the third target arrangement scheme is rotated by a preset angle to obtain an eighth arrangement scheme; the seventh target rectangular piece is any rectangular piece in the arrangement site corresponding to the third target arrangement scheme; Determine an eighth target rectangular piece that is not feasible to place in the eighth arrangement scheme; Adaptively process the eighth target rectangular piece to obtain a ninth arrangement scheme; Determine a ninth target rectangular piece corresponding to the ninth arrangement scheme and located in the set of sites that have not entered the arrangement site; Using a preset coordinate combination point placement algorithm, each of the ninth target rectangular pieces is placed in the arrangement site in turn to obtain the fourth arrangement scheme; Among them, the third target arrangement scheme is any arrangement scheme among the third arrangement schemes.
13. The rectangular parts arrangement method based on genetic algorithm according to claim 12, characterized in that: Adaptively process the eighth target rectangular piece to obtain a ninth arrangement scheme, including: In the case where the third target piece is a rectangular piece partially located outside the arrangement site, the third target piece is placed in the set that does not enter the arrangement site corresponding to the ninth target arrangement scheme; In the case where the third target part overlaps with the fourth target part, according to the principle of minimum moving distance, the third target part or the fourth target part is moved according to one of the following moving methods until the third target part is in contact with the fourth target part: moving the third target part along the first rectangular side toward a direction away from the first target corner point; moving the third target part along the second rectangular side toward a direction away from the first target corner point; moving the fourth target part along the first rectangular side toward a direction away from the first target corner point; moving the fourth target part along the second rectangular side toward a direction away from the first target corner point; When the first rectangular side of the third target part does not fit with the boundary of the sample arrangement site or other rectangular parts except the third target part, or the second rectangular side of the third target part does not fit with the boundary of the sample arrangement site or other rectangular parts except the third target part, move the third target part to fit with the boundary of the sample arrangement site or other rectangular parts except the third target part according to the principle of minimum moving distance; The third target part is any rectangular part among the eighth target rectangular parts, and the fourth target part is any rectangular part among the eighth target rectangular parts except the third target part.
14. The rectangular parts arrangement method based on genetic algorithm according to claim 9, characterized in that: The fourth arrangement scheme is selected to obtain a fifth arrangement scheme corresponding to the first target iterative evolution process, including: Determining the site space utilization rate of each of the fourth arrangement schemes; According to the site space utilization rate of each of the fourth arrangement schemes, a roulette wheel selection process is performed on the fourth arrangement schemes to obtain a tenth arrangement scheme; Sorting the site space utilization rates of each of the fourth arrangement schemes in descending order, and determining an eleventh arrangement scheme that is within the first preset ratio and is not within the tenth arrangement scheme; According to the tenth arrangement scheme and the eleventh arrangement scheme, the fifth arrangement scheme is obtained.
15. The rectangular parts arrangement method based on genetic algorithm according to claim 1, characterized in that: The method further comprises: The final arrangement scheme is decoded to obtain a decoded final arrangement scheme.
16. The rectangular parts arrangement method based on genetic algorithm according to claim 15, characterized in that: Decoding the final arrangement scheme to obtain the decoded final arrangement scheme includes: The second target corner point of the arrangement site is taken as the origin, and the decoded final arrangement plan is obtained according to the geometric information of the rectangular pieces in the arrangement site and the neighbor relationship of the rectangular pieces in the arrangement site in the final arrangement plan.
17. A rectangular piece arrangement device based on genetic algorithm, characterized in that: include: A first processing module, for generating an initial arrangement scheme population according to geometric information of a plurality of rectangular pieces to be arranged and geometric information of a rectangular arrangement site, wherein the initial arrangement scheme population includes at least one initial arrangement scheme; A second processing module is used to use a preset chain coding genetic algorithm to perform iterative evolution processing on the initial arrangement scheme population to obtain a target arrangement scheme population, wherein the target arrangement scheme population includes at least one target arrangement scheme; The determination module is used to determine a final arrangement scheme among the target arrangement schemes according to the site space utilization rate corresponding to each of the target arrangement schemes.
18. A rectangular piece arrangement device based on genetic algorithm, comprising: A transceiver, a processor, a memory, and a program or instruction stored in the memory and executable on the processor; characterized in that when the processor executes the program or instruction, the rectangular parts arrangement method based on genetic algorithm as described in any one of claims 1 to 16 is implemented.
19. A readable storage medium having a program or instruction stored thereon, characterized in that: When the program or instruction is executed by a processor, the steps in the rectangular component layout method based on a genetic algorithm as claimed in any one of claims 1 to 16 are implemented.
