### Generative Design through Genetic Algorithms

Genetic algorithms performs highly efficient when all the parameters are connected, and is not possible to maximize one value without affect the others. For this experiment a GA is used as a design exploration tool. A binary list `1,0,1,0,0,0,1` represent a series of cubes stacked together to creates a rectangular cuboid (20x15x30 units composed by 1x1x1 cubes) used as a test bed for the different explorations. The `1` represents a cube and the `0` represents a void.

##### FITNESS FUNCTION

the fitness function consist in balance a series of parameters, which are:

• Maximize the Volume: The idea behind to explore the maximum building volume is usually driven by economics aspirations, like maximize the space for offices or residential units.
• Minimize site occupation Area: Good buildings are usually generous with public space, which implies create soft and hard surfaces to allow the people meet.
• Penalize the Distance between the building and other constraints in the surrounds: Since a building belongs to an urban network, there are many constraints to satisfy, like right of lights or sightline restrictions, among others.

The final shape will be the result of balance these parameters. From one side the volume needs maximized and populate the maximum numbers of cubes `1` in the rectangular cuboid. In the other hand, the area operates in the opposite direction: Maximize the number of voids `0` in the lower levels of the rectangular cuboid. The developer’s Manhattan function: Maximize the volume and minimize the use in the ground floor. (COATES, Paul., Programming.Architecture, Nueva York, Routledge, 2010, p. 97 ). Finally the distance parameter, react to different inputs, which in this case have been represented by attractor and repeller points. If some part of the building is inside of an influence area the chromosome is punished or rewarded.

The model (Genetic algorithm) works as a curator engine to select the highest ranked designs from the generative process. The designer, can also define other constraints to represent as much as possible the real environment of the design. The objective will always consist in to find the subtle balance between all parameters.

This experiment take advantage of GAs as generative design engine to search the most suitable shapes according to the parameters. The goal consist in satisfy all the functions in the fitness function: `min = ( f(x1), f(x2, f(x3), f(x4), …, f(x+i) )`. Since is not possible to makes at least one function better off without making any other function worse off, this definition is knowing as Pareto frontier.

##### GENETIC ALGORITHM PARAMETERS

The following list is the parameters used for the Genetic Algorithm. To test the robustness and variability of the algorithm, several test were performed. The following parameters do not represents the best tune for the solution but a good approximation.

• Objective Function: Fitness = (fitSequence + Volume) – ( (InsidePts x 2) + footPrint))
• Codification: Binary string. ('0', '1', '0', '1', '1', '0')
• Type of problem: Multi-objective
• Number of generations: 300
• Size of population: 20
• Natural selection: Roulette Wheel, scaled by non-polynomial function.
• Crossover: Uniform crossover (1 point)
• Mutation: Bit string mutation, 0.01% Test bed example: Geometric representation of the problem
The semi transparent orange spheres represent the attractor and repeller points. The rectangular cuboid have been represented in black lines. On the right examples of an iterations.

##### DESIGN

Chromosome: The Chromosome is made by a binary list: `0,0,0,1,0,0,1,0,1,1,1,0,0`. The `1` represents a cube position and the `0` a void.

Fitness function:
`If ( footPrint > 45) Then footPrint = footPrint * 5`
`If ( Volume > 800) Or ( Volume < 700) Then Volume = Volume * 0.5`
`Fitness = ( fitSequence + Volume ) – ( ( InsidePts x 2 ) + footPrint ) )`

Natural Selection: The natural selection implemented is a roulette wheel scaled by a non-polynomial function and a learning rate parameter to manage the factor decay in the curvature. This feature allows a detailed control in the natural selection algorithm. Crossover:
Two types of crossovers where implemented: Single point crossover and uniform crossover. The single point crossover works splitting the parents in two stripes in order to create offspring. Moreover, the uniform crossover use a random number (50%) to determine if the father or the mother will inheritance the gen to the offspring. Both algorithms return 2 offsprings. The uniform crossover returns a more randomly result than the single point method. The idea behind to implement both strategies relies in to include a "little bit of noise" to delay the convergence of the result. Mutation
The mutation operates swapping a 1 for a 0 or vice versa. according to the mutation percent parameter.

##### PROCESS For this experiment, the buildings have been distributed in the space using another A.I. technique The red spheres represent different constraints like, Right of light, ventilation, sightline restrictions, minimum distances, etc In the image above os possible to understand how the GA react with the different constrains, and the results make sense White render, to represent the group of buildings White render, to represent how could looks like a city or neighbor