Introduction: The goal of this project was to automatically generate floor plans by implementing the wave function collapse (WFC) algorithm. By utilizing predefined room adjacency rules, the algorithm arranges rooms in a grid-based floor plan layout. The below steps outline the process:
Data Collection and Room Adjacency Rules: Collect a dataset of room types and their corresponding adjacency rules. These rules will define how different room types can be placed next to each other. For example, a bedroom can be adjacent to a corridor, while a kitchen should be adjacent to a dining area. Ensure the dataset covers a wide range of room types and their valid adjacency relationships.
Grid Initialization: Create a grid that represents the floor plan, where each cell in the grid corresponds to a potential room placement. Initially, mark all cells as undecided or empty.
WFC Initialization: Choose a starting point on the grid and assign a wave to it. The wave represents the possible room types that can be placed in that cell based on the defined rules. The wave is initialized with all possible room types.
Constraint Propagation: Propagate the constraints of the room adjacency rules throughout the grid. Analyze the neighboring cells of the starting point and update their waves based on the adjacency rules. This ensures that neighboring cells only allow room types that can be adjacent according to the defined rules.
Iterative WFC Collapsing: Perform iterations of the wave function collapse algorithm until the grid is fully filled or a satisfactory solution is found. In each iteration, select a cell with the minimum entropy (uncertainty) and collapse its wave to a single room type based on the rules and neighboring cells' constraints. This process continues until the floor plan is generated.
Handling Contradictions: During the iterative process, contradictions may arise where no room type can be placed in a cell based on the neighboring constraints. Implement a mechanism to handle such contradictions. Backtracking can be used to make alternative choices in previous steps and resolve the contradiction.
Iteration and Refinement: Continue the iterations and wave collapsing until the floor plan is fully generated. Experiment with different parameters, room types, and rules to refine the generated layouts. Iterate on the algorithm to improve the overall quality of the generated floor plans.
Post-Processing: Once the floor plan is generated, perform post-processing steps to refine the layout. This may involve adjusting room sizes, optimizing traffic flow, considering aesthetic considerations, or incorporating additional features into the floor plan layout.
Evaluation and Testing: Evaluate the generated floor plans against predefined criteria such as adherence to room adjacency rules, usability, and aesthetic appeal. Conduct testing to ensure the algorithm produces diverse and valid floor plans consistently.
User Interface and Visualization: Develop a user interface that allows users to input their preferences and constraints. Provide visualizations of the generated floor plans for users to review and provide feedback. Enhance the user interface for ease of use and interactive exploration of floor plan variations.
Deployment and Integration: Deploy the auto layout generation system, either as a standalone application or as an integrated feature within existing architecture design software. Integrate the system with other relevant modules or processes to create a comprehensive design tool.
Iterative Improvements: Collect user feedback and continuously improve the system by incorporating additional features, refining rules, and enhancing the algorithm based on real-world usage and practical considerations.