106
NATURAL SYSTEMS STUDIO 2012 SHERMAN LAM

final

Embed Size (px)

DESCRIPTION

Natural System Studio

Citation preview

Page 1: final

NA

TU

RA

L S

YS

TE

MS

ST

UD

IO 2

01

2

SH

ER

MA

N L

AM

Page 2: final

PREFACE 3

.0THETHEORYOFEMERGENCE 5

2.0COMPUTATIONALSIMULATION 13

.NaturalSelectionandMutation 7

.2TheComplexSystem 9

.3Architecture 10

.4ThePotential 11

2.Computation 15

2.7AutonomousAgents 35

2.4Force 25

2.0GeneticAlgorithms 51

2.2Movement 16

2.8CellularAutomata 41

2.5Oscillations 29

2.NeuralNetworks 57

ShermanLam2960

Tutor:StanislavRoudavski

Tutor:GwyllimJahn

NaturalSystemStudio

UniversityofMelbourne202

2.3Probability 17

2.9Fractals 47

2.6ParticleSystem 33

Page 3: final

2

CONTENTS

3.0EMERGENTPROJECT 63

4.0CONCLUSION 97

REFERENCES 103

APPENDIX:SKETCHES 104

APPENDIX2:SMOVIES 104

3.2Stigmergy 67

4.2Techniques 100

4.3Designapproaches 102

4.4Futurework 102

3.5Project2 75

3.3Precedents 68

3.6Project3 84

3.4Project 71

3.AnimalArchitecture 65

4.Concept 99

Page 4: final

3

Page 5: final

4

PREFACE

Theflutteringofabutterfly'swinginRiodeJaneiro,amplifiedbyatmosphericcurrents,couldcauseatornadoinTexastwoweekslater.EdwardLorenz

Weliveinacomplexworldinwhicheverythingisinterrelated.Aflapofabutterflymaycauseachainofirreversibleeffectsonnotjustthesurroundingsbuttheentireworld.Thisisthetheory of butterfly effect, coined by Edward Lorenz. Fromthecomplexsystem,itleadsto'Emergence',theresultantoftheinteractionsamongstindividualentityinthesystem.Howcouldoneunderstandor findorder in this complex systemandhowwillitinfluencearchitecturaldesign?Thisbookwillbedividedinto4parts.Thefirstpartwilllookintothetheoryofemergencewithregardtothenaturalworldandarchitecture.Thesecondpartwill explore thepotential of computationalsimulation and its technique. The third part documents theemergentprojectdevelopedusingthetheoryofpartandthetechniqueinpart2andhenceexploreitspotentialinarchitec-ture.ThelastpartwillbetheconclusionofallthetheoriesandtechniquesIlearnintheprocessofconstructingthisalbum.

Background:http://natgeotv.com/asia/great-migrations/galleries/AflockofMonarhButterfliesduringtheirseasonalmigration.

Page 6: final

5

Page 7: final

6

.0THETHEORYOFEMERGENCE

//.NaturalSelectionandMutation

//.2TheComplexSystem

//.3Architecture

//.4ThePotential

Background:http://science.nationalgeographic.com/wallpaper/science/photos/rocks/giants-causeway/TheGiant'sCausewayinNorthernIrelandisanexampleofacomplexemergentstructurecreatedbynaturalprocesses

Page 8: final

7

.NaturalSelectionandMutation

Itisnotthestrongestofthespeciesthatsurvives,northe most intelligent, but the one most responsive tochange.CharlesDarwin

The Nature is a complex system which is constantlyevolving.Itdoesnotfollowatop-downapproach,andhas no predetermined goals. Evolution as suggestedbyDarwin,isaprocessofhoworganismsadapttoitssurrounding environment. The new generation is dif-ferentfromthepreviousgenerationanditisconstantlyevolving to adapt to the newenvironmentwithmuta-tionastheresultantoftheadaptationprocess.Throughnaturalselection, itwillbe themost responsive to theenvironmentsurviveeventually.There issomuchwecanlearnfromthenaturalsystem.WhatIproposeisnotthebio-mimicry thatonly imitates theaestheticof thenaturebutthestudyofthesystemwhichbringsalongthemutationinresponsetothechangeofenvironment.

.:http://2.bp.blogspot.com/Diversityandcomplexityemergethroughtheprocessofnaturalselectionandmutation.

QUOTE-http://en.wikiquote.org/wiki/Charles_Darwin

Page 9: final

8

Complex biological forms developed fromverysimplebeginning,andnaturalselectionwas themeans bywhich each species be-camemoreperfectlyfittedtoitsenvironment.

MichaelWeinstock2

QUOTE2-pp.22TheArchitectureofEmergent-TheEvolutionofForminNatureandCivilisation,Weinstock,Wiley

Page 10: final

9

.2THECOMPLEXSYSTEM

Acomplexsystemistheresultantofthenumerousinter-actionofindividualentitywithitsimmediateneighboursandwiththeenvironment.Anindividualentitymayonlyperformaverysimpletask,howeverwiththeiterationofeachindividualentityrespondingtotheenvironment,acomplexsystemisemerged.Acomplexsystemisabletotacklethemostdifficulttaskwhichisimpossibleforasingleentitytohandle.Acolonyoftermiteswillbuildacomplex termitemould responsive toenvironmentalchangeswhichwillenablethecolonytosurviveasonesystemwheresingletermitewillneverbeabletosur-viveonitsown.Similartothetermitecolony,thecom-plexstructureofthecoralisformedbytheiterationofmillionsofsimpleorganisms.

.2

.3 .4

.2:http://www.reefcheckaustralia.org/adopt-a-coral-polyp.htmlCoralconsistedofmillionsofsipleorganisms.3:http://www.getintravel.com/adventure-travel-to-kakadu-national-park-in-australiaComplexstructureoftheTermiteMounds.4:http://en.wikipedia.org/wiki/Great_Barrier_ReefBarrierReefisthelargestsinglestructuremadebylivingorganism

Page 11: final

0

.5:http://www.sciencephoto.com/media/85854/enlarge/

Khara-KhotoinInnerMongoliawasonceathrivingcityoftheTangutEmpireasdescribedinMarcoPolo'straveljournal.Howeveritwasaban-doned700yearsagoafteritslifeline,theBlackRiverwasdiverted.Thisisanexampleofcitiesfailingtoadopttothechangeoftheenvironment.

.3ARCHITECTURE

InWeinstock'sArchitectureofEmergence,Weinstock illus-tratestheresemblancebetweentheevolutionofnatureandthe evolution of civilisation.Cities reconstruct and expandovertimetoadapttothechangesinenvironment.Similartotheprocessofnaturalselectionwherespecieextinctifitfailstoadapttochanges.Speciesdiversifyandevolutestoadapttochangesof its immediateenvironment.Thisresultsinanemergent systemwhich constantly evolves to the reachingofequilibrium.Withtheadvancementoftechnologyandthepowerofcomputationalsimulation,acomplexsystemcouldbeincorporatedintothedesignofarchitectureuponanequi-libriumoftheneedsoftheuserswithregardstototheeverchangingenvironmentisderived.

Page 12: final

.4POTENTIAL

Computational design lends itself to an integral designapproachas it enablesemployingcomplexbehaviourratherthanjustmodellingaparticularshapeorform.Weinstock3

The twostructuresexplore thepotential of computational simulationasa tool that formu-latethedesignratherthanasimpleshapingtool.Technologyallowsgreater integrationofconstructioninthedesignprocess.Withtheavailabilityofthematerial,theclimateandthecontextofthesitebecometheparametersformulatingthedesign.Theknowledgeofpara-metricdesignalsoenablesthedigitalfabricationofthematerialwhichreducesthetimeandnumberofskilledlaboursrequiredfortheconstruction.ContrasttotheMembraneCanopy,theviewingplatformutilisesmoremundanebuildingmaterialswithlimitedtechnology.ThecomputationalprocessenablesthecomplexityofdesignsimilartotheAAmembranehowev-erwithlimitedmaterialandtechnology.

.6 .7

QUOTE3-pp.5Emergenttechnologiesanddesign:towardsabiologicalparadigmforarchitecture,Hensel,Menges&Weinstock,Routledge

Page 13: final

2

.6:http://www.achimmenges.net/AAMembraneCanopy,London2007

.7:http://www.achimmenges.net/ViewingPlatformandShelteratHaciendaQuitralco,Patagonia,Chile2007

URBANAGENCY-ROLANDSNOOKS.8

"Thepropositionoftheprojectisthatanorganismcapableofautonomousorin-telligentdriftthroughtheurbanfabricisabletodevelopanemergentarchitecturalformandorganisationintrinsicorpeculiartoitsenvironment."kokkugia.com

Theresultantisthereactionoftheagenttotheenvironmentandthusitsbe-haviour.Theagentconstantlyextractsandexchangesinformationwiththeenvironmentandthenevolvesaccordinglytotheinformationextractedfromtheenvironmentandeventuallystrikesanequilibrium.

.8

Page 14: final

3

Page 15: final

4

2.0COMPUTATIONALSIMULATION

//2.Computation

//2.2Movement

//2.3Probability

//2.4Force

//2.5Oscillations

//2.6ParticleSystem

//2.7AutonomousAgents

//2.8CellularAutomata

//2.9Fractals

//2.0GeneticAlgorithms

//2.NeuralNetworks

Background:http://ngm.nationalgeographic.com/202/04/flamingos/nig-ge-photographyAflockofFlamingos

Page 16: final

5

2.COMPUTATION

THECOMPUTATIONALBEAUTYOFNATURE,GARYWILLIAMFLAKE,MITPRESS

Startwithsomethingsosimpleasnottoseemworthstatingandtoendwithsomethingsoparadox-icalthatnoonewillbelieveit.BertrandRussell4

Theessayintroducestheconceptofcomputationalmodellingofnature.Computationalmodellingwillbethekeytounderstandthecomplexsystemofnature.Despitethecomplexityofnature,itcanbeunderstoodthroughareductionisticapproachwhichbreaksdownthesystemintomultiplesimpleagent that interactswitheachother.Oneof theexamplesofsuchapproach is thestudyofDNAwhicheventuallyyieldsabetterunderstandingofacomplexsystemasawhole.Similarapproachcanalsobeusedtounderstandtheformationofemergentpatterninnature.Thiswillallowustocomprehendthecomplexsysteminnature,andtoemploythemethodtoconstructcomplexsolution.Theprocessofcomputationalsimulationutilisesthesystemof'iteration','recursion'and'feedback'toachievecomplexity.Suchbottomupapproachallowsthegenerationofcomplexityandemergentbehaviourwhichdrawsparalleltonature.Flakedividesthetheoryofcomputationalsimulationintofivedifferentconcepts:computation,fractal,chaos,complexsystemandadaption.Computationex-ploresthelimitofcomputerandwhatarethefactorsdeterminingthefunctionabilitytobecomputed.Fractalexploreshowiteratingequationcanbuildupcomplexity.Chaosexaminestherandombe-haviourwhichleadstounpredictabilityinthelongrun.Complexsystemexamineshowinteractionsofsimpleagentswithinasystemcanleadtoacomplexsolution.Finally,adaptionallowsthecomplexsystemtochange,tolearnandtoevolvewhichultimatelymimicintelligence.

2.

QUOTE4-pp.TheComputationalBeautyofNature,GaryWilliamFlake,MITPress

2.-pp.7TheComputationalBeautyofNature,GaryWilliamFlake,MITPress

Page 17: final

6

2.2MOVEMENT

Thisprocessingsketchusesthebouncingballssketchasabasistodevelopthepixilatedeffect.Thepixilatedeffectwasachievedbymovingtheparticlesinthevalueofthewidthofthepirticles.Thissketchalsousestheobjectsystemtoincreasethenumberobjectsinthesketch.Sametothebouncingballsketch,theobjectwillbouncebackonceithittheedgesofthescreen,thiswasachievedbymultiplyingthespeedbynegative.Thespeedoftheobjectsarealsorandomizedbythevalueofto0pixels.Furthermorethecoloursoftheobjectsarerandomlydrewfrom3presetcolours.

2.2

Page 18: final

7

2.3PROBABILITY

Page 19: final

8

2.3Convergence,JacksonPollock952

2.4BrownianSunflow,Toxiclibs

2.3-http://arthistory.about.com/od/from_exhibitions/ig/action_abstraction/jm-aa_08_08.htm

2.4-http://toxiclibs.org/200/02/new-package-simutils/

Randomness

Probability is the core concept behindrandomness. Probability is the frame-work while randomness is the mecha-nismtoproduceresult.RandomnessisusedinArttoexpressthesubconsciousmind,ortogenerateoutcomethatisfreefromrulesandboundaries. Incomputerscience,randomnessisframedbyprob-ability.Insteadofbeingtruly 'random', itisratherthevisualizationofthepossibili-tiesofagivenprobabilityinanalgorithm.If the sample size is large enough, the'random' samples will always be veryclosetothevalueofthegivenprobability.

Page 20: final

9

RANDOMWALK

2.5

B

C

D

A

Page 21: final

20

2.6

2.7

RANDOMWALK2.5Thissketchusesrandomwalkeraswellas an array list function. The randomwalkerfunctionwillbeessentialtodevel-opspontaneousandorganicbehaviourthatmimicthenaturebutithaslimitationas it does not generate 'real' randomnumberswhichformulateapattern.

2.6This sketch furtherexplores thepoten-tialoftherandomwalker.Eachparticleis initially located ina random location,thensprawloutrandomlyatarandom-izedspeed.Same to thebouncingballsketch,theparticlesbouncebackinanopposite direction once it hits the edg-es of the screen. A line is then drawnwhen two particles are within a presetdistance,andatrianglewithrandomizedcolour is drawn when there are threeparticleswithinapresetdistance.

2.7With the connecting lines and trian-gles, it givesa false impressionof a 3dimensionalspacethoughit isonlya2dimensionalsketch.Withthissketch,aninterestingobjectcanbecreatedifthereis a logic behind themovement of theparticles. The 'logic' or 'behaviour' willdetermine the path of movement andhencecreateanobjectthatresponsetotheparticleitself.

B

B

C

A

A

Page 22: final

2

LEVYFLIGHT

2.8

B

A

Page 23: final

22

LEVYFLIGHT

Inthelevyflight,therandomwalkbehaviouroftheagentsisdeterminedbyprobability.Inthesketch,Isettheproba-bilityat70%.Whichmeantheagentwillhave70%chanceofperformingarandomwalkand30%chanceofwalkinginstraightline.Theresultisatrailconsistingbothrandommovementandstraightline.

//Random Walkvoid move() { int xstep; int ystep; float choice = random (1); if (choice < 0.7){//tendency to move randomly xstep = int(random(0,3))-1; //random walk for x ystep = int (random(0,3))-1; //random walk for y

}else{ xstep = 1; //random walk for x ystep = 1; //random walk for y } x += xstep*xspeed; // acceleration y += ystep*yspeed;

Page 24: final

23

PERLINNOISE

2.9

B

A

Page 25: final

24

PERLINNOISE

ThissketchusesthePerlinNoiseconcepttodeterminethemovementinsteadofcompleterandomness.ThePerlinNoiseisstructuredsimilartoaudiosignal,inrespecttothefunction'suseoffrequency.Thetrailoftheparticlesresultintoamorecurvelikeandsmoothpattern.Theuseoffrequencyenablethefluctuationnumber(randomness)inacurvelikemanner.

//CONSTRUCTOR

Parti(){ loc = new PVector(random(width),random(height)); xstep = pow(-1,round(random(1,2))); //random walk for x ystep = pow(-1,round(random(1,2))); //random walk for y}

//the power function here determine if the xstep or ystep valueis positive //or negative by using probability

void move() { float angle = noise(loc.x/noiseScale,loc.y/noiseScale) * noiseStrength; loc.x += cos(angle) * xstep; loc.y += sin(angle) * ystep;

//The Perlin Noise function

Page 26: final

25

2.4FORCE

Page 27: final

26

MOUSEATRACTION

2.0

Page 28: final

27

MOUSEATTRACTION

ThissketchexplorethepotentialofthePVectorfunction.Thelocationofthemouseservesastheattractorfortheparticlesandifthemouseisleftclicked,theparticleswillbeattractedtothecursoratanacceleratedspeed.Thismimicthegrav-itionalforceattractingasteroidhittingororbitingtheplanet.

2.GravitionalAttraction 2.2Orbit

void update() { // Compute a vector that points from location to mouse PVector mouse = new PVector(mouseX,mouseY); PVector acceleration = PVector.sub(mouse,location); // Set magnitude of acceleration acceleration.normalize(); acceleration.mult(0.1); // Velocity changes according to acceleration velocity.add(acceleration); // Limit the velocity by topspeed velocity.limit(topspeed); // Location changes by velocity location.add(velocity); }

2.-http://article.wn.com/view/202/06/5/Asteroid_zips_past_Earth/

2.2-http://www.dailygalaxy.com/my_weblog/20/04/-new-earth-companion-asteroid-discovered-in-an-odd-orbit.html

Page 29: final

28

FRICTION&WIND

Thissketchexplorethepotentialofincorporatinganexternalforcetotheobjects.TheforceisappliedtowardtheaccelerationoftheobjectaccordingtoitsmassasF=mxa.Thethreeforcesintroducedinthissketcharewindwhichpushedtheobjectshori-zontally,gravitytopulltheobjectsdownwardandairfrictiontoreduceitsacceleration.

2.3

B

A

C

Page 30: final

29

2.5OSCILLATIONS

Page 31: final

30

2.4Oscillationsofripples

2.5Belousov-Zhabotinskyreaction-non-linearchemicaloscillation

2.4-http://esfsciencenew.wordpress.com/2009/03/04/earthquake-waves/

2.5-http://www.metafysica.nl/dissipative_systems.html

Oscillations is a dynamic sta-bility system. Values changesrepetitively within a given time-frameresultingasmoothgraphofvariationinastatusofequilib-rium.Ripplesoscillateaccordingto the forceof the initial ripplesin agiven timeframe.Chemicaloscillation records the changesofstateofachemical foragiv-enduration.Forscripting,oscil-lationwill provide a varying yetstablevariabletothealgorithm.

Page 32: final

3

DOUBLEPENDULUM

2.6

BA C

D E F

Page 33: final

32

DOUBLEPENDULUM

Thissketchexaminetheshift fromtheCartesianvectorco-ordinate(withx&y)tothepolarvectorcoordinatewithangleand themagnitude.Thisallowme tocreatesketch like thependulumswingwhichrequireapolarsystemofcoordinateto reference thependulumand the locationof theoriginofthestring.Asecondpendulumisthenconnecttothelocationofthefirstpendulum,theresultantisadoublependulumwithdynamicmovement.

//based on Shiffman’s sketch

Pendulum(PVector origin_, float r_) { origin = origin_.get(); location = new PVector(); r = r_; angle = 5*PI/6; aVelocity = 0.0; aAcceleration = 0.0; damping = 0.999; }

void go() { update(); display(); }

void update() { float gravity = 0.4; aAcceleration = (-1 * gravity / r) * sin(angle); aVelocity += aAcceleration; aVelocity *= damping; angle += aVelocity; }

void display() { location.set(r*sin(angle), r*cos(angle), 0); location.add(origin);

stroke(200,10); strokeWeight(0.5); line(origin.x, origin.y, location.x, location.y); ellipseMode(CENTER); fill(250,80,random(150),150); ellipse(location.x, location.y, 5, 5);}}

Arbitarydamping

Arbitaryconstant

Incrementangle

Drawarm

Drawpendulum

Calculateaccelerationofpendulum

Polarcartesianconversion

Page 34: final

33

2.6PARTICLESYSTEMS

Page 35: final

34

Based on Daniel Shiffman’s code

class ParticleSystem {

ArrayList<Particle> particles; PVector origin; PImage tex;

ParticleSystem(int num, PVector v) { particles = new ArrayList(); origin = v.get(); for (int i = 0; i < num; i++) { particles.add(new Particle(origin)); } }

void run() { Iterator<Particle> it = particles.iterator(); while (it.hasNext()) { Particle p = it.next(); p.run(); if (p.dead()) { it.remove(); } } }

void addParticle() { particles.add(new Particle(origin)); }

void addParticle(Particle p) { particles.add(p); }

boolean dead() { if (particles.isEmpty()) { return true; } else { return false; } }}

In this sketch I added the particle system class tomanage the particles within the class. I introducethevariableoflifespanwhichgraduallydecreaseitsown value.And once it reaches zero, the particlesis remove from the system. The removing and thecontinuous adding of particles allow the system toreachastateofequilibriuminasenseofalifecycle.And instead of drawing the particlewith ellipse(), Iuse an image function to reference external imageastheparticle.

ParticleSystems

Particlesystemsallow thegenera-tionof largequantitiesofparticles.Thiswouldenablethesimulationtoproduce realisticnaturalphenome-na such as fire, smoke, dust... Asfor complex system, each of theparticlescanbeaffectedbyexternalinfluence,suchaswind,generatingaunpredictedglobalbehaviour.

2.7Rendersmokeusingparticlesystem

2.7-http://directtovideo.wordpress.com/2009/0/06/a-thoroughly-modern-particle-system/

Storetheoriginpoint

Removeparticle

Page 36: final

35

2.7AUTONOMOUSAGENTS

Page 37: final

36

AGENTBEHAVIOUR

2.8

BA

C D

Autonomousagentshavetheabilitytobehaveormoveau-tonomous.Theirbehaviour is influencedby its immediateneighbourandreactaccordingly.Theycouldalsobeinflu-encedbyglobalvariablesasdoparticlesystems.

Page 38: final

37

SEPERATION

ATTRACTION

ALIGNMENT

2.9

2.20

2.2

Page 39: final

38

REPELAGENT

2.22

2.23

B

B

A

A

C

C

Page 40: final

39

AGENTBEHAVIOUR

Thissketchsimulateasystemwithmultipleagentsreactingwith each other. Each of the agents is given three set ofdifferent forcewhichwillbeactivateuponeachother if theagents iswithincertainproximityofanotheragent.Theat-tractionforceattracttheagentstogether,theseparationforcerepelagainsttheagentswhileflockingallowagentstofollowthevelocitydirectionof itsneighbour.Thesketchresemblethemovementofpackanimalsuchasflockofbirdsorfishes.

inthesecondsketchIintroducearepelagentswhichmoverandomly and possess of a much larger separation force.This forceaway theoriginalagents.The result resembleaflockfishevadingitspredators.

2.24Aschooloffishesavoidingtheirpredator

2.24-http://www.docstoc.com/docs/89588/Black-and-White-School-of-Fish-PPT-Content-Theme-Slide

Page 41: final

40

//base on Jose Sanchez’s tutorial

void align(float magnitude){ Vec3D steer = new Vec3D(); int count = 0; for (int i = 0; i < particles.size(); i ++) { Parti other = (Parti) particles.get(i); float distance = loc.distanceTo(other.loc); if (distance > 0 && distance<30){ steer.addSelf(other.speed); count++; } } if (count > 0){ steer.scaleSelf(1.0/count); } steer.scaleSelf(magnitude); acc.addSelf(steer);} void cohesion(float magnitude) { Vec3D sum = new Vec3D(); int count = 0; for (int i = 0; i < particles.size(); i ++) { Parti other = (Parti) particles.get(i); float distance = loc.distanceTo(other.loc); if (distance > 0 && distance<70){ sum.addSelf(other.loc); count++; } } if (count > 0){ sum.scaleSelf(1.0/count); } Vec3D steer = sum.sub(loc); steer.scaleSelf(magnitude); acc.addSelf(steer); Vec3D stop = sum.sub(loc); stop.scaleSelf(magnitude); bacc.addSelf(stop);}

void seperate(float magnitude){ Vec3D steer = new Vec3D(); int count = 0; for (int i = 0; i < particles.size(); i ++) { Parti other = (Parti) particles.get(i); float distance = loc.distanceTo(other.loc); if (distance > 0 && distance<40){ Vec3D diff = loc.sub(other.loc); diff.normalizeTo(1.0/distance); steer.addSelf(diff); count++; } } if (count > 0){ steer.scaleSelf(1.0/count); } steer.scaleSelf(magnitude); acc.addSelf(steer);}

void flee(float magnitude) { Vec3D stop = new Vec3D(); int count = 0; for (int i = 0; i < repell.size(); i++) { repellWalker temprepell = (repellWalker) repell.get(i); float distance = loc.distanceTo(temprepell.loc); if (distance > 0 && distance < 200) { Vec3D diff = loc.sub(temprepell.loc); diff.normalizeTo(1.0/distance); stop.addSelf(diff); count ++; } if (count > 0) { stop.scaleSelf(1.0/count); } stop.scaleSelf(magnitude); acc.addSelf(stop); } }

Adddirectionofneighbouringparticle

2.2Alignment

2.20Attraction

2.9Seperation

2.22RepellAgents

Page 42: final

4

2.8CELLULARAUTOMATA

Page 43: final

42

CellularAutomata isadynamicalsystem that isdiscrete inbothspaceand time. Itconsistsofaregulargridofcellswhichhasafinitenumberofstate,suchasonandofforincomputationalterm0and.Thechangesofthestatearetriggeredinreponsetotheconditionofitsimmediateneighboursandthecurrentstateofthecell.InDthiswouldbethetwocellsonitsrightandleft,whilein2Dthiswouldbetheeightcellsoritsperimeter,topleft,top,topright,right,bottomrightandsoforth.CellularAutomataisdevelopedbyUlamandvonNeumannin the940sasaframeworktostudytheprocessofproductionandself-replicatingsystem.Thesystemconcentrateson thesimplestmathematicalframeworkthatallowsinformationtoreproduce.

Thepatternofsomeseashellsre-semble the pattern ofWolfram'srule30CellularAutomata.

2.25-http://en.wikipedia.org/wiki/File:Textile_cone.JPG

2.XWolfram'srule30CellularAutomata

2.25Seashell

Page 44: final

43

2.272.26

B

B

A

A

Page 45: final

44

2.26ThetwoimagesherearetheGen-erativeArtbyJonathanMcCabe.Theart isgeneratedbyusingtheprincipleof Cellular Automata. Each pixel rep-resentsthestateof4cellsof4cellularautomatawhichhavetheirowntransi-tiontable.Thehistoryofthestateofthecellsalsochanges the transition tableand updates the rule. This results inadynamic juxtapositionofcontrastingcolour.

2.27TheGrayScottsketchresemblesthe pattern produced by the reactionand diffusion of chemical species.Though the algorithm behind thissketchmaybemorecomplex,thecoreprincipleisthesamewithCA.Thecellschangeitsstateaccordingtoitscurrentstate and the state of its local neigh-bours.

2.26-http://neurofuture.blogspot.com.au/2007/02/cellular-automata.html

2.27-ToxiclibGrayScottToneMapprocessingsketch

GAMEOFLIFE

TheGameofLifedevelopedbyJohnHortonConwayin the70s isa cellularautomation.Thecells inherehave2 states (liveanddie) and the cell changes itsstateaccordingtotheconditionofitsneighbourandasetoffixedrules:

.Ifalivingcellhaslessthan2neighbours,itdiesofloneliness.

2.IfaLivingcellhasmorethan3neighbours,itdiesofovercrowding.

3. Ifa livingcellhasexactly3neighbours, it remainsunchanged.

4.Ifadeadcellhasexactly3neighbours,itreborns.

The initial stateof cell isdeterminedbyaprobabilityof50/50.Inthesketch,manycellsdieleavingpatchesof livingcellsdispersedonthesketch.Eventuallythesketchwillcometoanequilibriumwheremanyofthecellsbecomestableor formapattern thatonlyoscil-latesin2ormorestates.Thereisnoparticular'equilib-riumpattern'inthesketch,itgeneratesdifferentresultwhenIrunit.Thisisperhapstheresultoftherandomprobabilityofthecellinitialstatesanditslocalrelation-shipwithitsimmediateneighboursinsteadofaglobalvariablesthatdictateitschanges.

Page 46: final

45

B

A

C

2.28

EventualPattern

Cellsdying

Initialstate

Page 47: final

46

//based on tutorial by Jose Sanchez

class CA{ Vec3D loc; int x; int y; int type = 0; int futType = 0; CA(Vec3D _loc, int _x,int _y){ loc = _loc; x = _x; y = _y; float rnd = random(100); if(rnd < 50){ type = 1; } } void run (){ display(); } void updateType(){ type = futType; } void evalN(){ int count = 0; if(grid[(x+cols-1)%cols][(y+rows-1)%rows].type == 1) count ++; if(grid[(x+cols)%cols][(y+rows-1)%rows].type == 1) count ++; if(grid[(x+cols+1)%cols][(y+rows-1)%rows].type == 1) count ++; if(grid[(x+cols-1)%cols][(y+rows)%rows].type == 1) count ++; if(grid[(x+cols+1)%cols][(y+rows)%rows].type == 1) count ++; if(grid[(x+cols-1)%cols][(y+rows+1)%rows].type == 1) count ++; if(grid[(x+cols)%cols][(y+rows+1)%rows].type == 1) count ++; if(grid[(x+cols+1)%cols][(y+rows+1)%rows].type == 1) count ++; if (type == 1 && count <2){ futType = 0; } if (type == 1 && count >3){ futType = 0; } if (type == 1 && count ==3){ futType = 1; } if (type == 0 && count ==3){ futType = 1; } } void display(){ if(type ==1){ stroke(255); strokeWeight(2); point(loc.x,loc.y); } } }

Rule

Rule2

Rule3

Rule4

Page 48: final

47

2.9FRACTALS

2.29-http://www.sfu.ca/~rpyke/335/fractal_landscape/fractal_lands2.html

2.30-http://www.boiledbeans.net/2009/0/28/log8log2/

2.3-http://classes.yale.edu/fractals/panorama/Architecture/IndianArch/India7.html

2.32-http://en.wikipedia.org/wiki/Mandelbrot_set

2.33-http://en.wikipedia.org/wiki/Mandelbulb

Page 49: final

48

Fractalsareselfsimilarpattern inwhichthepattern isexactly thesame ineveryscale.Thisistheresultoftherecursionofsimple algorithm. The complex outcomeis the resultof the iterationof the recur-siveprocessofthesimplealgorithm.

2.29 Fractal Landscape - is the natu-ral like surface or landscape generatedby stochastic algorithm with fractal be-haviour. Itmimics thenatural landscapebygeneratingnon-deterministicsurfaces.Inasensethisresemblestheprocessofthegenerationofforminnature.

2.30Lung-theveinsinthehumanlungresemblethefractalpattern

2.3HinduTemple-Manyarchitecturesof the past exhibit fractal structure. Thetemple is decorated by self-recursiveornaments which are identical in manyscales. The fractal aspect of the archi-tecturealso reflects the fractalnatureofHinducosmology.

2.32Mandelbrot set - The art is gener-atedbyalgorithmwith fractalbehaviour.Theresult isapatternthatisidentical ineveryscale.

2.33Mandelbulb-Mandelbulb is the3DexplorationoftheMandelbrotset

2.29

2.30

2.3

2.32 2.33

Page 50: final

49

2.34

2.35

Page 51: final

50

//based on tutorial by Jose Sanchez

void updatePt(){ Vec3D m = new Vec3D (mouseX, mouseY, 0); float d = m.distanceTo(pt1); if(mousePressed){ if(d < 30){ pt1 = m; } } float d2 = m.distanceTo(pt2); if(mousePressed){ if(d2 < 30){ pt2 = m; } } } void iterate(Vec3D p1, Vec3D p2, int iterations){ if(iterations > 0){ Vec3D oneThird = ptBetween(p1,p2,0.333,0); Vec3D twoThird = ptBetween(p1,p2,0.666,0); Vec3D halfUp = ptBetween(p1,p2,0.5,-0.2); iterate(p1, oneThird, iterations-1); iterate(oneThird, halfUp, iterations-1); iterate(halfUp, twoThird, iterations-1); iterate(twoThird, p2, iterations-1); if(iterations ==1){ stroke(255); strokeWeight(1); vLine(p1, oneThird); vLine(oneThird, halfUp); vLine(halfUp, twoThird); vLine(twoThird, p2); } } } Vec3D ptBetween(Vec3D p1, Vec3D p2, float ratio, float ratio2){ Vec3D dif = p2.sub(p1); float d = p1.distanceTo(p2); dif.normalize(); dif.scaleSelf(d*ratio); Vec3D rot = p2.sub(p1); rot.normalize(); rot.rotateZ(PI/2); rot.scaleSelf(d*ratio2); dif.addSelf(rot); dif.addSelf(p1); return dif; }

2.34

2.35 //based on Daniel Shiffman sketch

void newTree() { background(0); stroke(80,random(255),250,20); pushMatrix(); translate(width/2, height); branch(250); popMatrix();}

void branch(float h) { float sw = map(h, 2, 120, 1, 5); strokeWeight(sw); line(0, 0, 0, -h); translate(0, -h); h *= 0.66f; if (h > 1) { int n = int(random(1, 5)); for (int i = 0; i < n; i++) { float theta = random(-PI/2, PI/2); pushMatrix(); rotate(theta); branch(h); popMatrix(); } }}

Locationofstartpointandendpoint

Recursion

Fractalproperties

Theinitialstageofthetree,thehvaluedeterminethelengthofthebranches

Branchesiteratewithasmallerhvalueateachiteration

2.34This sketch is a basicexplorationoftherecur-sive behaviour in frac-talswithlinesdividedtoformaseriesoftriangle,the bottom line of thetriangles is thenerasedto form one continuousline. The outcome isidenticalwitheachrun.

2.35Insteadofafixedlengthand fixed angle, thissimulation uses ran-domizedlengthandan-gle to generate amorenatural looking form.And as those variablesare randomized, the fi-naloutcomeofeachrunisuniqueandunpredict-able.

Page 52: final

5

2.0GENETICALGORITHMS

Page 53: final

52

2.36Evolutionarybonechangesinhorses

2.36-http://commons.wikimedia.org/wiki/File:PSM_V5_D037_Evolutionary_bone_changes_in_horses.jpg

Geneticalgorithm isa formofartificialevolutionorAIbasedonDarwinian 'survivalof the fittest'.Underevolutionandnatural selection, the fittest, i.e.bestadapted tothegivenenvironmentwillsurviveandhaveahigherchancetoreproduce.Thenextgenerationwillcarrythetraitsofitsparentsandwillmutatethroughgenerations.Theeventualoutcomeistheobsolescenceandtheextinctionofthe'unfit'population.Or-ganismproducesgenotypeandphenotype.Genotypeisthecodedrepresentationofaproblemsolution.Inbiology,thiswillbetheDNAwhichcontainsthetraitsofparentorganismandinstructionforthedevelopmentofanorganism.Phenotypeisthenpro-ducedastheexpressionoftheorganism'sgenotypeandtheorganismisreproducedselectivelyaccording to the fitnesscriteria. In coding, thisbeginswithapopulationof randomlygeneratedagents.Eachagent is thenevaluatedby its fitness.Multipleagentswithdesired fitness levelare thenselected togeneratenewpopulationwiththetraitsoftheirparentsandrandomchanceofmutation.Theprocesswillbeiteratedingenerationstoproducesorevolvethemostdesiredoutcome.Inarchitecture,thiswill enable architects to generate complex solution to an array of criteria. Throughgenerationsofevolutionandmutation,thealgorithmwillproduceasolutionthatistheequilibriumofthearrayofcriteria.

Page 54: final

53

Strandbeest

Over time, these skeletons have becomeincreasinglybetteratsurvivingtheelementssuchas stormsandwater, andeventually Iwanttoputtheseanimalsoutinherdsonthebeachsotheywilllivetheirownlives.TheoJansen5

StrandbeestdesignedandbuiltbyDutchart-istTheoJansenisaseriesofwind-powered'animals'madeofplastictubes.Theanimalsare evolving, they are constantly improvedandthroughgenerations,theyhavebecomeexcellentlyadaptedtotheirsandybeachen-vironment. Jansen uses genetic algorithmtothelegsystemthatenablestheanimaltomove. The genetic algorithm allows the legsystemtoevolvetothemostsuitableconfigu-rationandtodeterminethelengthofeachofthecomponentsofthelegsystem.

2.37

2.38

2.392.37-http://www.designboom.com/art/theo-jansens-animarae-adulari-strandbeest-has-a-pivoting-neck/

2.38-http://couleurblind.com/20//08/theo-jansen/

2.39-http://www.archdaily.com/67928/theo-jansen-exhibition-the-beach-animal-that-eats-wind-theo-jansen-with-earthscape/

QUOTE5-http://www.strandbeest.com/

Page 55: final

54

ThesketchistweakaofDanielShiffman'ssmartrocketsketch.Theparticlesinthesketchmoveinarandomdirection.Ineachgeneration,thefitnessoftheparticlesareevaluatedaccordingtotheirproxim-itytothetarget.Thetraits(directionofmovement)oftheparticleswiththehighestfitnesslevelwillpasstothenextgeneration.

Eventuallyalltheparticleswillbeabletoreachthetargetinthemostefficientway,thisisevidencedbythehighconcentrationofcolourtowardthetarget.

2.40

BA

C D

Page 56: final

55

//based on Daniel Shiffman’s smart rocket

class Population {

float mutationRate; Rocket[] population; ArrayList<Rocket> matingPool; int generations;

Population(float m, int num) { mutationRate = m; population = new Rocket[num]; matingPool = new ArrayList<Rocket>(); generations = 0; for (int i = 0; i < population.length; i++) { PVector location = new PVector(width/2,height+20); population[i] = new Rocket(location, new DNA()); } }

void live () { for (int i = 0; i < population.length; i++) { population[i].run(); } }

void fitness() { for (int i = 0; i < population.length; i++) { population[i].fitness(); } }

void selection() { matingPool.clear(); float maxFitness = getMaxFitness(); for (int i = 0; i < population.length; i++) { float fitnessNormal = map(population[i].getFitness(),0,maxFitness,0,1); int n = (int) (fitnessNormal * 100); for (int j = 0; j < n; j++) { matingPool.add(population[i]); } } }

void reproduction() { for (int i = 0; i < population.length; i++) { int m = int(random(matingPool.size())); int d = int(random(matingPool.size())); Rocket mom = matingPool.get(m); Rocket dad = matingPool.get(d); DNA momgenes = mom.getDNA(); DNA dadgenes = dad.getDNA(); DNA child = momgenes.crossover(dadgenes); child.mutate(mutationRate); PVector location = new PVector(width/2,height+20); population[i] = new Rocket(location, child); } generations++; }

int getGenerations() { return generations; }

float getMaxFitness() { float record = 0; for (int i = 0; i < population.length; i++) { if(population[i].getFitness() > record) { record = population[i].getFitness(); } } return record; }}

Arraytoholdthecurrentpopulation

Arraylistformatingpool

Initializethepopulation

Createnewparticle

CalculateFitnessforeachparticles

Generatematingpool

Calculatetotalfitnessofwholepopulation

Generatenextgeneration

Picktwoparents

GettheirDNA

MatetheirDNA

MutatetheirDNA

Findthehighestfitness

ThehighertheFitness,themoreentriestomatingpool,morelikelytobepickasparent

Page 57: final

56

class DNA {

PVector[] genes; float maxforce = 0.1;

DNA() { genes = new PVector[lifetime]; for (int i = 0; i < genes.length; i++) { float angle = random(TWO_PI); genes[i] = new PVector(cos(angle), sin(angle)); genes[i].mult(random(0, maxforce)); } }

DNA(PVector[] newgenes) { genes = newgenes; }

DNA crossover(DNA partner) { PVector[] child = new PVector[genes.length]; int crossover = int(random(genes.length)); for (int i = 0; i < genes.length; i++) { if (i > crossover) child[i] = genes[i]; else child[i] = partner.genes[i]; } DNA newgenes = new DNA(child); return newgenes; }

void mutate(float m) { for (int i = 0; i < genes.length; i++) { if (random(1) < m) { float angle = random(TWO_PI); genes[i] = new PVector(cos(angle), sin(angle)); genes[i].mult(random(0, maxforce)); } } }}

class Rocket {

PVector location; PVector velocity; PVector acceleration; float r; float fitness; DNA dna; int geneCounter = 0; boolean hitTarget = false;

Rocket(PVector l, DNA dna_) { acceleration = new PVector(); velocity = new PVector(); location = l.get(); r = 4; dna = dna_; }

void fitness() { float d = dist(location.x, location.y, target.x, target.y); fitness = pow(1/d, 2); }

void run() { checkTarget(); if (!hitTarget) { applyForce(dna.genes[geneCounter]); geneCounter = (geneCounter + 1) % dna.genes.length; update(); } display(); }

void checkTarget() { float d = dist(location.x, location.y, target.x, target.y); if (d < 12) { hitTarget = true; } }

CreatenewDNAsequencewithtwogenes

Fitnessisdeterminedbyproximitytotarget

Checkifparticlesreachtarget

Mutatethegenes

Page 58: final

57

2.NEURALNETWORKS

Page 59: final

58

Neural Network is developed to solvetaskthatiseasyforthehumanmindbuthardforcomputer.Oneofsuchtaskwillbe pattern recognition. Artificial neuralnetworkmimicstheneuralnetworkfoundin nervous system.Each of themultipleinterlinking neurons only performs sim-pletasks,butthenetworkasaworkcanperformmuchcomplex task.Theneuralnetwork is a complex system in whichthe simple processing elements exhibitcomplexglobalbehaviour.Thepropertiesof the neuron are changed by informa-tion received, the neuron then process-es the information with reference to itsconnecting neighbours. The changes inthepropertyofeachneuron is recordedand itwillaffect theoutcomeof thepro-cessed information. Neural network canalsobetrainedwitha learningalgorithmthatmodifiesneuralconnectionbasedonexperience.

2.4AANN-AnalogArtificialNeuralNet-workisanelectronicsculpturethatmim-ics small neural cluster. The sculpturepicksupsoundanddetectslightthroughits receiver on its front, then the infor-mation is being processed and passedon to the rear through 45 neurons. Thesculpturethengeneratessoundfromthe3speakersinitsrear.Thesculpturepro-duces interesting result when it beginstalking to itselfas thesound itproducedbecomeslouderanditalsogeneratesin-terestingpatternswithitsledlightoneachoftheneurons

2.42Pyramidalneurons-biologicalneu-ralnetwork

2.4AANN

2.42Pyramidalneurons

2.4-http://www.steim.org/projectblog/2007/09/27/aann-a-steim-residency-project-report-by-phil-stearns/

2.42-http://en.wikipedia.org/wiki/File:Smi32neuron.jpg

Page 60: final

59

2.43

2.44

Page 61: final

60

2.45

Thissketchvisualizestheneuralnetworkinaction,itdoesnotgen-eratecomplexoutcomebutdoesshowhowtheflowsofsignalsareprocessedandpassedonthroughthenetworkofneurons.Thismim-icsthenervoussystem,howinformationisprocessedandpassedonfromsensorstothebrain.Thefirstimageshowstheinitialstageoftheneuralnetworkwitheachoftheneuronsmovingrandomly.Thesec-ondimageshowssignalsbeingmovingthroughthenetworkofneu-rons.Thelastimageshowstheeffectofdecreasingnumberofneu-ronswilldotothemovingofsignals.Thesignalsrequiremoretimetoprocessasthenetworkbeingcongested.Thismimicsthedeathofneuroncellsinanervoussystemwhichslowsdownthereactiontimeofaperson.Thissketchwillbemorerealisticifalltheneuronshaveafinitelifespanandconnectionoftheneuronswillbreakapartiftheneuronsspawntofarapart.

Page 62: final

6

// Tweak of http://www.openprocessing.org/sketch/65274

class Neuron { int refractory; float charge, threshold; float x, y, originalx, originaly; float xspeed = random(2); float yspeed = random(2); int id; Neuron[] connections; int num_connections; Neuron(int newid, int newx, int newy) { id = newid; x = newx; y = newy; originalx = x; originaly = y; num_connections = 0; charge = 0; threshold = random(START_THRESHOLD); refractory = 0; } void draw() { update(); move(); if (refractory > 0) { fill(refractory,255-refractory,0); stroke(refractory,255-refractory,0); } else { noFill(); stroke(0,255,0); } ellipse(x, y, NEURON_SIZE, NEURON_SIZE); noFill(); stroke(255*(threshold/START_THRESHOLD), num_connections, y, 10); for (int i=0; i<num_connections; i++) line(x, y, connections[i].x, connections[i].y); } void update() { if (refractory > 0) { refractory--; } else { if (charge > threshold) { for (int i=0; i<num_connections; i++) signals.add(new Signal(this, connections[i], random(FIRING_CHARGE))); charge = 0; refractory = int(random(REFRACTORY_TIME)); fill(255,255,255,200); ellipse(x,y,2*NEURON_SIZE,2*NEURON_SIZE); } } } void addCharge(float c) { if (refractory == 0) charge += c; } void move() { int xstep = int(random(0,3))-1; //random walk for x int ystep = int (random(0,3))-1; //random walk for y x += xstep*xspeed; // acceleration y += ystep*yspeed; if ((x > width-10) || (x < 10)) { xspeed = xspeed * -1; } if ((y > height-10) || (y < 10)) { yspeed = yspeed * -1; }}}

Checkifthereissignalintheneuron

DrawNetwork

Signalfadingout

Addingchargetosignals

Functiontoaddchargeintheinitialstage

Page 63: final

62

class Signal{

Neuron origin, destination; boolean alive; float progress, distance, charge; Signal(Neuron o, Neuron d, float c) { origin = o; destination = d; progress = 0; distance = dist(o.x,o.y,d.x,d.y); charge = c; alive = true; } void draw() { update(); stroke(origin.x,origin.y,charge*10,255*(charge/FIRING_CHARGE)); float signalx = lerp(origin.x,destination.x,progress/distance); float signaly = lerp(origin.y,destination.y,progress/distance); ellipse(signalx, signaly, SIGNAL_SIZE, SIGNAL_SIZE); } void update() { progress += SPEED_CONSTANT+(distance-progress)/SIGNAL_SPEED; if (progress > distance) { alive = false; destination.addCharge(charge); } }} void makeConnections(){ Neuron origin, destination; for (int i=0; i<NUM_NEURONS; i++) { origin = neurons[i]; origin.connections = new Neuron[0]; for (int j=0; j<NUM_NEURONS; j++) { destination = neurons[j]; if (origin.id != destination.id) { if (dist(origin.x, origin.y, destination.x, destination.y) < 80) { origin.connections = (Neuron[])append(origin.connections, neurons[j]); origin.num_connections++; } } } }} void drawSignals(){ Signal current; for (int i=0; i<signals.size(); i++) { current = signals.get(i); current.update(); if (!current.alive) { signals.remove(i); i--; } } stroke(0,255,0); for (int i=0; i<signals.size(); i++) signals.get(i).draw();}

Drawsignals

Signalsmove

Passingchargetodestinationneuron

Constructneuronnetworkforsignals

Page 64: final

63

Page 65: final

64

3.0EMERGENTPROJECT

//3.AnimalArchitecture

//3.2Stigmergy

//3.3Precedents

//3.4Project

//3.5Project2

//3.6Project3

Background:http://6legs2many.wordpress.com/tag/solenopsis-invicta/Amountainofexposedfireants,moundeduponthebroodpiletoconservemoisture.

Page 66: final

65

3.ANIMALARCHITECTURE

AGENTBEHAVIOUR&ANIMALARCHITECTURE

Animals have been building impressive structures that re-sponse to the environment.How simple organism such astermite can construct such a complex system?We shouldlookatthetermitecolonyasacomplexsystemcompriseofnumerousindividualagents,wecanseeeachagentperformsimpletaskatthesametimeresponsetooneanother,andthroughthecollectivebehaviouroftheagents,acomplexandemergentsystemisbuilt.TERMITEMOULD.-Atermitecolonyisasystemcom-prises of different classes of termites performing differenttasks-queen,warriorsandworkers.Theycommunicatewitheachotherbyleavingachemicaltrailwithwhichinformationisexchangedandthecolonyarticulated.Thecolonyactsasawholeasasingleorganismperformingmultipletasks,likefightingoffintruders,findingfoodandbuildingthemould.Asanindividualagents,eachtermitecollectsinformationoftheenvironmentandfeedsbacktothesystem.Themouldistheresultofthecollaborationoftheagentsinfluencedbythein-formationofthesurroundingenvironment.SOCIABLEWEAVERSNEST.2-Unlike the termitecolo-ny,thesociableweavershavearatherloosesocialstructure.Each compartment of the nest normally comprises of twoweaversandtheiroffspring.Theweaversdonotfeedinin-formationintothesystemasthetermitesdo.Theirbehaviourisinfluencedbythestructurebuiltuponbyotherweavers.Inasense,theweavershaveamoreindividualisticbehaviour.Thecollaborationoftheweaversisthereforedrivenbymu-tualbenefitof the individualsrather thanthesurvivalof thecolonyasawhole.

3.-http://science.howstuffworks.com/environmental/life/zoology/insects-arachnids/termite3.htm

3.2-http://victoriayeager.com/social-weavers-namibia-africa-a-social-study/

Page 67: final

66

3.

3.2

Page 68: final

67

3.2STIGMERGY

Stigmergyisaformofself-organizationinwhichitproducesacomplexandseeminglyintelligentstructurewithoutanyformofa'grandplanning'orcontrol.Instead,it isacollaborationofsomeextremelysimpleagents.Eachagenthasasimplesetofbehaviours,andonlyreactswithitsimmediateneigh-bour.Theresultantisanunpredictableandemergentpattern.OneofthebestexamplesofStigmergyinnatureisthe'pathfinding'and'pathfollowing'behaviourofants.Antsexchangeinformationwith each other by leaving 'pheromones' on itsroute to thenest of the colonyafter foraging for food.Thepheromone stimulate ants passing by to follow the trail to-wardthefoodsource, theant then leavepheromoneon itspath with which the intensity of pheromones accumulatedwithmoreantsfollowingthesamepath.Overtime,itcreatesanetworkoftrailslinkingthenestandthefoodsourcesinthemostefficientmanner.Termitesfollowthesimilarmethodtobuildtheircomplexnest.

Stigmergybehaviourgeneratescomplexsolutionandemer-gent pattern and is one of the key concepts in the field ofswarm intelligent. This could open up a new horizon andultimatelychangethewayweapproacharchitecture.Archi-tecture follows a top-down design approach. We 'design'the predetermined form, the predetermined structure andpredeterminedbrief.Canweutilizestigmergybehaviourandswarmintelligenttogeneratecomplexsolutionwhichwillbet-teraddressthecontextoftheenvironmentandformulateanemergent design in architecture? The following projects ofthis chapterwill explore the theorybydevelopingsketchesofcomputationalsimulationutilizing thecoding languageofprocessing.

Page 69: final

68

3.3PRECEDENTS

LEARNINGFROMANTS3.3-4-LYCSARCHITECTURERAILWAYPAVILION200SHANGHAIEXPO3.5-7

LearningfromantsisaresearchinitiatedbyLYCStostudythespacecreatedbythetunnellingants.Byobservation,theystudythebehaviouroftheants,howthecolonyofantsinteractswitheachother.Theythenrunacomputationalsimulationadoptingtheants'behaviourtotheparticlesin the simulation. Based on the pattern created by the simulation, they designed theRailwayPavilionbyusingthepatternasthecirculationofspace.Theconceptbehindthedesignistouse'theants'asametaphoricmeantocreatedynamicspacewhichistheresultoftheinteractionsamongsteachoccupant.

3.3-7http://http://lycs-arc.com

3.33.4

3.5

3.6

3.7

Page 70: final

69

WEBMORPHGENESIS-CHENGHANYANG

Theprojectfocusesonaresearchofnon-hierarchicaldesignsystemandwhataestheticssuchasystemgives.Itemployedanon-linearsysteminwhichagentsinteractwitheachothertoformanemergentpattern.Thepattern(structure)ofthedesignistheresultantofthelocalrelationshipsbetweenagents:attracting,detractingandrepulsingeffectamongstagents.Thedesignisagentsdrivenrath-erthanatop-downapproach.Thisallowthegenerationofcomplexandemergentpattern.

3.8-0http://www.yangchenghan.com/

3.8

3.9

3.0

Page 71: final

70

LET'SWORKTOGETHER-A STIGMERGY APPROACH TO ACCOUSTICDESIGN,JASONLIM

Multi-agent based design has been exploredto achieve emergent and aesthetically pleasingarchitectural design. The complex system ofagentbasedsimulationcanalsoachievebetterunderstandingoftheperformanceofarchitecturethrough themeanof simulation. This ultimatelyleadtoatrue'performancedriven'design.Inthisresearch,Limexplored theapplicationofagentbasedmodeling/simulation technique to thedo-mainofacousticdesign.Thesimulationisdrivenbytheconceptofstigmergy,ofwhichstochasticagents(sound rays) are generated from soundsource and the acoustic performance of thespaceisevaluatedbymappingtheinteractionofrayswith the seats and the structure.With theinformationfedintothesystem,thegeometryoftheceilingisthenalteredaccordingtotheinfor-mationaspartofthesimulationprocess.Throughmultipleiterations,astateofequilibriumemergedwiththeceilinggeometrywhichhastheoptimumacousticperformance.

3.ViipuriLibrary,AlvarAalto3.2SimulationbaseontheViipuriLibrary3.3Thealternationoftheceilingastheresultofthesimulation

3.http://www.public.iastate.edu/

3.2-3Let'sWorkTogether-ASTIGMERGYAPPROACHTOACCOUSTICESIGN,JasonLIM,ETHZurich

3.

3.2

3.3

Page 72: final

7

3.4PROJECT

THEPROJECT-Thegoaloftheprojectistocreateacom-plex system comprising of multiple agents interacting witheach other to form an emergent outcome. Right now theagentswillattracttoeachotheriftheyswarmintothe'bluezone' and repel against each other if they reach the 'redzone'.Avariableisintroducedforthelifespanoftheagents,if theagent iswithinacertaindistancewithanotheragent,its lifespandecreases,andeventuallybecomeszero. If thelifespan iszero, theagentbecomestaticandpossessofagreaterattractionforce.Eventuallyalltheagentswillbecomestaticandlineswillbedrawnbetweenagentsto'document'theemergentresultofthesystem.

3.4theinitialstageofthesketch,3.5thefinaloutcomeofthesketch,3.6Teston3D

ATTRACT

REPEL

REPEL

ATTRACT

Page 73: final

72

3.4

3.5

3.6

Page 74: final

73

3.7

3.8For3.7-8Theloopingofthebackroundisturnedofftocreatethepathofthemovementoftheparticlesfromitsinitialstagetothefinalstage.

Page 75: final

74

3.9

3.20

3.2

3.9-2Usingtheiterationfunctiontoallowparticletoberemovedonceitslifespanisexceed,thenspawningnewparticlesatrandomlocation.

Page 76: final

75

3.5PROJECT2

The code here is a tweak ofGwyllimJahn'scodeofthebaseimage.Thecodehere simulatethestigmergybehaviourthroughanarrayofparticles.Theparti-cles leave a trails pheromonewith its intensity determined bythebrightnessofthepixelofthebase image on the very spot.The pheromone stimulate passbyparticlestofollowthetrail.Ini-tially the image fade function isturnedontoallowthedecreaseof pheromone intensity overtime. This allow the system toform an equilibrium where thepattern of the path becomesstable.Iturnofftheimagefadefunctiontostudytherelationshipbetweentheparticlesthephero-monetrailinstead.

//Base Image sketch by Gwyllim

//check the environment around the objectvoid checkWorld(){PVector toBest = new PVector(); //create a temp vector to keep track of the direction of the best condition float maxV = 0; //loop through pixelsfor (int i = -searchRad; i<=searchRad;i++){for (int j = -searchRad; j<=searchRad;j++){if(!(i==0 && j==0)){ //checks for edges int x = floor(location.x)+i; x = constrain(x,0,width-1); int y = floor(location.y)+j; y = constrain(y,0,height-1); //check to see if this is the smallest current value //scale by the distance to the value float v = world.getAt(x,y); PVector toV = new PVector(i,j); //limit the angle of vision if(PVector.angleBetween(toV,velocity)<PI/2){ //check to see if the current value is larger than the current best if((v)>maxV){ //reset all our variables that keep track of the best option float d = toV.mag(); toV.mult(1/d); toBest = toV; maxV = v;}}}}}

//only effect if finding something above a tol-erance if(maxV>20){ applyForce(toBest);}} void modWorld(){//checks for edges if(lastPos.x<width-1 && lastPos.y<height-1 && lastPos.x>0 && lastPos.y >0) world.modAt(-floor(lastPos.x),floor(lastPos.y),50);}}

Page 77: final

76

3.22

3.23

00particles

000particles

Page 78: final

77

The code here is the tweak of thebase image sketch. I have addedcohesion and separation force tothe particles so that it will interactwitheachother.Theforcesareonlyactivated if two particles are with-in certain radius. For the cohesionforce, it's 70 pixels, while the sep-aration force is 0pixel. Thereforetheparticlesismorelikelytoattracttoeachother,butrepelagainsteachonceitreachesthethresholdoftheseparationforce.ThethirdfunctionIaddhereisthecheckDis()function.Ifthedistancebetweenislessthanthe variable stated in the function,thevariable'lifespan'decreaseandiflifespanisbelowzero,theparticleisthenremoved.Tocreateanequi-libriumwithinthesystem,newparti-clesareaddedifthenumberofpar-ticlesissmallerthanitsinitialsize.

For the following sketches, I havechanged the intensity of the co-hesion force, changed the initialspawninglocationoftheparticlestoa fixed location and increased thenumberofthesearchradius.

//A tweak of Gwyllim’s base image if (pop.size()< numMovers) { pop.add(new Mover (new PVector(ran-dom(width),random(height)), new PVector(ran-dom(-maxSpeed,maxSpeed),random(-maxSpeed,max-Speed)), 1));} Iterator<Mover> it = pop.iterator(); while (it.hasNext()){ Mover m = it.next(); if(m.isDead())it.remove();}

/////////////////////////////////////////

boolean isDead() { if (lifespan <= 0.0) { return true; } else { return false;}}

void seperate(float magnitude){ PVector steer = new PVector(); int count = 0; for (int i = 0; i < pop.size(); i ++) { Mover other = (Mover) pop.get(i); float distance = location.dist(other.location); if (distance > 0 && distance<10){ PVector diff = location.get(); diff.sub(other.location); diff.normalize(); steer.add(diff); count++; } } if (count > 0){ steer.mult(1.0/count); } steer.mult(magnitude); acceleration.add(steer);}

void cohesion(float magnitude) { PVector sum = new PVector(); int count = 0; for (int i = 0; i < pop.size(); i ++) { Mover other = (Mover) pop.get(i); float distance = location.dist(other.location); if (distance > 0 && distance<70){ sum.add(other.location); count++; } } if (count > 0){ sum.mult(1.0/count); } sum.sub(location); sum.mult(magnitude); acceleration.add(sum); }

void checkDis(){ for (int i = 0; i < pop.size(); i ++) { Mover other = (Mover) pop.get(i); float distance = location.dist(other.location); if (distance > 0 && distance<8){ lifespan-=55; } }}

Bornparticle

Removeparticlewhendead

Checkifparticleisdead

Repellparticles

Attractparticles

Page 79: final

78

3.24

3.25

AddingCohesionandSeperationforce

A

B

Page 80: final

79

3.26

3.27

00particles,turnoffimagefade

000particles,turnoffimagefade

B

B

A

A

C

C

Page 81: final

80

3.28

000particleswithstrongercohesionforce

BA

C

Page 82: final

8

3.29

Spawningatsamelocation

Spawningofftheedge

Newcluster

BA

C

Page 83: final

82

3.30

3.3

Spawningatsamelocationwithimagefade

Spawningatsamelocationwithoutseperationandcohensionforce

B

B

A

A

Page 84: final

83

3.32

Increasesearchradius-Formingacontinouspath

Page 85: final

84

3.33TheoutofArfricatheory,thespreadofhuman

3.6PROJECT3

L-system is implementedasa framework for thegrowthofagents,allowingagentsofeachgenerationtotracebacktoitsoriginorseed.Butthefocushereistheabilityof oneagentbeingautonomous, theagentmovesandsettlesas influencedby itsneighboursand theenvironment. This resembles thespreadof civilizations, citiesand cultures. Yet architecture become static, static in a sense that it does not re-sponse tochanges,doesnotadapt.Architectureshouldhavedynamic intelligenceandperformasanorganismconstantlyevolving,expandingorshrinkingaccordingtotheenvironment.Itshouldnotbeasastatutethatremainssteadfastagainsttimebutasa livingorganismthatevolvesovertimeforgreaterbenefitof itsoccupants.Thisprojectexplorestheideaofgrowthinarchitecture.Weasarchitectplantstheseed,andthearchitecturewillgrowinrelationtotheneedanddesireoftheoccupantsandtotheenvironment.Theaimistolimitthesubjectivejudgementofarchitect,allowingthegenerationofacomplexanddynamicsystemthatbestadaptstotheenvironmentwhilesatisfyingtheneedsoftheoccupants.

3.33-http://en.wikipedia.org/wiki/File:Map-of-human-migrations.jpg

Page 86: final

85

3.35

3.34

WalkingCity-Archigram

The walking city consists of intelligentbuildingsintheformofaselfcontainedliving pod. The buildings can roamaround in the city to find its suitableenvironment and adequate recourses,resembling animal migration. The pro-posal took inspiration from insectsandmachine and as a interpretation of LeCorbusier's'machineàhabiter'.Thepro-posalexploredtheconceptofarchitec-tureasa livingorganismwithdynamicintelligencewhichparalleltothephiloso-phyofmyproject.

3.34-http://www.archigram.net/projects_pages/walking_city.html

3.35-http://www.archigram.net/projects_pages/walking_city_4.html

Page 87: final

86

3.37

3.36

L-System

L-system is a parallel rewritingsystem similar to fractals. It canbeused tomodelprocessofplantgrowthaswellasmorphologyofavarietyoforganism.TheLsystembeginswith one particle, the seedororigin,thennewparticlesspawnwith each iteration and connect tothe origin forming branches. Thebranchesmayhaveasetofdiffer-ent properties, in my sketch theyaretheanglesandthelengthofthebranches.

3.33-34 L-system Plant by DianaLange - theartmimics thegrowthofplant

3.36-http://www.diana-lange.de/portfolio/generative/nature_of_code/nature.html

3.37-http://www.diana-lange.de/portfolio/generative/nature_of_code/nature.html

Page 88: final

87

3.39Experimentingwithdifferentangleinthe25thgeneration

3.38From4thgenerationtothe5thgeneration

B

B

A

A

Page 89: final

88

//based on tutorial by Jose Sanchez

Stick(Vec3D _loc, Vec3D _vel, int _generations, String _type){ loc = _loc; vel = _vel; oriLoc = _loc.copy(); generations = _generations; type = _type; updateDir(); updateLoc(); spawn(); } void run(){ display(); } void spawn(){ if(generations > 0){ if(type == “A”){ Vec3D v = loc.copy(); Vec3D iniVel = vel.copy(); Stick newBob = new Stick(v, iniVel, generations-1, “A”); allBobs.add(newBob); Vec3D v2 = loc.copy(); Vec3D iniVel2 = vel.copy(); Stick newBob2 = new Stick(v2, iniVel2, generations-1, “B”); allBobs.add(newBob2); } if(type == “B”){ Vec3D v = loc.copy(); Vec3D iniVel = vel.copy(); Stick newBob = new Stick(v, iniVel, generations-1, “C”); allBobs.add(newBob); } if(type == “C”){ Vec3D v = loc.copy(); Vec3D iniVel = vel.copy(); Stick newBob = new Stick(v, iniVel, generations-1, “A”); allBobs.add(newBob); } } } void updateDir(){ if(type == “A”){ float angle11 = radians(0); float angle12 = radians(ANGLE1); float angle13 = radians(0); vel.rotateX(angle11); vel.rotateY(angle12); vel.rotateZ(angle13); vel.normalize(); vel.scaleSelf(100); } if(type == “B”){ float angle11 = radians(0); float angle12 = radians(0); float angle13 = radians(ANGLE2); vel.rotateX(angle11); vel.rotateY(angle12); vel.rotateZ(angle13); vel.normalize(); vel.scaleSelf(20); } if(type == “C”){ float angle11 = radians(ANGLE3); float angle12 = radians(0); float angle13 = radians(0); vel.rotateX(angle11); vel.rotateY(angle12); vel.rotateZ(angle13); vel.normalize(); vel.scaleSelf(40); } } void updateLoc(){ loc.addSelf(vel); }

Functionthatonlyrunonce

Variablesforvelocityangle

Spawningdifferent'type'ofcelleachwithdistinctiveproperties

Variablesforthelengthofbranches

Page 90: final

89

IextendtheL-systemsketchto incor-porateflockingbehaviour.Insteadofastatic sketch,my aim is to create dy-namic sketch inwhich the location ofnew branches is determined by theflockingbehaviourofparticles.Alifes-panisgiventoeachoftheseedparti-cle,whenitslifespanisbelowzero,theparticlebecomesstaticandnewparti-clesspawnfromthelastlocationoftheseedparticle.

BA

Page 91: final

90

3.40

C

Page 92: final

9

3.4IncreaseAttraction

3.42IncreaseSeperation

Page 93: final

92

3.43IncreaseAlignment

3.44Particlesspawnwithgreateralignmentateachgeneration

R2

Page 94: final

93

3.45ParticlesspawnwithgreaterAttractionateachgeneration

3.46ParticlesspawnwithgreaterAttractionandalignmentateachgeneration

R

Page 95: final

943.47ExportingtheprocessingsketchtoRhino

R2

R

Page 96: final

95

3.483DRendering

R2

R

Page 97: final

96

//based on tutorial by Jose Sanchez: L-system & agent behaviour

void run(){ display(); drawline(); if (lifespan > 0 ){ seperate(10); cohesion(0.001); align(0.1* change); move(); } if(lifespan==0)spawn(); lifespan--;}

void spawn() { if (generations> 0){ if(type == “A”){ Vec3D v = loc.copy(); Parti p = new Parti(v, generations-1, ls, “A”, change * 1.5); particles.add(p); Vec3D v1 = loc.copy(); int ls1 = (int) random(600,700); Parti p1 = new Parti(v1, generations-1, ls1, “B”, change * 1.5); particles.add(p1); } if(type == “B”){ Vec3D v = loc.copy(); int ls2 = (int) random(5,40); Parti p = new Parti(v, generations-1, ls2, “C”, change * 1.5); particles.add(p); } if(type == “C”){ Vec3D v = loc.copy(); int ls3 = (int) random(300,400); Parti p = new Parti(v, generations-1, ls3, “A”, change * 1.5); particles.add(p); } }}

void cohesion(float magnitude) { Vec3D sum = new Vec3D(); int count = 0; for (int i = 0; i < particles.size(); i ++) { Parti other = (Parti) particles.get(i); float distance = loc.distanceTo(other.loc); if (distance > 0 && distance<70){ sum.addSelf(other.loc); count++; } } if (count > 0){ sum.scaleSelf(1.0/count); } Vec3D steer = sum.sub(loc); steer.scaleSelf(magnitude); acc.addSelf(steer); }

void seperate(float magnitude){ Vec3D steer = new Vec3D(); int count = 0; for (int i = 0; i < particles.size(); i ++) { Parti other = (Parti) particles.get(i); float distance = loc.distanceTo(other.loc); if (distance > 0 && distance<40){//checking the distance Vec3D diff = loc.sub(other.loc); //sutracting the vector diff.normalizeTo(1.0/distance); steer.addSelf(diff); count++; } } if (count > 0){ steer.scaleSelf(1.0/count); } steer.scaleSelf(magnitude); acc.addSelf(steer);}

void align(float magnitude){ Vec3D steer = new Vec3D(); int count = 0; for (int i = 0; i < particles.size(); i ++) { Parti other = (Parti) particles.get(i); float distance = loc.distanceTo(other.loc); if (distance > 0 && distance<30){ steer.addSelf(other.speed); //adding the ‘direction’ of the neighbour-ing particle count++; } } if (count > 0){ steer.scaleSelf(1.0/count); } steer.scaleSelf(magnitude); acc.addSelf(steer);}}

Attraction

Seperation

Alignment

Spawningdifferent'type'ofcelleachwithdistinctiveproperties

Page 98: final

97

Page 99: final

98

4.0CONCLUSION

//4.Concept

//4.2Techniques

//4.3Designapproaches

//4.4Futurework

Background:http://www.imdb.com/title/tt0062622/ScenefromStanleyKubrick's200:ASpaceOdyssey

Page 100: final

99

4.CONCEPT

Oneofthemajorthemesof200:SpaceOdysseyisourre-liance on technology and the possible potential of ArtificialIntelligence.Areweatthemercyoftheverytechnologythatwecreate?Areweconstrainedbythelimitationofthetech-nologyinthelightofarchitecturaldesign?.TowhatextentwillAIhelpusinthedesignprocess,orwillitreplaceusasthedecisionmaker?

Thisleadsmebacktothepurposeofthisalbum.Thepurposeof this album is to introduce the culture and techniques ofscriptingintoarchitecture.The3Dsoftwareweusedoeshelpustovisualize3Dform,butweasusersaretosomeextentdictated by the limitation of the software. Imagine scriptingassimpletoolswehaveinthetoolbox,withadequateknowl-edge, sophisticated tools can be created by those simpletools.This liberatesus from the limitationof thesoftwares.AI enables us to generate complex solution for finding theequilibrium frommultipleconditionsand requirements.Thisbottom-upandnon-linearapproachallowsgreatercomplex-ity in design.Thedynamic systemalsoallows the solutiontoevolvetobestadapttothegivenenvironment.Asforthefutureofarchitecture,AIcanbecomethetoolthatlimitstheextentof'subjectivejudgement'ofarchitectinthedesignpro-cess,butarchitectsarestillrequiredtomakethefinaljudge-mentortoprovidetheaim/goalfortheAIinthefirstplace.

Thefocusofthisstudioisnaturalsystem.Tounderstandhowthenatureworksthroughcomputerscienceandhowitcanbeimplementedtoarchitecture.Notthemimicryoftheappear-anceofnaturalformbuttounderstandthecomplexsysteminnaturalsystem.

Page 101: final

00

4.2TECHNIQUES

Probability P.7-24

Force P.25-28

Oscillations P.29-32

ParticleSystemsP.33-34

Page 102: final

0

AutonomousAgentsP.35-40

CellularAutomataP.4-46

Fractals P.47-50

NeuralNetworksP.57-62

GeneticAlgorithmsP.5-56

Page 103: final

02

AutonomousAgentsP.35-40

AutonomousAgentsP.35-40

AutonomousAgentsP.35-40

Fractals P.47-50

4.3DESIGNAPPROACHES

4.4FUTUREWORK

Force P.25-28

Project3-L-System P.84-96

Project2-Stigmergy P.75-83

Project-Flocks P.7-74

Force P.25-28

Force P.25-28

ThescriptingtechniquesIhavegainedinthisstudiooffermealternativedesignap-proachinfutureworks.Thetechniquescanbeutilisedtogaingreaterandbetterun-derstandingsofsiteconditionsandasatooltobalanceconflictingconditionsonsiteandrequirements inagivenbrief.Autonomousagentsandcomplexsystemwillbea valuable tool to study the pattern of group/flock behaviour, allowing a better un-derstandingoftheneedofoccupants.Theaimofthefutureistofurtherresearchoncomplexsystemandbuilduptheconfidenceandlevelofskillstoimplementcomplexsystemintothedesignprocess.

Page 104: final

03

REFERENCES

Burry,Mark(20).Scriptingcultures:architecturaldesignandprogramming(Chichester,U.K.:Wiley)

Flake,GaryWilliam(998).TheComputationalBeautyofNature:ComputerExplorationsofFractals,Chaos,-ComplexSystems,andAdaptation(Cambridge,MA:MITPress)

Hansell,Mike(2005).Animalarchitecture(Oxford;NewYork:OxfordUniversityPress)

Hensel,Michael,AchimMenges,andMichaelWeinstock(2006).EmergentTechnologiesandDesign:TowardsaBiologicalParadigmforArchitecture(London:Wiley-Academy)

Hensel,Michael,AchimMenges,andMichaelWeinstock(200).Techniquesandtechnologiesinmorphogeneticdesign(London:Routledge)

Kodicek,Danny(2005).MathematicsandPhysicsforProgrammers,sted.edn(Hingham,Mass.:CharlesRiverMedia)

Shiffman,Daniel(2008).LearningProcessing:ABeginner'sGuidetoProgrammingImages,Animation,andInter-action(Amsterdam;Boston:MorganKaufmann;Elsevier)(availableonlineviaMUlibrary)

Shiffman,Daniel(20).TheNatureofCode(NewYork:DanielShiffman)

Weinstock,Michael(200).Thearchitectureofemergence:theevolutionofforminnatureandcivilisation(Chich-ester,U.K.:Wiley)

Page 105: final

04

APPENDIX:SKETCHES

APPENDIX2:MOVIES

Movement 62RandomWalk 93RandomWalk2 204LevyFlight 25PerlinNoise 236Force 25-277Force2 288DoublePendulum 3-329ParticleSystem 33-340Agent 36-37Agent2 392Agent3 393CA 45-464Fractals 49-505Fractals2 49-506GA 54-567NN 59-628ProjectA2D 72-749ProjectB3D 7220Project2 77-782Project3A 87-8822Project3B 89-98

ProjectA2D 72-742Project2 77-783Project3B 89-98

Page 106: final