You are on page 1of 56
Simulation for the Social Scientist Second Edition ‘Nigel Gilbert and Klaus G. Troitesch Open University Press Chapter 7 Cellular automata Iimagioe a rectangular rd flight bulbs, suchas those you can se display Jing scrolling messages in shops and aisprs. Each ight bulb canbe ether ‘nor of Suppose thatthe sate of lightbulb depended only on the tat of ‘the othe light bulbs immediately around it, acording te some simple res. Soch an ary of bulbs would te a cellular automaton (CA). Thichaper will, show that simulations with complex behaviour ean be Bll using cellar ‘utomata and that soch simulations can model social dynamics where the focus ian the emergence of properties fom loca interactions. ‘We arty defising what CA is and then conser some standard exam ‘les, mainly developed within the piysical sciences. These canbe adapted to ‘model phenomena suchas te spread of gosip and he formation of eis “Tit ead uso more detailed consideration of ome sell eience models, ‘on ethnic segregation, rations between plital sates and atiude change Finally, we show how clllar automata models canbe programed. ‘ACA has the following features: 1, consists of numberof identical ces often sever tousind or even million) aranged ina regular grid The ells canbe placed in 4 Tong ine (a one-dimensional CA), in a recengular aay or even ‘ecaionlly ina Uhree-dimensonal cube. In social simulations, cells ‘nay represent individuals or collective actors suchas counties, 2, Each ell canbe in one of few states ~ for example, ‘on or ‘of cor'alive’ or ‘dead’, We sall encounter examples in which he sates represent atitaes (such as supporting one of ever! politcal parties), individual characteristics (uch as racial eign) of ations (Such as cooperating oF not cooperating with the) 3. Tint advance hough the smalation in tep. At each ine tp the tae ofeach cell may cage. ° 4. The state ofa cll afer any ime sep is determined by ast of rules ‘which specify how tha sate depends onthe previous sae o tht ell sd the nates ofthe cell's immediate neighbours The sre rules re ‘sed o update the state of every ella the gi, The model therefore homogeneous with respet wo the rus. 5. Because the rules only make reference tothe states of ober cll ina calls neighbourhood, cellular automata are best wed Yo model sitstions where the inesctins ae lca. For example, if gossip ‘reads by word of mouth and individuals ony talk their imeedite ‘eihbours, te ieteiton local and canbe modelled witha CA. Tosummarz, cellular automata mote world in which pace is epe- ‘sented as uniform rid time advances by sep, andthe ws of the world fre represented bya uniform set of rules which compute each cll’ sate ‘fom is own previous sate and those ofits clos neighbours. Cellular stomata have been used a models n many aeat of physics! selene biology and mathematics, well x socal selene. As we shale, they ao good at investigating the oucomes a he macro scale of milins of simple micro-scale evens. One ofthe simplest examples of cellular a tomat, and certainly the best-known, i Conway's Game of Life Berekamp tal. 1982). ‘The Game of Lite In the Game of Lif, a cel can only survive if there are either two othe cater living calls in is immediate neighborhood, hat is, among the eight calls sunounding it See Figure 7.1). Without these comparions, it des, titer from overcrowding if thas foo many living neighbours, o fom Tonelnese i thas too few A dead cel wil bust to se provided that there are cractly tre living neighbours. Thus, fr the Game of Life there se jst vo ues: 1. Aiving cell emains alive if ths two or the living neighbours, ‘beri ides. 2. A dead eel remains dead ness it as three living neighbour and it ‘then becomes alive Figure 71: The bac cells ace the neighbours of the cent ell ‘gue 7.2: Aa example ofthe evoation of patern using hers ofthe (Game of Life ie + Be Be eS Surpeisingly, with us thee evo rls, many ever-changing putes of live and dead cells can be generated Figure 7.2 shows the evolution of a sal puter of els over 12 time steps. To fom an impression of bow the (Game of Life wks in practice leu fellow the rules by hand for the st sep, shown enlarged in Figure 73. "The lack els ar ‘lie andthe white ones re ‘dea (se Figure 73). ‘The cela BS haste ive neighbours, oi onto wo liv in he next timestep. The same is tue of eels bt, B6 and B7. Cell c3 as four Hive neighbours (3, bf, cf and dt), oi dies frm overcrowding, So do of snd. Cells and each have hee neighbours and survive, Cells 2 and y igure 73: The nal arageren of cells 123456789 Emo noose ‘28 i because they nly have oe living neighbour each, but fend o6, with ‘volving neighbours, continue. Cell although dead a present, bas tree live neighbours ate, 2 and g2, and it sat ive. Cell 2 survives with thre living neighbours, and so do e (ve neighbours alive) and g3 tree asghbous alive). Gathering al this together gives ue the second pater in ‘he sequence shown in Figure 72, 11s clear that simulating a CAs a jb for compute, Carying out the process by hand is very tedious and ae is very likly 1 make mistakes (although Schelng, whose work on segregation inthe 1970 is discussed alow, did everything with pencil and paper, while Conway i puted to have worked out his Game of Life using dane plates ona ied Kitchen oor). “The eighth pater in Figure 7.2 isthe same at the fit, bt inverted. I ‘he sequence is continued, the teenth pater wl be seen tobe the ve the st puter, and thereafter the sequence epets every 14 steps. There ‘ca large number of putes with repeating and other interesting properties ‘and much effet has bea spent on identifying these. Fr exarpl, thee are tis that regula ‘shoot off groups of ive calls, which hen mach off eros the id (Berekamp eal. 1982). (Other eellaar automata models “The Game of Lifes only one of fanilyof cela automata models. All are based on the iden of cel Tocted in grid, bt they vary inthe rules {ied to uate te cells’ ales and ia thet definition of which eels are ‘neighbours, The Game of Life wes the eight cells surrounding s cella, the neighbourhood that influences its state, These eight cells the oes to the north, north-east, eat, south-east, south, southwest, west and north- ‘west ae known as its Moore neighbourhood, after an erly CA pioneer igure 14). Figure 7.4. Cell eighbourhoots . + Hs “the vor Newmans mightowhcod The Meee mightouiood The parity moet ‘A model of some significance for modelling physical systems ithe parity ‘model, This model ares just fou ells, those te tbe north, east south and tet, as the neighbourhood (he von Neumann neighbourhood, shown in Figue 74), The party model has ast one rae for udting a cel’ state: he Cell becomes ‘alive’ or ‘dead’ depending on wheter the sum ofthe narber live cls, counting iself andthe cells int von Neumann neighbourhood, {3 odd or even Fite 7-5 shows the effet of runing this model for 124 eps ffom asartngconfguston of singe filled square block of fie by five live els. As the simulation continses, the pater expands. After few nore steps it eure to a simple arangereat of five blocks, the original tne plu four cnpies, oe at each corer ofthe starting block. Aer further step, richly textured pate i erated once agin, until afer many more Step. itrevets fo blocks, his tme contsting of 25 copes ofthe origi "The regulary of thee pater isd othe properties ofthe party ule. For rample thera is linear’ iftwo stating patterns are run in epeate rs {ca numberof ime sept and the resulting paterns are superimposed this willbe the same pater one find if the stating patra run together on the same gid Pagwe 7.5: The pater producot by applying the party rule to 2 square lock olive eal ater 124 time steps ‘As snulsted tine goes on, he party pater enlarges. Eventually il reach the edge ofthe gid We then have to decide what to do wih cells that, te on the edge. Which cell is the west neighbour of z cell atthe left-hand ‘ge of the ei? Rather than devise special ules for thi sittin, the usual ‘hoe i to teat he fright row of cells the west neighbour of the fa [ef row and vice vers, and the tp row of cells a te south neighbours ofthe totom row. Geometrically this is equivalent to weet the gd asa ‘two-dimensional projection of tors (a dught-shapedsufice). The grid tow no longer has ary edges which need to be teated specially, just as a loughnat has no edges One-dimensional mele “The ride we have weds far ave been two-dmensionl, Iti aeo posible to lave grids with one or tree dimensions. In one-dimensional model the cell are arranged along a line (hich has it Tf-hand enjoined in 2 ‘iol to ts righthand end in order to avoid edge effec), Tere are only 32 tileen ues for s one-dimensional CA because there are only tht many coutbinatios of live and dead sates forth cll and its two neighbours, toe tothe left and cnet the ight" Welfam (1986) devised casicaton Sebeme forthe ues of one-dimensional automata Figure 1.6: The pattem produced afer 120 tes by rule 22 stating fom a singe ive cll st the top centre For example, Figue 7.6 shows the pattems that emerge fom single seed ell inthe mide ofthe line using are tht Wola clases as {hte 22."This rue states tata ell becomes alive if and only if one of ‘ur sitations apples: the cell andi ef neighbour ae alive, bu the ight ‘olbour is dead; it and sight neighbour ae dead, but the let neighbour Tale te eft neighbour is Ged, but the cll and it right neighbour ae sive or the eel andi et neighbour ae dead but the ight neighbour is tive Figure 1.6 shows the changing pate of lve cells after sucesive tine stp, Starting a tne Oat the op and moving down to step 120 atthe botiom, Father ime steps ye a steady expanding bot regular patter of ‘ianles asthe infloence ofthe ial Lie cell spreads to its le and right Models of teraction “Tese examples have shown at cellar automata can generale prety pat tere, bt for us thei interest les in the exon to whic they canbe used Tra eft all can be resend ars ay suber wih he on Th re hte mane wh wi allo! cobaton of 1 en cee se juts marriage fener eg 10 ad) an ete te ‘Sipe el ny 1 ssn nd tots at wee a ded ol ae 1 moe socal pbeoomena. We sal bepin by examining two very simple ‘model tht ean used to daw some possibly surprising conclusions before ‘Gverbing a more complex simulation which illarater theory of the way in which tional liances might are. THe cosste mopeL ‘Moet commonly, individuals are modeled as cols and the interaction be- ‘ween people is modeled using thecal’ rules. For instance, one ean model ‘the spread of knowledge or innovations or aides inthis way. Consider, for ‘example, the spread ofan tem of salacious gosip ftom a single originator to an intrested aience, Each peron lame ofthe gossip from neighbour ‘who is already heard the news, and may then pss it on to his or her neighbour (but they doo happen to se thee neighbour that day, they ‘will ot havea chance wo spread the new), Once someone eat the Bossip ‘once he or she remembers it and dos not needa hear it agin This soenario can be modelled with a CA. Each cel inthe model has ‘wo tes: igoorane about the tem of gossip (the equivalent of wha inthe ‘reviow discussion we have called a dea cel) or knowing the gossip (he ‘uaa of being lie), We wil colour white a cell that doesnot know the gossip and black oe that does A cell ean only change tae fom white to ‘lack when oe ofits four von Neumann neighbours knows te gossip (and sis coloured black) and passe ion. Tere is constant cance that within ‘sty time nit whit eal wll pick up he gos fom a neighbouring black call and tum back Once a cell as beard the gas, its never forgot, so fn the model, a black el never reverts to Being white Thus the rues that dive th cel sate changes ae a allows: 1. ifthe cells white, and it sone or mre black neighbours, consider ‘ach black teghboar in tum. For each black veighbou, change to blac with some ape robabiity, oherse remain white 2. Ifthe cellisbac, te ell emains lack. ‘The mules we have mentioned previously have all been deteminisic ‘That, given th sme station, the outcomes of he rule wil alvays be the sme, However, he gotip mode is thar thre is nly a chance tat a call wil ea he gossip fom a neighbour We can simulate this stochastic flement with a random number generator (se Appendix C). Suppose tbe fenerator produces a random steam of integer numbers between 0 and 59. ASO per cet probability of posing on gostip can be simulated by ‘nplementing the frst rule as follows 1. Af the call is white, then for each neighbour that is blk, obtain a ‘umber fromthe random number generator. If this number isles than 50, change tate hom white to Black, ‘gure 7.7: The spread of gossip: 2) witha 50 percent probability of passing ‘nthe news (witha pe ent probity () witha I percent probability Sse Figure 77() shows the simulation satng from a single soare, using 150 per cet probability of passing on gos. The gosip spreads roughly ‘qualy in all directions, Beease there is eny a probability of passing on ‘he news the aes of Black cls not a perfect ice but deviaons fom 8 ‘ruler shape tend tobe smoothed out overtime. ‘With thts mode, we ean easily iverigae the ect of different prob- stiles of communicating the gossip by making an appropriate change 0 the rls. Figure 7.7() shows th result of using a5 per cet probabitity (Ge fst ral is rowrten ao that a cell oly changes to blak ithe mndom ‘number sles than 5 rather than 50- Surprisingly, the change makes rather Tite diference. The shape ofthe black cells isa fie more ragged and of ‘courve the nows travels more lowly because the chance of transition is Inch lower (Figure 7.70) required about 250 tne steps, compared with 50 steps foe Figure 7.7) However, even with hs rather low probability fof tansmission, gostp stile spends. We ean go lower stil Figure 7.1) ‘Shows the outcome oI per cent probeblity of ansmsion, The shape of ‘he black els emnns similar othe previous two simulations, although he {ate of ansmisson i even slower (the Suze shows the situation after 600, time steps). The model demonrates that the spread of gossip (or of ober ‘ews such as technological innovations or even of infections tranamited by contact) through Hoel, peront-person ineractions isnot seriously impeded by alow probebiity of tansmision on any paula ocason, tlthough low probabilities wil rer in slow fasion, ‘The madel bas assumed thet once individuals have head the news, they ‘ver forget it. Black cells remain bisck for ever. This assumption may be comet fr some tage suatios, sch asthe spread of technological kno ‘ow, Bu i it probably unrealistic for gosip tel. What happens if we ‘bul a chance of forging Into the model? This eta be done by alering the second rule to 2. Ifa cellisblac, it changes to white with fixed small probebiliy. ‘Rgure 7.5: The spread of gossip when individuals have a 10 er cet chance ‘of transmiting the news and a5 per ent chance of forging it Sexing the probsblty of transiting the gosip 110 per cent and the probably of forging the gosip to 5 percent gives the rel shown ia Figure 78, The soall white hols represent the els that ave Togo’ the gossip. However, these white arest donot spread because a cell tat has fongoten the news is sil sureanded by other black cell, which havea igh chance ofreranemitng the news to the newly white cll thus quickly ‘uring it black again. n short, provided that the probably of transmission ftom all he neighbour cells is greater than the chance of forgeting he pate of growing roughly cizeular patch of ells which have hear the ‘ews is stable inthe fice of variations inthe ssuniions we make about ttanamsson and forgetting ‘Tue MAonITY MoDEL Inthe gossip mela cll ued back iit heard the gossip fom any of ts ‘eghbore. The therefore was a model of person-to-person interction. Now let consider 1 model in which 2 cl changes state according tote joint sits ofall fits neighbours. For example, poople might adopt a fashion ‘nl if the majority ofthe fiends ave already adopted Ove api, the ‘imlaton will eousst ofa CA with cells each of which have two sats: ‘wht and black The simplest model has jus a single rue: 1. The new cll sate isthe ste of the majority ofthe cel's Moore neighbours, or the cell's previous sate i the neighbous are equally ‘lived between white ad Black ‘hore ae eight Moore neighbours. Thus the ule sys that cell is white Ifthe ae five or more white ells suroundng it black if there are ive or nore black cll around itor remain in previous wate ere are our ‘white and four black. Figure 79:(8) A random dsibtion of white and ack cells; (6) fer many time spe using the majority ale Starting from a random dstibuson of white and blak cel, the result of runing this rule i a patchwork of small white and black Books (Fg- ‘re 79()) Cells sounded by cells ofthe other colour change ote cloar othe maori, So that olated cls coalesce to frm blosks of ene colow. Celis hat happen to have half white and half black cells ster neighbours stay unchanged and form stable boundaries to these blocks. Once the cells ave eehioved this speckled pater, tee it no longer any opportunity for change "The station is very diferent, however, witha smal aeration tothe rule. Suppose that some people are sometines more susceptible tthe di- ‘aes of fabio than others. Some white cells wil change to Back if they have as few as four black neighbours, wheres others will only change if they have at leaet six Mack aighbouts, Sisal forthe black cell The liketiboo of eng either susepble or resistant 1 the fashions distribted randomly inthe model so that overal,tbere are the same number at each time sp of those who require six neighbours of the ober colour to change and of those who require only four to change. In shor, in this modiiation of the model, we ne Tonger have every cell he same, bu some varying mont ofindviual ference. Figure 710: The majority model, with random individual variation: (6) Aer Steps; after 19 eps nd (caer 482 steps Although the medication fom the cxginal made spear tobe minor, the effect is dramatic. Instead of the blocks of Hack and white remaining fozen’ once they have formed, the small randomly changing individual Aitferences are enough tease the congulations into gradually larger patches fof shared colour. The sequence in Figure 7.10 shows this hspening Figure 7-10(0, afer five tine eps, closely resembles Figure 7.9, bined with he sir majority ule. Bur afer 19 stp the Blocks begin to join up (Figure 7.100) and by step 482, the white and black cls hve formed {nt large clusters (Figure 710(c) Is often the casein ella automata ‘models ht deterministic models behave in fret ways athe macro level compared with variants with some degree of randomness bul n- In this subsection, we have discussed two applications of cellular an- tomata tothe modeling of simple socal phenomen. The “gosip" made twas sed on aru that involved the infection’ of ellby atleast one fits eghbous. The majority rale involved counting the number of neighbour, ‘that were of one colour. In each case we saw te emergence of mcrelevel paters fom the operation a hese simple rales, As we noted in Chapter 1, ‘tis nearly impossible to predict the form af these macro lve patterns jst by considering the rules operating atthe mior-Jeve! individu eel TInboth examples its casy to think ofthe grin rather iter, geograph- teal terms, with people occupying each cell onan aetual surface, However, the anlogy between the model and the target population doesnot have to ‘be, and wsslly will ot be, ax directs hs. The gid canbe mapped on © ‘many diferent kind of social elaionship. For example, te iterations on tihich the gossip model pends could be by telephone, over the nteret or in any ober way in which indvidoalscommunicte with particular othes. An example: Axelrod’: iba model “The cells ofa CA can also be used to epresen ents other than ndvidual [An interesting example is Axelrod’ (1995) investigation of bow new polit jeal actors such ae allancee and empires, ean emerge fom smaller entities ‘sich as ation sates, Axelrod observes hat roughout history, new empires Inve formed in which a cencal aust has subordinated previously inde- ‘pendent tats, exerting control over them and asterting the right tocallective Tetion, Equally oflen, sich efties have split into factions that berome Able to exert their ow authority and re recognized ay sates in thet own Fight The United States formed self into new ctr, recognized ty other nations, when it established a federal govemment over the 13 component ate inthe eightenth century, The Eropean Union sstugelingt achive tomathing similar toy. Mesnwile, the Soviet empire fst annexed many ofthe semi-independent tates of ease Prope an Asia and then split up ‘aun. Similar stories ean be fold about the Reman and Chinese expe. "The exseatl features ofthese changes are tat they are ‘endogenous’, that ithe formation and disolton of empires and alliances ave take lve without any external guiding hand and in most if at al examples, ‘terehas been an clement of coercion involved. ts the proces of formation co aggezate actors that i the focus of Axelrod model. The relationships ‘between sae ie modelled as tribute’ system in which aco ae able 0 demand pryment of welt, withthe teat of war if payment i ot made. ‘The wealth hat the stronger actor obtzns rom te weaker is used to exact farther resources fom ober actors. Allies in which groups of sates band Aopetberto strengthen thet hand are ls possible. "To split the dynamics ofthe mode, the ators are confined toa one- mensional wor, ad ae lid ou alog te rcumfereceof acl (0 that every actrhas neighbours on both ss). Actor ae only able ointer- tt (erand tute fom or frm alinces with) thei immediate neighbours tothe ef and to the ight. The model i afr of one-dimensional CA, bat it rather more complicated rules than previous examples, ‘At everytime tp, a randomly chosen selection of actors is activated Each may demand a tibue from either of ts neighbours. The target of the demand can elie pay the wibute or decide to resist and fight. Ifthe tae lect to ig the battle sine rsnures fom both sides: each loses {quater ofthe other side's scumlted wealth (or proportionately les if tite side doesnot have that act). Thus the weather sie inflicts more damage than the pocer side. This, then, contintes a sae change rule for this CA! the state ofa cell is measured by its wealth, tbe tte rule determining how tat wealth changes a each tp. In addin, heres erle ‘which provides every cel wit the same sll additional amount f wealth tach ime step to replenish he over sock of money. [Ar sdeffet ofthe interactions between tem, actors velo ‘om mitment" to each oer, Commitments between pis of ators ierese a 2 result of tee types of relationship: subservience, when one actor Faye ‘bute to anoter, protection, when one ator receives bul from he eh, tnd fendehip, when the two actors Fight on the same side against a hid Fay. On the other hand, commitment dereaes when fo actors ight oo prot sdes, The commitments between actors have consequences or he hoices thy make abou paying bute or fighting fewo actors fight adia- tent actors loin in ote sde to which they hve reser commitment tnd contute wealth in proportion to their commitment. Tha alliances fa frm in which adjacent actor fave commianets to each othe and poo thee weal, Te target for which an lance may ry to eta tribute ean be citer ofits neighbours (or neighbouring alliances) ~ se Figure 711 Figure 7.12 shows the results of ne run over 1000 sme tps (yea) ‘Te op pst ofthe chat shows the wealth ofeach acto, yearby year Three actor, 2,4 and 10, leatly dominated this history, each having steaiiy ‘Figure 7.11: Atypical senario in Axelrod’ tribute mode awcr Tage meses] [4 increase its wealth during the cous ofthe milleanium.Actor9 began wel, butt fortunes slumped afer sbou 400 year. Diet ntl dxeibuont co wealth to the actor and diferent selections of active actors n exch tine ‘Sep rest in diferent histories, some including dramatic collapses in wealth ‘ofeven the riches patipans sa result of te outbreak of damaging fghis| between them (‘world war) ‘Rue 7.12: Tbe outcome of runing Axslra's mode for 1000 ime steps “The lower part of Figure 7.12 shows the pater of commitments between actors a the end ofthe 1000-year run The relative ize ofthe back block within each etangle indies the strength ofthe commitment beteen the ‘ow and column actor. Each ofthe ee rich ators i tthe cete of & tong alan in which tials ae heavily commited to cach othe and ‘othe cata actor The simulation shows tht a simple model of imerectng sates can demonstrate the emergence of cases that ea act as alances, with ll he cor ina cluster operating ae one. Axelrod defines a cluster ata et of jcet states commited o each oter at a level ofa lest 50 per ent Members ofthese clusters work together, as shown bythe fact that members river gang ap to fight the strongest member and ght between weaker ‘members ofthe cluster are rae. Moreover, the weaker members (lat is the poorer member) only rarely start fights of their own against external stor, When tey do, the suongest stor lends to get dragged, sometimes leading to the eventual collapse ofthe cluster (an analogue ofthe “imperil coveruetch” that bas brought down several real empires) It does seem 36 ‘hough the song protec the weak inthe model. Moreover, the oer ators ‘could be seen as taking info account the toll wealth ofthe whole luster ‘when conempating a fight This suggests thatthe clusters really can be regarded as now actors, inthe sume way a the United Stats is a poitcal ctor ins own ight, not just the aggregation ofits consent tates, “Axcirod observes tha the vale of is simulation doesnot depend oa the egres of comespondence between hissed actors andrea tio tates, Indeed, as another characteristic of his model stat each time its ran it prodocesa diferent sequence of evs, with diferent clusters being formed, would be dificult to see how one oould crete 4 model that behaved in jam the way tat the actual history of poiel development occured. Rather, te vale ofthe model sin eariying and speciying new questions ‘hat politcal scientists might want to explore. He notes (Axerod 1995: 37) that he omsrucon of the model mised such questions as "What are the ‘minimal conditions fora new actor emerge?" What tends to promote such tsmergence”, How i the dynamics affected by the numberof elamentary fctors?” and “What can lad to the collapse ofan aggregate actor” which tnd not previously been considered and whic, if explored with the model, might lend wo new ways of thinking about comparable questions in the real veri ‘Extensions tothe base model ‘The talc callular automata desorbed in he previous sections ean be ex- tended in 8 number of useful ways. So fr, the models have actors fed ‘in parca locations, oe ator pee cll An extension that valuable for ols that avelve migration i to allow the actors to move over the grid “Thismeane tht we now have to dstnguish the actors from the cells in which they happen to be pce and we aso have to consider whether more than ‘one actor ean oocapy cll at sny paicular moment. A second extension ‘lows actors to be influencd by more then their immediate neighbours, Ste changes in such model might depend onthe aggregate effect of the sites ofall ther actor inthe model of some proportion of then. Migration models 1m migntion model, etre are not confined to patil cel but ean ‘move aouod, Rules, similar to te change rues, detemine when and to ‘where they move. An atrestingappieation of migration model is fowndin ‘Scheling’ (1971) stady of ethnic segregation inthe United Sts. Schein ‘supposed that people had “hreshold of tolerance’ of eter etn eoups, toch that they were content with where they lived provided that at least a ‘ropation of ther neighbours were ofthe same tha group a themselves If for instance, the threshold of tolerance was 40 per cent, people Were cone fo slay provided tnt at lest four inten oftheir neighbours were fiom the same einic grap. If this were ots, they woud try to move to Soother neighbourhood in which atleast 40 percent wereof heir own UP. "The conmetionl assumption is that etic segregation inthe USA is at east ply det the fat tat whites are prejudiced ad havea tolerance threshold of over 50 per cent. They therefore moved out of wrbn neigh tourhoods tbat had majority of blacks, leving the neighbourhood with Sl higher proportion of black people and thas accelerating te tendency towards complete segregation. This phenomenon has come to be known 5, “erbon fight Schelling’ point was tht tolerance thresholds much lower than 0 per een could ead othe sme result Even a theshold as low as 30 er cent coud rel in aloe complete segregation. Thus altbough people ‘i be quite content with being i the minority in a meighbouthood, so Tong 2 they demanded tht some tall proportion of thee neighbours were ‘ofthe same ethnic group at themselves, segregation cvuld emerge. ‘We cn build CA migration model to demonstrate this result. A cll on the grid can bein any of tee sae: occupied by a "white? ctr, oceupied tava blak’ actor, o empty. The process diving the simaton isto select 2 cellos te grid atrandom. Thenifthe cells occupied by an actor, the actors ‘amined to ee whether iti “conten thats, whether the number of Moore ‘neighbours ofthe ste colour is at leat equal to its tolerance threshold. IE — ‘he actor isnot “ont, nearby cells found thats both uncecpied acd ‘bs neighbours such dat the actor would be content there. This x dove by ooking around the actor's cell wnt thera uable ele foend ot every cell on th pid has ben red. I sitable cel is located, the actor moves ‘ther, vaating its previous cell The simulton then chooses another cll at ‘dean to process and continues this way andl every cori content. Figure 7.13: The eect ofa 38 pr cent resold clerance with Sclling’s ‘model: random saringconfigration onthe Ie ad foal configuration on tenigh igwe 7.13 shows what happens fora teshold tolerance of 38 per cant (atleast tree of a cell's eight eighbours must be the same color). On the lef the starng configuration, with black ad white sco tuted ‘over the grey grid t random. On the ight tthe final conguratio, in ‘which al the acors are ‘content with thes potions and their neighbours Comparing he starting and fil configurations, pecan sea marke depree of elusterng in th ater. With higher values ofthe tolerance threshold, te ‘users are even clearer, While this kind of mode relates most obvcusly to ete segregation, it an also be applied to relationships between any umber ofeoopizably date clases: not jut backs and whites, but rch ‘nd poor and not only to spatial segregation, but alo difretation ino groups and cliques. "Te example hat shown the ws of & migration model in which each cell ean conta only one actor, as befits a simulation of people living eighourhoods. Iti also possible to have mor than one ator incall, but ‘hen the usual spatial metaphor of cellular automata models is lost. In the segregation model, a migrating actor searches fora suitable vacant call at random, evenly if necessary searching the whole grid ln ater cases a more restrictive rule might be preferable. Fr example, Hegseimann (1996) éexrtes a made used to sty the evoition of support networks in which ‘migration ls constrained toa “gration window” consisting ofthe 11 x 11 Squaeof els rounding the migrating actor. ‘Extended neighbourhoods Wetarconsited model invic cn hangs of sates depended Weivsoar cna ace win te sa risotto Sane cla ove tl flow and pe sn Nea Spinner tet tenn (Be Mowe nebo “emg is ten om try uh aly win wih Tolpategacerny move wel a ean wn wc elem ‘eras oft ea rt hand icine 990 sume masta bet dene ete "eeScon! souk me mnt note aro it imme ‘ei else css te mtron neigiboutod ean ld al ‘Seater nds est rey er aes ry Sherer Te outs ope fin bce sc ode oe Sonus imere ween ht ie oil ae ny ‘Corto tone cues edo wc yoo ont an ‘Samm ewes ncn nd entra tos ‘aS of ch meant fund to wot by Ltn ad tis Mags nthe 17D sa ey P00 Land pope a ey {Ene ed cil past (tod 198 Tr ony cme Simplsng te epee of uss ppl coe Sates ora Teton ae at "emptor rope ona gen nv mui the bcm fe eng of mabe fe gop ow tux etn) te imedacy deg ‘Sen of sual ans om ein) ae te mer (an 996 5) ‘is ory ns en etsy teed in aber of soos ad {Eien spr: Howe isd smal ee Sou genni na poop, be sed er ncn pou. tt ia inten te oe eters Ts ‘Spc iuccays mae empaths cen sed ‘nowt eed TES Cad 590, ee snp lane aber fetes shad ovr coe tr pr cl. Al sacs of pons, eed dony ‘Then oft ins lowag ow cals eon toes ‘Sesopos "ol ent tn ee iy case opas he span rin rapid gy td a) eae ae “artocae tne wraps navdad we aaa opr Sele of he deepen ope. To eh ase ty Sigs eg vil wach ops Lana aes ‘pau of tc ot sl pe of ae pe ta ‘Saul au pepo lssrh of ote Ohta ines propria Gr parce dacs fee nl (an rel Tei fom ae spe on asa cena eae ‘sx a omofate tipo npc ayo em %/5)\° on {E(@) Tepito i pon last wi he maton petal ls Spgs Payee eee tab [ise gyre te ol apt fons ppt bp a ‘alin fon pone, Tunas ag cops ‘thw nor lara de hanretage arse en ‘rc sts el i gets ext ar cs Siti ne espa Ercan shea ‘Starrs canon a ipertocnac oe ens soe Picea Their omens fi india wh ar se mise i sl secon ey ile pen ees resees ‘Santon in is wa ai oppo ees ‘poarDosierfemsesandhominfipae’ it Ovoeles ote, ‘om uring san top ba bal eos we vies aot SLA saan bn saline a of ot 2S pn as dase! sgt day hae ose ne ‘ates (atone ta ep tena it he phousafeene onto dg of eda beng eon est cap) hess ‘Seen cosrioe nae sts tog neers trary foros amon’ sre et ecto Sciatic Ths tte av fonda when epee ssn ese ian ea Fe ae eas i pep af tlc cn tac ee ene ‘Figure 7.14: Typical osteomse (ight) of he TSIM model, ftom a stating ‘configuration (left of SO per cent white actors. The white actors have formed three casters bythe end ofthe ran . ‘ {a inttly very small tis also consistent for diferent random starting ‘configurations ad variations in he rei psct formula (or example, the ‘Sitance la doesnot need fo bean inverse square a; it could be a cubic fw although t does need to beat leat equal 0 the dimensionality ofthe ee mode een tach sr a sce in by cst cho wh independant scl impel coer teween te case eth enue, Fr example tie sto whcter we ste ee Le ore ih sod se B connec nee wine tee Leese ton nan pole Peis moat ior is ion indie vr Howe, peugeot wenden st ein! ee Ses {hfe wil be onal. That an acter whos ina oii ler 0 (Cepreedsrusor 2 2 trooor ;; patch procedure Laeigior) (ae neighbor randon-voe-of seigabore4 2 st erap? or not erappad-nwighbor? teigier (eet suet-neareT-of aeigaber true ] ghtore and seighbores prinitives aluays wrap, to if MAP? in falon we awed vo reject “eeightors” that Hi are omly aeightore bacaune of wrapping acrepore wrapped-aeighber? [aeighber] 11 patch procedure ‘epare (abe (Gucar = pacor-of seighbor) >'1) ex (Gee Gycor ~ pycor-af anignbor) > 3) te beeraor spat procure (eee firetsbeard tine set juet-beara? trae } ‘The sprond-runor procedure sars by declaring a local variable, ‘neighbor. This variable only exis wh she procedure is being exected. Next variable tat is set bya switch onthe user interface (he one lx belle ‘eight mode’) it used to decide whether ost the vale ofthe los! vrlable, eghbor, wo «randomly chosen one of the sight neighbouring calls (ie Boor neighbourhood) ofthe four calls in the von Newnan eighbourhood. Finally the procedure tells the selected neighbout that it tas head the rumour by setng the neighbour's just-heard? variable to teue, There is complication with his the Ne ogo gr iss tras, with ‘heeft column of el ajoinng the right colamn. However, switch on the Imrie allows the use to tur tis of, 50 atte edge cells have no neigh tours. The condo, i¢ wrap? or not wrappad-aeighbor? neighbor ‘nd the following procedure, oreport wrapped-nesghor? handle his, (A tonrepore procedure is ose that retums value. Ordinary procedires, Which sta with to, do at rerum anything) "This eliolarazomaton works in two pases: fst, the rumours spread tnd the jast-beard variable of all the receiving cell i set to te by spresd-ronor then, inthe second phat, al ells tht have a tue sust-hoard variable are registred as having heard the rumour by inee- ‘meatng tines hourd), The reason fo wsng this two phase approach iim porantin understanding how hs program and many oer celular automata ‘work. Each cll eecutes its procedures alonomouly and als own speed, the program had been writen o update the receiving coll immediatly ‘hey beard the rumour, they could then ia tum spread the rumou 10 ater cells, bat the later may aeadybave executed all hei code and be unable to rectve the rumour The results would be unpredictable. With the to phase proach all the ramour spreading is done before all the rumour hearing, ‘update isthe procedure that handles the second phase, reseting the just-heard variable and calling the hear-runor procedure to record tht, ae ell as received the rumour from a neighbour ‘The remaining procedures deal with colouring the cells on the grid cording to wheter they have heard the rumour and with controling the Ploting of te graphs, and we sbll ot comment in ail on tem. Instead, we shall work through two oer examples, showing how one might create ow simulations, The Site fr the maority model (oe page 139) and the ‘ond more complicated example replicates the SITSIM model introduced om page 148, The majority model “The majority model a cellatr automaton ia which ech a's stat copies the state ofthe majority offs eight Moore neighbours. The program ill start by randorly sting the cells to either on’, represented by a lack cl, ‘oof, eprosented by white cll: We can do this with he fellowing setup ‘randon 2 generates iter 8 zero ot a one, S0 the ifelse coniton hasan cual chance of exerting either he off or the on procedure on and off ae procedure that will change the sate of a cel, which we have yet owt. ‘The variable eepa will record how many steps the simulation has run Tt need o be defined as global variable, accessible ooter procedures and to the wer interface (shorty, we shall ereate a monitor’ for this variable on the ser interface to sow how many steps te imulson has ra) owas 1 Next, we can start coding the go procedure thats acivated when the user click onthe “go” button, hit needs to ask each patch to count how many of ts Moore aeighbours are ‘on’. As with he previous mode! we shall ue a two-phase approach, geting all he cells to record the state of {heir neighbourhoods fist and thn inthe second phate geting the patces ‘update thei owm sate. The ist phate is easily accomplished we asume that exch pach wil ave a variable on? tha reords sat, eter “on? or ‘or patahes renvnesghbors count neighbors with (oa? For the second phase, each patch needs to se whither there ae a majority of" cells surcunding i (more thn four of the eight) and if 0, ‘um elf ‘on. here i no majority of ‘on’ eel, there may be « majority of of call (the number of on’ elles lear han fou) Inthe situton, te ell must um itself of I here are exaely fou ‘on’ and foe ‘of cells, In the neighbourhood, the cls sate wil emain unchanged, This canbe achieved wite sex patchen ( [felae on-neigabors > 4 Cond 1 Gatien 6 Cott oting these together wit «command t increment the sep couse, we the following go procedure: fet envnelghtors coast sghtora wich (ont 3 fax patches Con) Lif on-etghors ¢ 4 [ off 11 1 “The only coding that remain isto define the procedures to change the tal of coll, on and otf. These et the on? variable bd change the colour ‘ofthe patch on the grid (peolor isa built-in varible that hol the cent colour ofthe patch aor patches [ ot on-naighbore count neighbors vith (os? a fue paretes te) [ef sn-nesgmore <4 ( ott 17 dors > & 1 fe etapa otape fet peoler black oa fave peotor white ‘Th inal te to design aueerinterface with stp" button, ao" ‘ton anda monitor forthe numberof steps (see Figues 7.17 and). ‘Figure 7.17: The msjoty mode afer the ‘sp btn has been pressed ‘There are improvements tht could be made otis code First transfor ‘ve, runt he user licks the ‘go buton a second time to top it It would ‘be useful to ad atest i se wheter any cll bd changed colour. Second, we could ad code to implement the majority mode! with random individual Pigwre 7.18: The majority model tthe end of «ras C Sfalee on-esginorn <4 Come Cf andeviaunapsee ¢ ‘sfelne (rundoz 2) = 0 Teel Lote ) sd adding a switch to set the variable tndividuanDitt on the wer inter face. Inthe inital version, when there are oar ‘on’ neighbours, no actin was taken (neither the on-neighbore > 4nor the on-nefhbors < 4 cond ‘ons were said) Inthe new cod, when there ae fou “on” neighbours, ‘the sndividualDise variable i tested and if tie te, the patch esto “on or of A second example: the SITSIM mode! ‘To begin replicating the SITSIM mode, we need to write its wetup proce- dare Fs itis a ood ides to cleat avay ary rman ofa previous ra, ‘with caor clear-all. Then we shuld iialion all he patches, using te ask-patchos command. ach patch should decide whether it should sta as white o blak. The corel proportion of white to black patches wl be st bythe user with der, which ets the val ofa variable tht we sal ell aial~vbice, The esies way of geting about the right munber of white and black patches {sto usethe random number generator to creserandam numbers in he range fom ze upto 100 and then make the patch wit ifthe random number isles than Saitial-vacee. We alto need to assign the ptch’s ‘Strength ‘of pinion, again using a random number gneratr. Assembling all this, we ret fn patcben ¢ isles (eandon 109 < inieial-vaiee) st peolor Wie] ot pester Black) fet strength andor fon ‘The usr wil ned to se the changing numberof white and bck cell. ‘A smal procedure would be helpful fortis its always a good plan © ‘separate Sal units of code that do one jb into their owe procedures): fie whiter coast patchan with (poslar = white] ‘be Dlackn comme patches wth (pester = Diack] ‘This procedure st the variables whites and blacks to the number of patches that are white and Bac respectively (peotor isa builtin variable ‘bt olds the current colour othe patch) IPwe had needed to fd the value cfjust one variable using this procedure it would ve been best o wrt it report, etuing the vale tothe calle, but inthis case we ned to fet fo vlues: the mumbers of whites sod blacks. The most convenient vray of doing thie isto define wht and blacks as global variables, 30 hat they ean be sccesed fom elsewhere in the program. ence, weneed 1 2 sable declaration the tp ofthe code: tenets shiees 5 amber of vista calla taas number of BISEE calle i (One place where these global variables wil be usefl is in constructing “monitors the user iterface tba wl display te eurenteouns. "We also ned ono tha each patch wil ave its ov variable fo eco it suena of opinion: pacceeoen [ strengeh 5 1 tachanging randss value 1 countdolors can now be appended to the sep code, which in its cosy i to setap see potcaan € Tfetse Crandon 309 < snssia-vasce) eat pealor white) (fat pester black) svt ateangen Tandon 100 i “The next step ist define the go procedure. This wil be called when the ser la he ‘glo and nets oe tp fhe sin, Asking cach patch tose whether the impact oa tof oes opinions is soc ts to mae I change ts own opinion. So we need another ask pate! command tak patches { belatiuenced } ‘nce th putes te ee intend esl ee tea hss the we ung cosstGoore agin ant Woe aed The ergo Baton wl apelin go proce agin and agin indy, Toes tht vel th prope pte thle ‘longer changing weshladaest West a varie nage se ‘etre sling he ce torn eS annced pros and wrnge at iany pach cages colar isc chaagea tun Then ara th piseshve nied, we wil ex he change varia opi Sil fis. Tego pce becomes wee ee changed? fal = nk patches Cbeinelvenced 1 courtcolors op $f no cell bas changed ita colour 38 Got changed?) tater? ‘We must also remember to declare that changed? isa global variable since it willbe accesed by the patches” cade when they ate changing colo, ionare ( iasgee? 1s ben any onl changed tte colo? [Next we need to write the beTafiuenced procedure. The SITSIM ‘model ian example ofa cellular automata a which al othe cell influence the sate ofeach cell A pach’ colour changes if the tou impect fem “opposing cells is rete than he pt from ‘suporting cell So 4 Sat sketch of bent uanced would be: 19 belnfloenced ‘et inpactFroninste age? sim valves-fron pacctes uth Epeotor = waive) Lnpact ayeest? svt SopactPreamiack oqrt aun veluer-fron patches with (peeior = black] CSspact eyesif] 3 tina that frou ehites, change tbe cell 1f peolor + white and Sopactrroublacr > dnpactPrenihite at changed? oe) Af poston = Black and Sepactfrosiate > iapactProsElack {eet poslor waste set changed? rue) “The irsttwo lines sum the impacts ofthe patches hat are whit and Back respectively. impact i reporter procedure hat we have yt to writ; his ‘willwork out the impact of patch on te patch being influenced ayael®"). ‘The it line coud be transite ast the variable smpaceFrea¥hite to the quar oot ofthe sam of the impact of «patch on myself forall etches, ‘whose colour is white. Once we have thse total impacts, we ean see wheter this pte’ colour i to change. Ths isthe purpose ofthe ast si ines. Notice tht ifthe colour does change, we alo atthe changed? variable © tr, o ensue tht the simulation wil un for teat one more yee. To complete this provedur, we need 19 declte thatthe variables, snpactFroaiaite and inpactFronBlack, are local variables. They soald be local beoase they are specif to this ptch and ued oly in ths proce- dure. Todo this, the line rocale (iapacthroninite inpactfroaBiackl ust beaded athe beginning ofthe procedure. ‘We have yet to workout what the fact of one patch on anther is. The forma (Gage 148) sys thatthe impact sequal to the square of the ober patch’ strength divided by the aguare ofthe distance between thi and the ther patch, We can write hia simple reporter rocedre: sport sopact [otherGsi3} report aha sapact of otherCsid om ayselt Inport square (otrangeh / (oquare distance otherGeli))

You might also like