amiina bakunowicz: genetic algorithm, fitness vs crossover vs mutation

7
Genetic Algorithm Amiina Bakunowicz page 1 ARCHITECTURAL SCENARIO The proposed Genetic Algorithm creates a search space of possible genes of tower blocks with the predefined total living floor area. The genes determine the shape of the four wings of which the tower’s floor plan consists. More likely the wings in- tersect, therefore one third part of the fitness factor is set to be the proportion of the total intersecting area in relation to the actual total floor area. The smaller the ratio, the higher is the fitness factor. The other two thirds of the building’s fitness represent how close the actual total floor area of each tower is to the originally defined total floor area. Starting from the bottom the images below show the three stages of the project. The image on the bottom right corner demonstartes few of the numerous possible shapes and heights of the building and also the intersecting areas of the each floor. “Ability to generate non-obvious designs in which components are interconected in complex ways” Manuel DeLanda,2011

Upload: archilab-7

Post on 12-Apr-2017

197 views

Category:

Design


2 download

TRANSCRIPT

Page 1: Amiina Bakunowicz: Genetic Algorithm, Fitness vs Crossover vs Mutation

1

Genetic Algorithm

Amiina Bakunowiczpage 1

ARCHITECTURAL SCENARIO

The proposed Genetic Algorithm creates a search space of possible genes of tower blocks with the predefined total living floor area. The genes determine the shape of the four wings of which the tower’s floor plan consists. More likely the wings in-tersect, therefore one third part of the fitness factor is set to be the proportion of the total intersecting area in relation to the actual total floor area. The smaller the ratio, the higher is the fitness factor. The other two thirds of the building’s fitness represent how close the actual total floor area of each tower is to the originally defined total floor area. Starting from the bottom the images below show the three stages of the project. The image on the bottom right corner demonstartes few of the numerous possible shapes and heights of the building and also the intersecting areas of the each floor.

“Ability to generate non-obvious designs in which components are interconected in complex ways”

Manuel DeLanda,2011

Page 2: Amiina Bakunowicz: Genetic Algorithm, Fitness vs Crossover vs Mutation

2

Msc Architecture: Computing and Design 2012/2013no :: u1235266tutors :: Emmanouil Zaroukas, John Harding

Amiina Bakunowiczpage 2

Genetic Algorithm: Stage I1. Body plan:

It is a tower that consists of four blocks of a certain number of floors high. The blocks are located around the lift shaft and constructed from the points 1,2,3 and 4 respectively:

2. Intensive properties of the bodyplan:

With each iteration a new set of blocks is simulated as if dropped from the height on the existing ones. On collision the top block travels within the bottom one by a certain distance (d) that is calculated in the following way.By the law of Newton’s universal gravitation a force that is accumulated within the falling object is F = mgm = Dwlh (mass of a body = density *width*length*height) *assumption is made that the top block is softerg = 9.81m/s2 (Earth’s standard acceleration due to gravity)

d - distance that top block travels within the bottom block after the collisiond = F/(d*S) * i (i an adjustment index)d = Dwlhgi/Dlw=hgi

3. Golden Section application:

The list of certain length with the numbers from Golden Section is cre-ated: [0.38, 0.62, 1.0,1.62, 2.62, 4.24, 6.86]

6. CONCLUSION:

No evolution was observed. The shape of the towers did not pass the “eyeball test” and the adjustment to the bodyplan has to be made.

4. GA’s construction variables:

Number of genes is 5Length of each gene is 3

Associations for each block or extensive properties of the bodyplan:block1 width = Gene01 + random number form the “golden” listblock2 width = Gene02 + random number form the “golden” listblock3 width = Gene03 + random number form the “golden” listblock4 width = Gene04 + random number form the “golden” list

block1 length = block1 width * random number form the “golden” listblock2 length = block2 width * random number form the “golden” listblock3 length = block3 width * random number form the “golden” listblock4 length = block4 width * random number form the “golden” list

blocks height = Gene05 * random number form the “golden” list (note, that floor numbers of blocks vary in each iteration)

Constants or global variables:- number of individuals - number of generations- the floor height- total floor area of the building- mutation rate- crossover rate

Fitness Factor:Proximity of the final total floor area to the pre-determined total floor area

Page 3: Amiina Bakunowicz: Genetic Algorithm, Fitness vs Crossover vs Mutation

3

Genetic Algorithm: Stage II

Amiina Bakunowiczpage 3

1. The blocks changed the shape and instead of rectangles in plan they were turned into petal-like form in a way that they more likely intersect with each other. This was done on purpose to give greater search space for the evolution of the shape of the plan.

2. The new fitness factor was introduced to add to the previous one. It controls this intersection. The smaller the intersection, the higher the fitness value is:

3. The blocks are now one floor high.

6. To make it easier to read the resulting fitness landscape the population was color-coded in the following way:5. Evolved population:

7. CONCLUSION: No evolution was observed and the mistake was to use random numbers within the algorithm.

4. GA’s construction variables:

Number of genes is 4Length of each gene is 3

Associations for each block or extensive properties of the bodyplan:ne01 + random number form the “golden” listblock2 width = Gene02 + random number form the “golden” listblock3 width = Gene03 + random number form the “golden” listblock4 width = Gene04 + random number form the “golden” list

block1 length = block1 widthblock2 length = block2 widthblock3 length = block3 widthblock4 length = block4 width*Note a random association in the length association was removed to see if it makes noticeable difference

Constants or global variables:- number of individuals - number of generations- the floor height- total floor area of the building- mutation rate- crossover rate

Fitness Factor:- 1/3 of the total is the intersection area of the blocks- 2/3 of the total is the ratio of the building’s total floor area to the required total floor area, for example:

Curvature of the curve of the blocks is 1

Curvature of the curve of the blocks is 3

pt1 = [origin[ 0] + Xdst, origin[ 1] + Ydst, totalHeight] pt2 = [origin[ 0] + Xdst - (len/2 ), origin[ 1] + Ydst + w, totalHeight] pt3 = [origin[ 0] + Xdst - len, ori-gin[ 1] + Ydst, totalHeight] pt4 = [origin[ 0] - (2 * Xdst)- w/ 2, origin[ 1] + Ydst - w, totalHeight] pt5 = [origin[ 0] - (2 * Xdst), ori-gin[ 1] + Ydst, totalHeight] pt6 = pt1block1 width = Ge

Page 4: Amiina Bakunowicz: Genetic Algorithm, Fitness vs Crossover vs Mutation

4

Genetic Algorithm: Stages of the Development

1. Random numbers had to be eliminated from the bodyplan construction. It is point-less to assign a set of genes for each block on each floor, therefore the shape of each block had to remain the same throughout the whole height of the building.

2. The composition of the fitness was reac-cessed. More important factor is to get the smallest ratio possible of the building’s total floor area to the required total floor area. Therefore it represents 2/3 of the global fit-ness factor, leaving a third to the intersection area of the blocks.

4. GA’s construction variables:

Number of genes is 16Length of each gene is 4

Associations for each block or extensive properties of the body-plan:block1 dimension1 = Gene01block1 dimension2 = Gene02block1 dimension3 = Gene03block1 dimension4 = Gene04

The same rule applies to the creation of the dimensions for the other three blocks requiring in total 16 genes.

Constants or global variables:- number of individuals - number of generations- the floor height- total floor area of the building- mutation rate (as an option can be replaced with the manual mutation of user-determined number of individuals)- crossover rate (as an option can be replaced with the manual crossover of user-determined number of couples)- width of the corridors- width/length of the lift shaft

Fitness Factor:- 1/3 of the total is the intersection area of the blocks- 2/3 of the total is the ratio of the building’s total floor area to the re-quired total floor area

5. The bulidings are all of differ-ent heights. The samller the floor area, the higher the building. The code keeps on adding on floor after floor until the substruction of predefined and the actual total floor area is smaller than the area of one floor:

STAGE III

Page 5: Amiina Bakunowicz: Genetic Algorithm, Fitness vs Crossover vs Mutation

5

Genetic Algorithm: Stage III and Experiments

Experiment 1.

Random mutation with muta-tion rate 0.1, random crosso-ver with crossover rate 0.9.

Predetermined very low mutation and very high crossover factors. The algorithm did select a con-stant shape but the fitness factor could not be increased over the generations. The shape of the each individual was getting more and more similar across all tow-ers and became pretty much con-stant by around 20th generation.

Experiment 2.

Random mutation with muta-tion rate 0.2, random crosso-ver with crossover rate 0.9.

The mutation was increasd to 0.2 and the average fitness fac-tor was gradually decreasing over the generations.

Experiment 3.

Random mutation with muta-tion rate 0.1, random crosso-ver with crossover rate 1.

Predetermined very low mutation and the highest crossover fac-tors. As in the previous experi-ment, the algorithm did select a constant shape and the fitness factor could not be increased over the generations. However The flat patches in the fitness landscape were evolving over the period of 23-30 generations.

3D of Fitness landscape, which is “a possibility space of self-rep-licating entities to which fitness values have been assigned” (De-Landa, M. 2011, p. 50)

Page 6: Amiina Bakunowicz: Genetic Algorithm, Fitness vs Crossover vs Mutation

6

Experiment 4.

Manual mutation, random crossover.

“As long as differncies exist they fuel a process of selection...the copying errors or mutations provide the necessary variabil-ity to prevent fitness from dis-appearing” (DeLanda, M. 2011, pp.48-49), therefore process of mutation is crucial in the world of biology. Genetic Algorithm ful-fillls much more limited purpose, where “the target of the search is set by the test cases provided by designer”. It means that he/she has much more control over the selection process and may not need that many mutations. Only if self-replication starts going one, very predictable way, only then single or numerous muta-tions can be triggered at the right places to observe an unusual re-sult in the next few generations.

Observations: Above average crossover rate of 0.8 applied randomy. Muattions were per-formed at different stages of the algorithm. The system was very sensitive to even smalles muta-tions. The more generations were mutated the longer it took the population to recover to get back to produce generations with high-er fitness factor.

Experiment 6.

Manual mutation, manual-crossover.

Once the system developed speed of producing population with the higher fitness, after it has been mutated over few gen-erations it took some time to slow the process down and gen-erations with lower fitness factors appear. Even if mutating quite a high number of individuals in one generation, it was very difficult to reverse the process of success-ful evolution. The system cor-rected itself very quickly. It took time but it recoved. It shows the opposite tendencies to the algo-rithm with the set random muta-tion and crossover rates shown in the experiment 1 where the population couldnt even get to the point of starting to produce the generations with the higher fitness factors.

Conclusions and Observations:

- within first 10-15 generations a desired and/or intersting shape must be evolved with the help of using either mutations or crossovers or both together. Therefore the designer must start iad the shape selection with the controls of mutation or crossover the earlier the better, but definitely within firs 5-10 generations.After the shape is formed the optimum fitness level can be easily achieved by crossing over right couples and keeping mutation close to zero.

- according to DeLanda and as observed in the experiments above, crossover can replace the mutation when the poulation does not need to be tested for survival qualities but rather to concentrate on adjusting certain parameters of the individuals over the generations.

- It was noted that the bigger the predetermined max floor area, the highet the building can raise and the higher the average fitness factor can become

- “The only thing that emerges in simulations using GAs is specific solutions to specific problems. The fact that the latter are posed by the experimenter makes the problems themselves somewhat artificial but within this limited domain the solutions are indeed found by evolutionary search.” (DeLanda, M. 2011, p. 54)

Possible future experiments with the algorithm:

- -error thrshold is a critical mutation rate (error rate) beyond which struc-tures obtained by an evolutionary process are destroyed more frequently than selection can reproduce them http://www.ncbi.nlm.nih.gov/pub-med/16831105. The mutation rate can be varied to test the existence of the error threshold. It depends on a chromosome length and the selection pres-sure- experiment with the fitness landscape , which “structure depends both on the distribution of singularities and how fitness varies in the neighbourhood of those singularities” (DeLanda, M. 2011, p. 50).- experiment with the manual mutation. “After all, the original CAD model must be endowed with mutation points at just the right places (an this in-volves design decisions) and much creativity will need to be exercised to link ornamental and structural elements in just the right way. But still this seems a far cry from a design process where one can develop a unique style.” (De-Landa - Deleuze and the Use of the Genetic Algorithm in Architecture)

- experiment with the mutation colouds and the thoery of quasi-spieces, which is a “group of the mutated inividuals observed over the generations. This cloud has tendency to move within a fitness landscape not in a random manner but performing a “search for a local optima fitness”...If the mutation rate is zero than the cloud cannot be formed, and vice versa if its too high then the internal relationships of the mutants cannot be formed. The theory of quasi-spieces predicts that clouds with the capacity to search fitness land-scape will tend to lie near the error threshold in order to have as many mu-tations as possible without suffering desintegration. (DeLanda, M. 2011, p. 53)

Experiment 5.

Random mutation, manual crossover.

Crossover is used to generate variation. It can replace the mu-tation in order to increase “the parallelism of the search” within the population. It is explained with the fact that it would cre-ate strings , that ”share building blocks and they would not be like a cloud of points moving thorugh the possibility space but rather like a set of slices covering much widerr area” (DeLanda, M. 2011, p. 63)

Observations: Very low muta-tion factor of 0.2 and very high manual crossover rate (4 out of 5 couples were crossed over on average). A very gradual increase in generations’ average fitness value.

As previously, the shape of the each individual was getting more and more similar across all tow-ers and became pretty much con-stant by around 20th generation.

Page 7: Amiina Bakunowicz: Genetic Algorithm, Fitness vs Crossover vs Mutation

7

Conclusions and Observations:

- within first 10-15 generations a desired and/or intersting shape must be evolved with the help of using either mutations or crossovers or both together. Therefore the designer must start iad the shape selection with the controls of mutation or crossover the earlier the better, but definitely within firs 5-10 generations.After the shape is formed the optimum fitness level can be easily achieved by crossing over right couples and keeping mutation close to zero.

- according to DeLanda and as observed in the experiments above, crossover can replace the mutation when the poulation does not need to be tested for survival qualities but rather to concentrate on adjusting certain parameters of the individuals over the generations.

- It was noted that the bigger the predetermined max floor area, the highet the building can raise and the higher the average fitness factor can become

- “The only thing that emerges in simulations using GAs is specific solutions to specific problems. The fact that the latter are posed by the experimenter makes the problems themselves somewhat artificial but within this limited domain the solutions are indeed found by evolutionary search.” (DeLanda, M. 2011, p. 54)