<<

ARCHITECTURAL LAYOUT THROUGH SIMULATED ANNEALINGALGORITHM

HAO ZHENG1 and YUE REN2 1University of Pennsylvania, Philadelphia, USA [email protected] 2University College London, London, UK [email protected]

Abstract. Simulated Annealing is an artificial intelligence algorithm for finding the optimal solution of a proposition in an ample search space, which is based on the similarity between the physical annealing process of solid materials and the combinatorial optimization problem. In architectural layout design, although usually rely on their subjective design concepts to arrange in a site, the judging criteria hidden in their design concepts are understandable. They can be summarized and parameterized as a combination of penalty and reward functions. By defining the functions to evaluate a design , then using the simulated annealing algorithm to search the optimal solution, the plan can be optimized and generated automatically. Six penalty and reward functions are proposed with different parameter weights in this article, which become a guideline for architectural layout design, especially for residential area . Then the results of several tests are shown, in which the parameter weights are adjusted, and the importance of each function is integrated. Lastly, a recommended weight and “temperature” setting are proposed, and a system of generating architectural layout is invented, which releases architects from arranging work in an early stage. Keywords. Architectural Layout; Simulated Annealing; Artificial Intelligence; Computational Design.

1. Introduction to the Simulated Annealing Algorithm 1.1. METROPOLIS ALGORITHM Metropolis et al. (1953) firstly developed a method, especially running in computers, for finding the minimum or maximum value of a function, which may be complicated and hard to describe. Rather than recursively comparing values in the function and finding the direction of optimizing to reach the objective value, in the metropolis algorithm, there is a distinct possibility that the program will accept a worse result and its optimizing direction so that the optimizing process will not get trapped in a local optimum. Figure 1 shows a minimum optimizing process. In the optimizing process, the current state xn results in its value in the function f(xn). When the process moves

RE: Anthropocene, Proceedings of the 25th International Conference of the Association for Computer-Aided Architectural Design Research in Asia (CAADRIA) 2020, Volume 1, 275-284. © 2020 and published by the Association for Computer-Aided Architectural Design Research in Asia (CAADRIA), Hong Kong. 276 H. ZHENG AND Y. REN

forward, the next state xn+1results in its value in the function f(xn+1), which is compared with the current value. If f(xn+1) is smaller than f(xn), such as f(x2) compared with f(x1), the current state will move to xn+1 and waiting for the next loop.

Figure 1. Optimizing Process of Metropolis Algorithm.

However, if f(xn+1) is greater than f(xn), such as f(x3) compared with f(x2), in the metropolis algorithm, the program will calculate a probability of acceptance, which indicates whether the state will ignore the result and still move forward, as following:( ) f(x ) − f(x ) p = exp − n+1 n f(x )≥f(x ) (1) T n+1 n Therefore ideally, with a proper setting of variable T, which is an inputted parameter controlling the updating possibility and frequency, the process will jump out of the local optimum f(x2) and eventually reach the global optimum f(x5).

1.2. SIMULATED ANNEALING AND ITS APPLICATIONS In the metropolis algorithm, the setting of variable T will primarily affect the accuracy and efficiency of the optimizing process. To find the best setup, Kirkpatrick, Gelatt, and Vecchi (1983) developed the Simulated Annealing Algorithm, changing the variable T into a process-related variable, which will decrease gradually so that the probability of accepting a worse result will become smaller and smaller, and finally reach a stable status without any acceptances of the worse outcomes. This process is similar to the physical annealing, where variable T acts as a temperature value to control the annealing rate, so it’s called Simulated Annealing. The detailed procedure can be expressed as the following four steps: (1) Set the starting temperature value as ts, the ending temperature value as te, the function to update the T value as Tt, and the initial x value as x0. Update the optimized x value xopt by x0 and calculate f(xopt). (2) Apply a random change to xopt and get xn, then calculate f(xn). (3) If f(xn) is smaller than f(xopt), update xopt by xn. If f(xn) is greater than f(xopt), calculate the probability of acceptance p(xn, xopt), then generate a random number pn between 0 and 1. If pn is greater than p(xn, xopt), update xopt by xn. (4) Update the current T value tn by T (tn). If tn is greater than te, execute (2) and loop the procedure. ARCHITECTURAL LAYOUT DESIGN THROUGH SIMULATED 277 ANNEALING ALGORITHM

Thus, for any given objective function f(x), the Simulated Annealing Algorithm can find the best way to approach the global optimum. Sen and Stoffa (1991) applied the Simulated Annealing Algorithm in engineering, minimizing the error energy between the data and theories in seismic waveform inversion. Abramson (1991) built a system to find the best solution for the school timetabling problem. Tracey, Clark, and Mander (1998) constructed an optimized data generation framework to find program flaws. Ekren and Ekren (2010) used the simulated annealing algorithm to optimize the size of the wind hybrid energy conversion system. In urban, structure, and fields, the Simulated Annealing Algorithm also has a wide range of applications. Hong (2011) built a model to achieve accurate forecasting of inter-urban traffic flow. Sonmez (2008) developed a method to optimize a structure to be lightweight, high-performance, and low-cost. AlHalawani et al. (2013) built a framework to produce a factored facade representation and a facade analysis algorithm with the help of Simulated Annealing. Yeh (2006) solved the facility layout problem in the interior design of a hospital by generating floor , while Michalek, Choudhary, and Papalambros (2002) developed a similar method to arrange rooms in a .

1.3. PROJECT GOAL Different from the previous research, this paper focuses on the Simulated Annealing Algorithm in arranging buildings in the site, especially for residential area planning, developing unique functions to describe the main aspects when designing the architectural layout, optimizing and making a balance between each design focus. Through this research, we want to provide a useful tool for architects that the layout of the residential buildings can be generated by controlling the parameters of the design tendency, thus showing an example of translating design ideas and strategies into parameters with a more mathematical method.

2. Penalty and Reward Functions in Architectural Layout Design 2.1. PARAMETERS AND MEANINGS To clarify the question and the working limit, parameters to represent the condition and the requirements of the design were proposed firstly (figure 2). For the site, when designing, all parameters are already set and cannot be changed. Parameters include Pent for the position of entrance, Gbou for the boundary geometry of the design area, Asun for the local sunshine angle in the winter solstice, and Griv for the geometry of the river or any attractions. These four parameters stay constant and will be used to define penalty and reward functions. 278 H. ZHENG AND Y. REN

Figure 2. Parameters in an Architectural Layout Design.

Then for the buildings, which need to be placed into the site, parameters include Gn for the boundary geometry of each building, Pn for the entrance position of each building, Hn for the height, An for the rotating angle, Xn and Yn for the relative position of each building. Among them, Gn Pn and Hn are pre-designed and should keep constant, while Xn Yn and An are the main parameters, which will be fed into the Simulated Annealing Algorithm as x value for the objective function f(x).

2.2. PENALTY FUNCTIONS After defining all parameters, the objective function f(x) was developed as the weighted sum of 6 sub-functions. First, to avoid any glaring geometric errors for architectural design, two penalty functions were proposed (figure 3).

Figure 3. Penalty Functions.

One is called Out-of-Boundary Penalty, which means, when the geometries of buildings are partly or wholly outside the site boundary, a minus point will be ARCHITECTURAL LAYOUT DESIGN THROUGH SIMULATED 279 ANNEALING ALGORITHM added into the objective function as the following formula: ∑n f1 = − k1 · Area(RegionDefference(Gi,Gbou)) (2) i=1 Also, when two buildings have an overlapping area, it doesn’t make sense. Thus another penalty function is called Overlapping Penalty, to avoid the collision of buildings, as follows: n∑−1∑n f2 = − k2 · Area(RegionIntersection(Gi,Gj)) (3) i=1 j=i

In the two formulas, k1 and k2 are factors that adjust the order of magnitude, since the unit in these two formulas is m2, which is different from the following formulas. And the proper settings of k1 and k2 will be discussed in the following pages.

2.3. REWARD FUNCTIONS In addition to the penalty functions, 4 reward functions were also constructed, to guide the system to find the best solution (figure 4).

Figure 4. Reward Functions.

First, if the entrance of a building is close to the access of the site, the system will give a reward point to the function, because it will be convenient for the building users. It’s called Convenience Reward, based on the following formula. 280 H. ZHENG AND Y. REN

The shorter the distance between two entrances, the higher score it will gain. While k3 acts as a coefficient, l3 is a minimum limit for the distance, protecting f3 from becoming too large. ∑n 1 f =k · (4) 3 3 Maximum(Distance(P ,P ), l ) i=1 i ent 3 Second, Attraction Reward was built, representing the landscape value in the site for each building. The system will find the closest point from the curve of the river to the center point of the building, and calculate the distance between two points. Then the angle between the normal of the river at that point and world vector X will be figured out as Ariv. By comparing Ariv with Ai, the orientation of the building facing the landscape will be evaluated. And the length of the boundary of the building will also be taken into account to represent the possible length of the area that the users can see the landscape from the building. Thus, the formula can be expressed as follows: n ∑ Length(G ) · (A + A ) f =k · i i riv (5) 4 4 Maximum(Distance(G ,G ), l ) i=1 i riv 4 The third and fourth functions are both about sunlight. Since all buildings are initially modeled in the world coordinate, in which positive X unit towards the north and the balconies are always in the southern part of a building, the only face that can receive direct sunshine is the southern curve in the geometry. Therefore, the Orientation Reward was proposed, indicating that if the building is facing south as it originally is, an additional reward will be given to the evaluation function. The formula for the Orientation Reward is: n ( ) ∑ π f =k · − A (6) 5 5 2 i i=1 Also, there are always shadows for each building, which may block the sunlight of other buildings, the last reward function, Sunlight Reward, will be given to the evaluation function, if the buildings are exposed to the sunlight in most of the daytime. To calculate the worst period of receiving sunshine, the local sunshine angle in the winter solstice Asun will be used to draw the boundaries of the shadows. Then by calculating the percentage of the area in the building, which is not covered by shadows in each period (7 am to 6 pm), the function will work adequately to feedback a reward number between 0 and 1, representing the overall condition of daylighting. The formula is: ∑ ∑ 18 Area(RegionDifference(G ,SunShadow(G ,H ,A ,t))) ∑n n t=7 i j j sun j=1 · f =k · Area(Gi) 12 (7) 6 6 n i=1 Lastly, by adding all 6 functions together, the final objective function is completed as follows:

f = f1+f2+f3+f4+f5+f6 (8) ARCHITECTURAL LAYOUT DESIGN THROUGH SIMULATED 281 ANNEALING ALGORITHM

3. Parameter Regulation 3.1. FUNCTION WEIGHTS SETTINGS

Before inputting Xn Yn and An to optimize the objective function f, there are 6 coefficients, k1 k2 k3 k4 k5 and k6 adjusting the weights of sub-functions. Different settings of these six parameters may result in totally different optimums, showing the design strategies from different design requirements. To find the best settings, several tests were carried out. First, k1 and k2 were set as huge numbers, so that once the geometric error happens, the penalty functions will work in priority to drag the optimizing process back to the acceptable track. Then, priority was given to different sub-functions by enlarging corresponding k value, to test the effect of each reward function. Figure 5 shows the generated results. The optimizing process starts from an initial status that all buildings are arranged in the center of the site, where Xn = 0.5, Yn = 0.5, and An = 0.

Figure 5. Generated Results with Different Parameter Weights.

In figure 2), with a more considerable k3 value for the Convenience Reward, the buildings gather near the entrance, but only building No.6 still stands far away from the entrance because of the bonus of not shadowing other buildings. In figure 3), the Attraction Reward acts as the primary role, so all buildings are placed along the river and facing toward the nearest points in the river. In figure 4), while the Orientation Reward forces all buildings to keep zero-rotated, other factors like the 282 H. ZHENG AND Y. REN attraction of landscape and entrance still work to construct the proper architectural layout. In figure 5), when the Sunlight Reward provides more bonus points, buildings tend to become more rotated and very precise in positions to avoid being covered by the shadows of other buildings. Especially for building No.4, it turns itself a lot to precisely match the boundary of the shadows from building No.6. In figure 6), a balanced consideration of parameter weights is applied to the objective function, so that all factors work together to generate a layout that, building No.2 follows the Convenience Reward, building No.5 follows the Attraction Reward, building No.1, No.3, and No.4 follow the Orientation Reward, and building No.6 follows the Sunlight Reward.

3.2. TEMPERATURE AND COOLING SETTINGS

With the integrated weight settings found in the previous tests, Xn Yn and An were then inputted into the Simulated Annealing for optimizing. Galapagos in Grasshopper was used as the calculator to run the algorithm. Mention before, in Simulated Annealing, ts is the starting temperature value and T (t) is the function to update the temperature parameter, which is usually a recursive decreasing function as following:

T (t) = kt · t (9) In Galapagos, ts and kt can be given by the users as “temperature” and “cooling” to define how significant the initial probability of acceptance and the decreasing rate should be. Different settings may affect the efficiency of the optimizing process and the final result. Figure 6 shows the layouts of different settings after running the program for 5 minutes. Generally speaking, when ts is equal to 100%, and kt is equivalent to 0.95, the objective function f is more significant than other results. Comparing the figures in each row, when kt keeps the same, settings with more substantial ts value will generate a better layout, whose f value is more significant. This phenomenon indicates that the optimizing process for an architectural plan is very complicated, it contains multiple locally optimal solutions, so the more significant initial probability of acceptance will help the process avoid being trapped in the early stage. However, comparing the figures in each column, more considerable kt value does not help to improve the results. For example, in figure 3), when kt is equal to 0.99, which means the probability of acceptance almost keeps constant, the optimizing process runs very slowly. Hence, all buildings are still close to the initial status and stick together. Because the decreasing rate is too low, the optimizing process will keep accepting worse conditions and stay on a very superficial level, which is very inefficient. But if kt value is too small, for example, 0.90, which means the decreasing rate is too large, the process will soon close its gate for accepting worse status, then be trapped in local optimal. Therefore, the experiments tell that the best kt value is 0.95 for architectural layout optimizing. But if there is no limitation for the running time, the settings with more considerable kt value should perform better. ARCHITECTURAL LAYOUT DESIGN THROUGH SIMULATED 283 ANNEALING ALGORITHM

Figure 6. Layout Results with Different t and k Values.

4. Conclusion Simulated Annealing is a powerful artificial intelligence algorithm for finding the optimal solution based on the metropolis algorithm and the physical annealing process. Simulated Annealing can be applied to optimize architectural layout design, with customized penalty and reward functions and proper settings of parameter weights. Out-of-boundary penalty, overlapping penalty, convenience reward, attraction reward, orientation reward, and sunlight reward work together as the objective functions to guide the optimizing process. When running the 284 H. ZHENG AND Y. REN algorithm, proper settings of the “temperature” and “cooling” parameters in Simulated Annealing help avoid the local optimal to find the global optimal and increase the efficiency. In the future, by setting the weights of the objective functions, architects can translate their design ideas and strategies into parameters, and efficiently use the Simulated Annealing to generate architectural layout design plans, which releases architects from building arranging work in an early stage.

References Abramson, D.: 1991, Constructing school timetables using simulated annealing: sequential and parallel algorithms, Management science, 37 (1), 98-113. AlHalawani, S., Yang, Y., Liu, H. and Mitra, N.J.: 2013, Interactive Facades Analysis and Synthesis of Semi￿Regular Facades, Computer Graphics Forum, 32, 215-224. Ekren, O. and Ekren, B.Y.: 2010, Size optimization of a PV/wind hybrid energy conversion system with battery storage using simulated annealing, Applied Energy, 87 (2), 592-598. Hong, W.: 2011, Traffic flow forecasting by seasonal SVR with chaotic simulated annealing algorithm, Neurocomputing, 74 (12-13), 2096-2107. Kirkpatrick, S., Gelatt, C.D. and Vecchi, M.P.: 1983, Optimization by simulated annealing, science, 220 (4598), 671-680. Metropolis, N., Rosenbluth, A.W., Rosenbluth, M.N., Teller, A.H. and Teller, E.: 1953, Equation of state calculations by fast computing machines, The journal of chemical physics, 21 (6), 1087-1092. Michalek, J., Choudhary, R. and Papalambros, P.: 2002, Architectural layout design optimization, Engineering optimization, 34 (5), 461-484. Sen, M.K. and Stoffa, P.L.: 1991, Nonlinear one-dimensional seismic waveform inversion using simulated annealing, Geophysics, 56 (10), 1624-1638. Sonmez, F.: 2008, Structural optimization using simulated annealing, Simulated annealing, 2008, 281-306. Tracey, N., Clark, J. and Mander, K.: 1998, Automated program flaw finding using simulated annealing, ACM SIGSOFT Software Engineering Notes, 23, 73-81. Yeh, I.: 2006, Architectural layout optimization using annealed neural network, Automation in , 15 (4), 531-539.