Fabricated house type layout method and device based on genetic algorithm
By using a genetic algorithm-based method for grid division and iterative optimization of prefabricated housing, the non-standardization problem in prefabricated housing design is solved, and automatic layout and standardized design of interior space are realized, thereby reducing costs.
Patent Information
- Application Number
- CN202511115546.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-11
- Publication Date
- 2025-11-21
AI Technical Summary
Existing prefabricated housing designs contain too many non-standard and personalized components, leading to increased design, manufacturing, and construction costs. Designers have failed to effectively achieve standardized design during the design process.
A genetic algorithm-based approach is used to generate a modular grid by dividing the planar space into grids, and to encode the functional modules of the rooms based on the design requirements and constraints of the apartment area. The genetic algorithm is then used for iterative optimization to generate the optimal layout scheme for the prefabricated residential apartment.
It enables automatic layout and optimization of the interior space of prefabricated housing, realizes automatic standardized design, and reduces design, manufacturing and construction costs.
Smart Images

Figure CN120995693A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of architectural design and multi-objective optimization, and in particular to a method and apparatus for prefabricated residential unit layout based on genetic algorithms. Background Technology
[0002] With the country's vigorous promotion of prefabricated buildings, prefabricated housing is becoming more and more popular. The construction method of prefabricated housing is different from that of cast-in-place housing. It requires disassembling components such as floor slabs and walls into several parts, producing them in the factory, and then transporting them to the construction site for assembly. Therefore, the design of prefabricated housing units should be standardized to the greatest extent possible while meeting the requirements of diversity, so as to improve production and construction efficiency.
[0003] To promote the standardized design of prefabricated housing, the Ministry of Housing and Urban-Rural Development issued the "Industrialized Housing Dimension Coordination Standard" in 2018 and the "Prefabricated Housing Design and Selection Standard" in 2022, emphasizing that prefabricated housing designs should use a modular grid with flexible combinations of 2M (200mm) + 3M (300mm) for floor plan design. Meanwhile, several provinces and cities have published standardized housing design atlases, providing strong technical support for the standardization of prefabricated housing.
[0004] However, in practical applications, residential design schemes need to be influenced by factors such as site conditions, design standards, local policies, and the natural environment. Therefore, residential design is a process that needs to balance personalization and standardization, and standardized design atlases cannot meet most design needs. At the same time, current prefabricated housing unit designs have not escaped the influence of the cast-in-place housing era. Designers often lack awareness of standardized design, frequently employing designs that open outwards to enrich the building's facade, etc. These factors have led to numerous non-modular and non-standardized phenomena in the dimensional design of various spaces in prefabricated housing. This results in a large number of non-standardized and personalized components in current prefabricated housing, significantly increasing the design, manufacturing, and construction costs. Summary of the Invention
[0005] The purpose of this application is to provide a method and device for prefabricated housing unit layout based on genetic algorithm, which can realize the automatic layout and optimization of the interior space of prefabricated housing, realize automatic standardized design, and thus reduce the design, manufacturing and construction costs of prefabricated housing.
[0006] To achieve the above objectives, this application provides the following solution:
[0007] Firstly, this application provides a prefabricated residential unit layout method based on a genetic algorithm, including:
[0008] The planar space is divided into grids according to a preset grid size to create a modular grid.
[0009] Based on the design requirements and constraints of the apartment layout and area, the functional modules of the rooms are encoded on the modular grid to generate an initial population; the constraints include neighbor and location constraints.
[0010] By using a genetic algorithm to iteratively optimize the initial population, the optimal layout scheme for prefabricated residential units can be obtained.
[0011] Secondly, this application provides a prefabricated residential unit layout device based on a genetic algorithm, comprising:
[0012] The modular mesh creation module is used to divide a planar space into grids according to a preset grid size and create a modular mesh.
[0013] An initial population generation module is used to encode room functional modules on the modular grid based on the apartment area design requirements and constraints, thereby generating an initial population; the constraints include neighbor and location constraints.
[0014] The iterative optimization module is used to use a genetic algorithm to iteratively optimize the initial population and obtain the optimal layout scheme for prefabricated residential units.
[0015] Thirdly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the computer program to implement the above-described prefabricated residential unit layout method based on genetic algorithm.
[0016] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described prefabricated residential unit layout method based on genetic algorithm.
[0017] According to the specific embodiments provided in this application, the following technical effects are disclosed:
[0018] This application provides a method and apparatus for prefabricated housing unit layout based on genetic algorithm. The method involves dividing a planar space into grids according to a preset grid size to establish a modular grid. Based on the unit area design requirements and constraints, room functional modules are encoded on the modular grid to generate an initial population. The constraints include neighbor and location constraints. The initial population is iteratively optimized using a genetic algorithm to obtain the optimal prefabricated housing unit layout scheme. This application optimizes the prefabricated housing unit layout through genetic algorithm, achieving automatic layout and optimization of the interior space of prefabricated housing, realizing automatic standardized design, and thus reducing the design, manufacturing, and construction costs of prefabricated housing. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is an application environment diagram of a prefabricated residential unit layout method based on genetic algorithm in one embodiment of this application.
[0021] Figure 2 This is a flowchart illustrating a prefabricated residential unit layout method based on a genetic algorithm, provided as an embodiment of this application.
[0022] Figure 3 This is a schematic diagram illustrating the specific process of a prefabricated residential unit layout method based on a genetic algorithm, provided in an embodiment of this application.
[0023] Figure 4 This is a schematic diagram of the functional modules of a prefabricated residential unit layout device based on a genetic algorithm, provided in one embodiment of this application.
[0024] Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0025] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0026] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0027] The prefabricated residential unit layout method based on genetic algorithms provided in this application can be applied to, for example... Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be set up independently, integrated into server 104, or placed in the cloud or on another server. Terminal 102 can send requests to be processed to server 104. After receiving the request, server 104 divides the planar space into a modular grid according to a preset grid size. Based on the apartment area design requirements and constraints, it encodes the room functional modules on the modular grid, generating an initial population. Using a genetic algorithm, iteratively optimizes the initial population to obtain the optimal prefabricated residential apartment layout scheme. Server 104 can then feed back the obtained optimal prefabricated residential apartment layout scheme to terminal 102. In addition, in some embodiments, the prefabricated housing layout method based on genetic algorithm can also be implemented by the server 104 or the terminal 102 alone. For example, the terminal 102 can directly optimize the prefabricated housing layout for the request to be processed, or the server 104 can obtain the request to be processed from the data storage system and optimize the prefabricated housing layout for the request to be processed.
[0028] The terminal 102 can be, but is not limited to, various desktop computers, laptops, smartphones, and tablets. The server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers, or it can be a cloud server.
[0029] In one exemplary embodiment, such as Figure 2 and Figure 3 As shown, a method for prefabricated residential unit layout based on a genetic algorithm is provided. This method is executed by a computer device, specifically by a terminal or server alone, or by both a terminal and a server. In this embodiment, the method is applied to... Figure 1 Taking server 104 as an example, the explanation includes the following steps 201 to 203.
[0030] Step 201: Divide the planar space into grids according to the preset grid size to establish a modular grid.
[0031] Step 202: Based on the design requirements and constraints of the apartment area, the room function modules are encoded on the modular grid to generate an initial population; the constraints include neighbor and location constraints.
[0032] Step 203: Use a genetic algorithm to iteratively optimize the initial population to obtain the optimal prefabricated residential unit layout scheme.
[0033] By implementing steps 201 to 203 above, the layout of prefabricated housing units is optimized using a genetic algorithm, achieving automatic layout and optimization of the interior space of prefabricated housing units. This realizes automated standardized design, thereby reducing the design, manufacturing, and construction costs of prefabricated housing. This application is used in the architectural design phase for designing and selecting design schemes suitable for prefabricated housing.
[0034] Floor plan design is the core of prefabricated housing design. Prefabricated housing floor plan design must achieve standardization and regularity to the greatest extent possible while meeting diverse needs. Therefore, the first issue to address in prefabricated housing floor plan design is the functional combination problem, rationally combining spaces such as living rooms and bedrooms. Then, the standardization and regularity of different combination schemes are evaluated. Essentially, it is a multi-objective optimization problem of functional space combination. This application will employ a genetic algorithm to achieve automatic layout and optimization of the interior space of prefabricated housing units. The prefabricated housing unit layout method based on genetic algorithm proposed in this application is a multi-objective optimization method. By limiting various parameters, such as room size, room location, and room outline, the algorithm iteratively generates a suitable solution.
[0035] In step 201 above, planar meshing is performed to create a planar mesh with a unit size of 100mm×100mm. The two-dimensional mesh planar space is denoted as I, which determines the modular mesh.
[0036] In step 202 above, the room function module is encoded, specifically including: encoding the room function module according to the coordinates of the lower left corner of the room function module and the length and width of the room function module.
[0037] Let the index of the room functional module be i. Each room functional module is abstracted into four numbers: x, y, w, and h. Here, (x, y) records the coordinates of the lower left corner of the room functional module, and w and h represent the length and width of the room functional module, respectively. The room functional module is represented by a four-dimensional vector.
[0038] R i =(x i ,y i ,w i ,h i );
[0039] Among them, R i Let x be a four-dimensional vector representation of the i-th room's functional module. i ,y i ,w i ,h i Let x and y be the coordinates of the lower left corner of the i-th room function module, and y be the length and width of the room function module.
[0040] The four corners of the room's functional modules can then be represented by the following formula: CP i X =[x i ,x i +w i ,x i +w i ,x i ] and CP i y =[y i ,y i ,y i +h i ,y i +h i ], CP i X Let CP be the set of the x-coordinates of the four corners of the i-th room's functional module. i y Let be the set of the ordinates of the four corners of the i-th room's functional module.
[0041] Based on the design requirements and constraints of the apartment layout area, the room functional modules are encoded on the modular grid to generate an initial population, including: determining the number of room functional modules based on the design requirements of the apartment layout area; and encoding the room functional modules on the modular grid based on the number of room functional modules and constraints to generate an initial population.
[0042] The room's functional modules include a living room, a bedroom with a bathroom, a double bedroom, a single bedroom, a kitchen, a bathroom, a dining room, an entryway, and a circulation corridor.
[0043] The number of functional modules in a room is determined based on the design requirements of the apartment's area. Different apartment sizes contain different numbers of functional modules. When laying out the layout, residences should be categorized into six types according to their net usable floor area: A (≤50㎡), B (50㎡ < ≤75㎡), C (75㎡ < ≤90㎡), D (90㎡ < ≤120㎡), E (120㎡ < ≤135㎡), and F (135㎡ < ≤150㎡). The specific number of functional modules for each apartment type is as follows:
[0044] Type A: Includes 1 living room, 1 double bedroom, 1 kitchen, 1 bathroom, 1 dining room, 1 entryway, and 0-2 circulation corridors;
[0045] Type B: Includes 1 living room, 1 double bedroom, 1 single bedroom, 1 kitchen, 1 bathroom, 1 dining room, 1 entryway, and 0-2 circulation corridors;
[0046] Type C: Includes 1 living room, 2 double bedrooms, 1 kitchen, 1 bathroom, 1 dining room, 1 entryway, and 0-2 circulation corridors;
[0047] Type D: Includes 1 living room, 1 double bedroom, 2 single bedrooms, 1 kitchen, 1 bathroom, 1 dining room, 1 entryway, and 0-2 circulation corridors;
[0048] Type E: 1 living room, 1 bedroom with ensuite bathroom, 1 double bedroom, 1 single bedroom, 1 kitchen, 1 bathroom, 1 dining room, 1 entryway, 0-2 circulation corridors;
[0049] Type F: 1 living room, 1 bedroom with ensuite bathroom, 2 double bedrooms, 1-2 single bedrooms, 1 kitchen, 1 bathroom, 1 dining room, 1 entryway, 0-2 circulation corridors.
[0050] The constraints include functional module size range constraints, functional size basic module constraints, size requirement constraints between functional modules, and neighbor and position constraints.
[0051] (1) Functional module size range constraints, used to set the length parameter w and width parameter h of room functional modules. The ranges of w and h are different for different room functional modules, where:
[0052] 1. Living room: 2400≤w≤6600, 2400≤h≤6600;
[0053] 2. Bedroom with ensuite bathroom: 3600≤w≤6600, 4800≤h≤6000;
[0054] 3. Double bedroom: 2400≤w≤5200, 3600≤h≤5200;
[0055] 4. Single bedroom: 2000≤w≤3600, 2800≤h≤4800;
[0056] 5. Kitchen: 1500≤w≤3600, 2800≤h≤4800;
[0057] 6. Bathroom: 1200≤w≤2400, 1800≤h≤2800;
[0058] 7. Restaurant: 1400≤w≤4000, 1400≤h≤4000;
[0059] 8. Entrance hall: 1200≤w≤2200, 1200≤h≤2200;
[0060] 9. Traffic corridors: Randomly generated.
[0061] (2) Basic Modular Constraints for Functional Dimensions: According to relevant specifications, the basic modular dimension of the interior space of prefabricated residential units is 1M, i.e., 100mm. The dimensions of all room functional modules should be multiples of 1M. 2M and 3M are expanded modules, and the dimensions of room functional modules should preferably be multiples of 2M or 3M. In addition to meeting the basic modular dimension, the parameter dimensions set in the room functional module size range constraints should also be multiples of 200 or 300 for all room functional module dimensions.
[0062] (3) To control the overall outline of the apartment layout and ensure the rationality of the area ratio of each functional space, the area relationship of different functional spaces is specified, and the size requirements between functional modules include:
[0063] 1. The ratio of the longer side to the shorter side in the living room and all bedrooms is less than 1.5;
[0064] 2. The shorter side length in a traffic corridor should be less than or equal to 2200 mm;
[0065] 3. In the same apartment layout, the living room and the largest bedroom are the two largest rooms, while the entryway is the smallest.
[0066] 4. In the same apartment layout, the smallest room among the living room and all bedrooms must have an area greater than or equal to the largest room among the bathroom, kitchen, and dining room;
[0067] 5. In the same apartment layout, the area of the bedroom with ensuite bathroom is larger than that of the double bedroom, and the area of the double bedroom is larger than that of the single bedroom;
[0068] 6. The bathroom area is less than or equal to the smallest bedroom area, and the bathroom area is less than or equal to the kitchen area;
[0069] 7. If there are two identical functional spaces in a house layout, their areas can be different.
[0070] (4) In the apartment layout design, the living room, dining room, and entrance hall are public spaces, while the bedrooms and bathrooms are private spaces. The circulation corridor serves as the hub connecting all functional spaces. To ensure the separation of public and private spaces within the apartment and to ensure that different functional spaces have reasonable orientations, regulations are established regarding the positional relationships of different room functional modules. Neighbor and location constraints include:
[0071] All spaces are adjacent to each other, meaning that all room functional modules are adjacent to each other;
[0072] The entryway is located to the south, east, or west of the kitchen;
[0073] The entryway is located at the edge of the overall layout;
[0074] The living room is located to the east, west, or north of any of the bedrooms;
[0075] The dining room is located to the south, east, or west of the kitchen, or to the north, east, or west of the living room;
[0076] The bathroom is located to the east, west, south, or north of the kitchen;
[0077] The bedroom with ensuite bathroom is located to the east or west of another bedroom;
[0078] The double bedroom is located to the east, west, south, or north of another bedroom or living room;
[0079] A single bedroom is located to the east, west, south, or north of another bedroom or bathroom;
[0080] The largest bedroom is located on the south side of the entire layout;
[0081] Each space must be adjacent to at least two other spaces, meaning each room functional module must be adjacent to at least two other room functional modules.
[0082] In step 203 above, the initial population is iteratively optimized using a genetic algorithm to obtain the optimal prefabricated residential unit layout scheme, specifically including the following steps 301 to 305.
[0083] Step 301: Apply a penalty based on the unit size ratio constraint to the initial population to obtain the unit size ratio penalty result.
[0084] Step 302: Calculate the fitness value of each individual in the apartment layout penalty result according to the fitness function; each individual is a prefabricated residential apartment layout scheme.
[0085] Step 303: Determine whether the stopping criterion is met. If not, perform a selection operation on the housing ratio penalty result based on the fitness value of each individual in the housing ratio penalty result to obtain the selected population.
[0086] Step 304: Perform crossover and mutation operations on the selected population to generate the next generation population corresponding to the next iteration number.
[0087] Step 305: Replace the initial population with the next generation population corresponding to the next iteration number, and return to the "penalize the initial population based on the unit type ratio constraint" step until the stopping criterion is met, then end the iteration and generate the optimal prefabricated residential unit type layout scheme.
[0088] The constraints on the proportions of the apartment layout include: the total length W divided by the total width H after the layout is completed should be between 0.6 and 2, with 0.8 to 1.4 being the optimal range.
[0089] The number of functional rooms is determined by inputting the apartment's area. These rooms are generated in descending order of area, one by one, using the four-dimensional vector representation (x, y, w, h) defined in step 202. Generation is randomized based on neighbor and location constraints. If multiple random generation attempts fail to satisfy the desired function, only one room with overlapping relationships is generated, and this result is penalized and discarded. If multiple generation attempts still fail to satisfy the overlapping function, the entire apartment layout is regenerated as a prefabricated residential apartment layout scheme. A room with overlapping relationships means that room A and room B have overlapping portions, i.e., at least one corner of room A is within room B.
[0090] The initial population results are penalized based on the unit size ratio constraint. Specifically, the total length W divided by the total width H after layout completion should be within the range of [0.8-1.4]. Layouts that do not meet this condition are eliminated. The penalty formula is:
[0091]
[0092] In the formula, P is the penalty for a prefabricated residential unit layout scheme, P i T denoted by , where represents the proportional penalty for the i-th room's functional module; u represents the penalty coefficient for the corresponding variable.
[0093] The fitness of the apartment layout ratio penalty results is calculated. The fitness of the apartment layout design is divided into two parts: the number of side length dimensions, which represents the degree of standardization of the apartment layout dimensions; and the number of outline corners, which represents the degree of regularity of the apartment layout outline. Individuals with high fitness are selected as the parents of the next generation through a fitness function.
[0094] L represents the set of all room functional module side length types, then:
[0095] L={w i ,h i |i=1,2,...n};
[0096] Where n is the number of room functional modules.
[0097] In two-dimensional space, C represents the mesh at the contour corner, then:
[0098]
[0099] Where the grid CP of the i-th room functional module i In a diagram, if a coordinate point (x, y) appears once or three times, it indicates that the point is a turning point; otherwise, it is not a turning point. When coordinate point C... x,y When it is a turn, C x,y =1, when coordinate point C x,y When it is not a corner, C x,y =0.
[0100] The area S occupied by the rectangle enclosed by the entire room can be expressed as:
[0101] S=(max(x)-min(x))×(max(y)-min(y));
[0102] Where max(x) and min(x) are the maximum and minimum x-coordinates of all points in a prefabricated residential unit layout scheme, respectively; max(y) and min(y) are the maximum and minimum y-coordinates of all points in a prefabricated residential unit layout scheme, respectively.
[0103] The fitness function is:
[0104]
[0105] Where f is the fitness function; w1 represents the weight of the side length of the room functional module, w2 represents the weight of the number of outlines, w3 represents the weight of the excess area, and the three weights are used to transform the three objectives into one objective for calculation; |L| represents the number of types of side lengths of all room functional modules. Indicates the number of corners along the entire room's outline; C x,y The coordinates of the turning point; The area represented by w is the excess area of the rectangle enclosed by the entire room; S is the area occupied by the rectangle enclosed by the entire room; i ,h i These are the length and width of the i-th room's functional module, respectively.
[0106] Calculate the number of length and width dimensions, the number of corners, and the fitness value for each individual.
[0107] The genetic algorithm iteration will now begin. The penalized result (the selected population) will undergo crossover and mutation iterations, repeated until the maximum number of iterations is reached (the maximum number of iterations can be set from 1000 to 3000).
[0108] 1. Cross operations:
[0109] (1) The generation order of room function modules is cross-generated to prepare for subsequent mutations. The original order of generating from the largest room to the smallest can be changed to generating the second largest room first, and then generating the largest room.
[0110] (2) Crossing xy or wh. After the crossover, it is necessary to determine whether there is overlap. If there is no overlap, the current result can be retained. The crossover operation can be represented as: the four-dimensional vector of a certain room functional module of a certain individual is represented as (x i ,y i ,wi ,h i If x and y are crossed, then the functional modules of this room are represented as (y i ,x i ,w i ,h i If wh crossover is performed, the crossover of the room's functional modules will be represented as (x i ,y i ,h i ,w i ).
[0111] 2. Mutation operation:
[0112] (1) Select a room functional module, find its allowable variation range based on the functional module size range constraint, mutate the xywh values of the room functional module, and obtain the mutated four-dimensional vector representation of the room functional module (x ij ,y ij ,w ij ,h ij Then, it is determined whether the mutated four-dimensional vector representation conforms to the neighbor and position constraints. If these relationships are not met, the mutation fails.
[0113] (2) Select a room function module in the sequence and directly regenerate that room function module and all subsequent room function modules.
[0114] The stopping criterion is that the current iteration count reaches the maximum iteration count. After the maximum iteration count is reached, the fitness values of all individuals are sorted in descending order based on the fitness value of the last iteration calculated by the fitness function. The top 100 individuals with the highest fitness values are selected as the optimal prefabricated housing layout schemes, that is, the 100 prefabricated housing layout schemes with the highest fitness values are output.
[0115] This application enables automated floor plan design, meeting the modular dimensions and standardized design requirements of prefabricated housing. The size and location of each functional room in the unit can be flexibly adjusted according to different site conditions and design needs. Furthermore, the digitization of design parameters facilitates further digital analysis.
[0116] The prefabricated residential unit layout method based on genetic algorithm proposed in this application is simpler in steps and has lower algorithm development cost compared with the hybrid strategy of reinforcement learning + graph neural network.
[0117] This application also provides an application scenario in which the above-mentioned prefabricated residential unit layout method based on genetic algorithm is applied. Specifically, the prefabricated residential unit layout method based on genetic algorithm provided in this embodiment can be applied to a residential unit layout optimization scenario. The residential unit layout optimization scenario includes a request issuance stage and a layout optimization stage; the request to be processed enters the layout optimization stage from the request issuance stage to obtain the corresponding optimal prefabricated residential unit layout scheme. The prefabricated residential unit layout method based on genetic algorithm provided in this embodiment belongs to the layout optimization stage. Specifically, in the layout optimization stage for the request to be processed, the planar space can be divided into grids according to a preset grid size to establish a modular grid. Based on the unit area design requirements and constraints, the room functional modules are encoded on the modular grid to generate an initial population. Using a genetic algorithm, the initial population is iteratively optimized to obtain the optimal prefabricated residential unit layout scheme.
[0118] Based on the same inventive concept, this application also provides a genetic algorithm-based prefabricated residential unit layout device for implementing the above-mentioned genetic algorithm-based prefabricated residential unit layout method. The solution provided by this device is similar to the implementation scheme described in the above method. Therefore, the specific limitations of one or more genetic algorithm-based prefabricated residential unit layout device embodiments provided below can be found in the limitations of the genetic algorithm-based prefabricated residential unit layout method described above, and will not be repeated here.
[0119] In one exemplary embodiment, such as Figure 4 As shown, a prefabricated residential unit layout device based on a genetic algorithm is provided, comprising the following modules.
[0120] The modular mesh creation module T1 is used to divide the planar space into meshes according to a preset mesh size and create a modular mesh.
[0121] The initial population generation module T2 is used to encode the room function modules on the modular grid based on the apartment area design requirements and constraints to generate an initial population; the constraints include neighbor and location constraints.
[0122] The iterative optimization module T3 is used to iteratively optimize the initial population using a genetic algorithm to obtain the optimal layout scheme for prefabricated residential units.
[0123] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 5As shown, the computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores prefabricated housing layout optimization data. The I / O interfaces are used for information exchange between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a prefabricated housing layout method based on a genetic algorithm.
[0124] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0125] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0126] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0127] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0128] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).
[0129] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0130] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0131] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for prefabricated residential unit layout based on genetic algorithm, characterized in that, The prefabricated residential unit layout method based on genetic algorithm includes: The planar space is divided into grids according to a preset grid size to create a modular grid. Based on the design requirements and constraints of the apartment layout and area, the functional modules of the rooms are encoded on the modular grid to generate an initial population; the constraints include neighbor and location constraints. By using a genetic algorithm to iteratively optimize the initial population, the optimal layout scheme for prefabricated residential units can be obtained.
2. The prefabricated residential unit layout method based on genetic algorithm according to claim 1, characterized in that, Based on the apartment layout and area design requirements and constraints, room functional modules are encoded on the modular grid to generate an initial population, including: The number of room functional modules is determined based on the apartment size and design requirements. Based on the number of room functional modules and constraints, the room functional modules are encoded on the modular grid to generate an initial population.
3. The prefabricated residential unit layout method based on genetic algorithm according to claim 1, characterized in that, The room functional modules include a living room, a bedroom with a bathroom, a double bedroom, a single bedroom, a kitchen, a bathroom, a dining room, an entrance hall, and a circulation corridor.
4. The prefabricated residential unit layout method based on genetic algorithm according to claim 3, characterized in that, The neighbor and location constraints include: All spaces are adjacent to each other; The entryway is located to the south, east, or west of the kitchen; The entryway is located at the edge of the overall layout; The living room is located to the east, west, or north of any of the bedrooms; The dining room is located to the south, east, or west of the kitchen, or to the north, east, or west of the living room; The bathroom is located to the east, west, south, or north of the kitchen; The bedroom with ensuite bathroom is located to the east or west of another bedroom; The double bedroom is located to the east, west, south, or north of another bedroom or living room; A single bedroom is located to the east, west, south, or north of another bedroom or bathroom; The largest bedroom is located on the south side of the entire layout; Each space must be adjacent to at least two other spaces.
5. The prefabricated residential unit layout method based on genetic algorithm according to claim 1, characterized in that, The room's functional modules are coded, specifically including: The room function module is coded based on the coordinates of the lower left corner and the length and width of the room function module.
6. The prefabricated residential unit layout method based on genetic algorithm according to claim 1, characterized in that, Using a genetic algorithm, the initial population is iteratively optimized to obtain the optimal layout scheme for prefabricated residential units, specifically including: The initial population is penalized based on the unit size ratio constraint to obtain the unit size ratio penalty result; The fitness value of each individual in the unit type ratio penalty result is calculated according to the fitness function; each individual is a prefabricated residential unit type layout scheme. Determine whether the stopping criterion is met. If not, perform a selection operation on the housing ratio penalty result based on the fitness value of each individual in the housing ratio penalty result to obtain the selected population. Perform crossover and mutation operations on the selected population to generate the next generation population corresponding to the next iteration number; The next generation population corresponding to the next iteration number replaces the initial population, and the "penalize the initial population based on the unit type ratio constraint" step is returned until the stopping criterion is met, then the iteration ends and the optimal prefabricated residential unit type layout scheme is generated.
7. The prefabricated residential unit layout method based on genetic algorithm according to claim 6, characterized in that, The fitness function is: Where f is the fitness function; w1 represents the weight of the side length of the room functional module, w2 represents the weight of the number of outlines, w3 represents the weight of the redundant area; |L| represents the number of types of side lengths of all room functional modules. Indicates the number of corners along the entire room's outline; C x,y The coordinates of the turning point; The area represented by w is the excess area of the rectangle enclosed by the entire room; S is the area occupied by the rectangle enclosed by the entire room; i, h i These are the length and width of the i-th room's functional module, respectively.
8. A prefabricated residential unit layout device based on a genetic algorithm, characterized in that, The prefabricated residential unit layout device based on genetic algorithm includes: The modular mesh creation module is used to divide a planar space into grids according to a preset grid size and create a modular mesh. An initial population generation module is used to encode room functional modules on the modular grid based on the apartment area design requirements and constraints, thereby generating an initial population; the constraints include neighbor and location constraints. The iterative optimization module is used to use a genetic algorithm to iteratively optimize the initial population and obtain the optimal layout scheme for prefabricated residential units.
9. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that the processor executes the computer program to implement the prefabricated residential unit layout method based on a genetic algorithm as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the prefabricated residential unit layout method based on the genetic algorithm as described in any one of claims 1-7.