in Artificial Life VIII, Standish, Abbass, Bedau (eds)(MIT Press) 2002. pp 227–232 1

Evolution of Stable Ecosystems in Populations of Digital

Tim F. Cooper and Charles Ofria

Center for Microbial Ecology Michigan State University, East Lansing, MI 48824

Abstract continued use will diminish and organisms able to use un- derutilized resources will be favored. Over time density- Competition for resources has long been believed to be dependent selection created by this process can lead to fundamental to the of diversity. However, the difficulty of working with natural ecosystems has meant and even as organisms di- that this theory has rarely been tested. Here, we use the verge to into distinct lineages (Schluter 2001). experimental platform to demonstrate the evolu- In this study, we use digital organisms (self-replicating tion of ecosystems composed of digital organisms. We and evolving computer programs) to examine the di- show that stable ecosystems are formed during evolu- versity arising in populations during to an tion in an environment where organisms must compete for limiting resources. Stable coexistence was not ob- environment containing nine distinct resources. (We served in environments where resource levels were not use the term population to refer collectively to all or- limiting, suggesting that competition for resources was ganisms in the environment.) We compare the result responsible for coexistence. To test this, we restarted of adaptation when resources are in infinite supply to populations evolved in the resource-limited environment when resources can be depleted. Because there are but increased resource levels to be non-limiting. In this environment, ecosystems previously supporting multiple no limiting resources in the former environment, only genotypes could maintain only a single genotype. These one niche is present; the most efficiently us- results demonstrate the utility of the Avida platform for ing the most valuable resource combination will always addressing ecological questions and demonstrate its po- have a selective advantage and be able to outcompete tential in addressing questions involving ecosystem-level all other organisms (Kassen, et. al. 2000; Hardin 1960; processes. Tilman 1982). In contrast, in the depletable resource environment, all resources can be limiting, potentially Introduction creating as many niches as resources and thus allow- One of the most striking features of life is its diver- ing as many species as resources to coexist (Bell 1997; sity. However, the selective pressures which have led to Huisman 1999). this diversity have not yet been comprehensively identi- We show that stable ecosystems evolved in popula- fied (Morin 2000; Schluter 2000; Tilman 2000). In part, tions grown in environments where organisms competed the lack of progress has been due to the inherent dif- for depletable resources. Diversity was maintained for ficulty of performing precise, replicated and controlled many thousands of generations when the rate experiments on whole ecosystems (Morin 2000). In an was set to zero but rapidly disappeared when we changed effort to ameliorate these limitations, some researchers the environment to make resource levels infinite. have turned to laboratory microcosms (reviewed in Trav- isano & Rainey 2000). However, even in these model sys- The Experimental System tems, ecosystems can evolve to be much more complex The Avida platform is a computer software system in than is experimentally tractable and identification of the which digital organisms evolve by means of random mu- causes of diversity can still be difficult (Notley-McRobb tation and (as opposed to artificial & Ferenci 1999; 1999; Rainey & Travisano 1998). selection, as in genetic ) (Ofria, Brown, & Competition between organisms for limited resources Adami 1998)1. The genetic code of the digital organ- has long been suspected to play a key role in the struc- isms in Avida is a Turing complete programming lan- turing of communities (Tilman 2000; Schluter 1996; guage. To replicate, a digital organism performs a self- Tilman 1982). Though proof of this idea has been de- analysis that determines information about its genome, ceptively difficult to come by (Schluter 1996; 2000), the 1 reason for its enduring appeal is obvious: if organisms The Avida software is available from deplete resources as they use them, the benefit for their http://nemus.dllab.caltech.edu/avida/ 2 in Artificial Life VIII, Standish, Abbass, Bedau (eds) (MIT Press) 2002. pp 227–232 it then allocates enough extra memory to hold its off- The genome of the ancestral organism in each run was spring, and copies its genome line by line into that extra 100 instructions in length. This organism could self- space before finally dividing off the offspring as an in- replicate but could not perform any logical computa- dependent organism. This replication process is subject tions. The descendants of this organism rapidly filled to two types of errors: copy , where a random up each population (to its maximum capacity of 2500). instruction is written in place of the ancestral one and in- During the first 100,000 updates2 of evolution the copy sertion/deletion mutations, where a random instruction mutation rate was set to 0.0075 per instruction and the is added or removed from the genome. insertion/deletion rate was set to 0.05 per genome. After In Avida, the success of an organism depends upon its the first 100,000 updates we turned off all mutations and growth rate. This is determined by an organism’s repli- let the population replicate for an additional 50,000 up- cation efficiency and by its interactions with the environ- dates. This latter phase allowed us to identify genotypes ment. An Avida environment determines the mutation able to stably coexist as a result of ecological interactions rates the organisms are subjected to, as well as the col- without the complications of new genotypes being intro- lection of resources that they can use to increase the rate duced through mutation. Hereafter, we call the 100,000 at which they execute the instructions contained in their updates of evolution with mutation turned on the “evo- genomes. To “metabolize” a resource and garner a ben- lution phase” and the subsequent 50,000 updates with efit from it, an organism must perform a mathematical mutation turned off the “ecology phase”. computation specified by the experimenter. Resources We evolved a total of 69 populations; 30 in a lim- are globally available to all organisms. In previous ver- ited resource chemostat environment, and 39 in an en- sions of Avida, resource levels were infinite, such that the vironment where all resources were infinitely abundant. number of organisms using that resource did not affect In both environments 9 resources were present. These its level or the benefit gained for its use. In this study, could be “metabolized” by performing logical computa- we add the capability of feedback between the use of a tions. The full set of computations rewarded were: Not, resource and its level, such that the use of a resource Nand, And, OrNot, Or, AndNot, Nor, Xor, and Equals. by one organism lowers the availability of that resource To complete one of these computations, the organisms to all others. A low concentration of a resource will re- must input one or two 32-bit numbers, perform the logic duce the benefit that can be gained by performing its operation in a bitwise fashion on them, and output the associated computation. This model of resource compe- correct 32-bit result. The ability to perform one of these tition is analogous to that occurring during competition computations (and therefore use the associated resource) in bacterial chemostats. increases the speed at which an organism executes its in- In Avida the experimenter determines the environ- structions, allowing it to replicate more often. The out- ment that populations will evolve in, but does not spec- put of a computation must be exact–a single bit in error ify which organisms are favored. Instead, the outcome disallows the organism to use the resource in question. of the evolutionary process is determined by popula- To determine the genotypic diversity present in popu- tion genetic processes, that is, natural selection and lations we used the Shannon-Weaver index, calculated as th . For this reason, Avida populations are − P pi ln(pi), where pi is the frequency of the i geno- genuinely evolving systems, rather than being “simula- type in the population. The same formula was used to tions” of evolution. Avida allows perfect knowledge of measure phenotypic diversity except substituting the fre- the genetic, phenotypic and ecological state of the sys- quency of phenotypes (based on the logic tasks each or- tem at all times and ensures that no measurement in- ganism could perform) in a population for the frequency fluences the course of evolution. These attributes have of genotypes. Mann-Whitney rank sum tests were used enabled Avida to be used to address fundamental evolu- to compare measures of diversity between the two treat- tionary questions in ways not possible with traditional ments because diversity values were non-normally dis- systems (Lenski, et. al. 1999; Adami, et. al. 2000; tributed. Wilke, et. al. 2001). Results: Ecosystem Evolution Materials and Methods We measured the effect of competition for resources The experiments reported here were performed using on genotypic and phenotypic diversity present in the version 2.0beta of the Avida software. Unless otherwise evolving populations. If competition for limited re- noted, each replicate evolving population was started sources creates multiple niches, we expect diversity to with identical initial conditions but with a different ran- be higher in resource-limited populations. We found dom number seed. This seed causes runs to differ at 2 An update is a unit of “real time” for the organisms points where a random choice is made, such as the oc- during which 30 × population size instructions are executed currence of mutations or the location of an offspring in globally. The number of instructions executed by a particular the population. organism depends on its use of resources. in Artificial Life VIII, Standish, Abbass, Bedau (eds)(MIT Press) 2002. pp 227–232 3 that both phenotypic and genotypic diversities were sig- populations grown in the infinite resource environment nificantly higher in populations evolved in the environ- (Mann-Whitney tests: genotypic diversity, U = 1635, ment where there was competition for resources (Mann- n1 = 39, n2 = 30, P  0.0001; phenotypic diversity, Whitney test: genotypic diversity, U = 1586, n1 = 39, U = 1635, n1 = 39, n2 = 30, P  0.0001). n2 = 30, P  0.0001; phenotypic diversity, U = 1635, n1 = 39, n2 = 30, P  0.0001). A comparison of the 2.5 average diversity present after 100,000 updates of evo- A B 2 lution in the two environment types is shown in Figure 1.5 1. 1.5 7.6 1 A 3 B 1 7.4

Genotype Diversity 0.5 0.5 Phenotype Diversity 7.2 2.5

7 0 0 2 Limited Infinite Limited Infinite 6.8 Environment Environment Genotype Diversity Phenotype Diversity

6.6 1.5 Figure 2: Diversity present in limited-resource and

Limited Infinite Limited Infinite infinite-resource populations after 50,000 additional up- Environment Environment dates with mutations off (ecology phase). (A) Genotype diversity. (B) Phenotype diversity. Whiskers and box edges represent 95% confidence intervals and quartiles, Figure 1: Diversity present in limited-resource and respectively. The mean is indicared by a line inside the infinite-resource populations after 100,000 updates of box. Outliers are indicated by a ‘+’ . evolution. (A) Genotype diversity. (B) Phenotype diver- sity. Whiskers and box edges represent 95% confidence intervals and quartiles, respectively. The mean is indi- Evolution of Specialists and Generalists cared by a line inside the box. Outliers are indicated by a ‘+’ . To examine the of the ecological mechanisms al- lowing coexistence in the resource limited populations The high mutation rate used in the evolution of these we chose two case-study populations, one consisting of populations causes the continual production of mutant generalist organisms and one of specialist organisms, to genotypes. Although many of these mutants are destined study further. Figure 3 shows which resources were used to become extinct, they nevertheless increase the num- by each genotype remaining after the ecology phase de- ber of coexisting genotypes and thus the basal level of scribed above. In the population consisting of specialist diversity within populations. The effect of high basal di- organisms, the use of each resource was heavily domi- versity is to reduce the fraction of total diversity caused nated by only one genotype (Figure 3a). In the pop- by truly coexisting genotypes. For this reason, all popu- ulation consisting of generalist organisms, eight geno- lations were extended for a further 50,000 updates in an types were present. These genotypes could be grouped environment identical to the one they had experienced into three distinct resource utilization groups based on before, but with the mutation rate set to zero (the ecol- the logic computations they could perform: group 1- ogy phase). In this environment, ecological processes Xor, AndNot and OrNot; group 2- Equ, And and Nand; determine the dynamics of diversity without the com- group 3- Nor, Or and Not (Figure 3b). Two explanations plication of the continual production of new genotypes. could account for the continued coexistence of genotypes Unfit mutant genotypes already present will be removed that shared the same phenotype. (1) Coexistence might by population genetic processes. If the higher diversity reflect organisms that had very similar fitnesses, such in the resource-limited populations was caused by stabi- that very long periods of selection would be required to lizing pressures allowing organisms to coexist, then we separate them. (2) Subtle differences in the number of expected diversity to be maintained in these populations. times an organism with a particular genotype performed In the infinite resource populations we expected only the a computation might cause oscillations in resource con- single fittest organism to be retained, decreasing diver- centrations, allowing coexistence of organisms special- sity to zero. Consistent with these expectations, in fig- ized to different levels of resource. ure 2 we show that whereas genotypic and phenotypic To distinguish between these possibilities, the gener- diversity was maintained in populations where organ- alist population collected after the ecology phase was isms competed for resources, it dropped to near-zero in restarted with five-fold replication in an identical envi- 4 in Artificial Life VIII, Standish, Abbass, Bedau (eds) (MIT Press) 2002. pp 227–232

200 1200 A Equ B Equ A Xor Xor 1000 150 Nor Nor 800 AndNot AndNot 600 Or Or 100 OrNot OrNot 400

And And 50 Genotype Abundance 200 Nand Nand Not Not 0 0 0 10 20 30 40 50 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 Genotype ID Genotype ID

1200 B Figure 3: Map defining the phenotypes of each genotype 1000

present at the end of two runs. (A) Population consist- 800 ing of specialist genotypes; (B) Population consisting of generalist genotypes. The colorbar indicates the number 600 of times a given logical computation is performed during 400 one generation. The more often a computation is done

Genotype Abundance 200 the more the cognate resource is used. 0 0 2 4 6 8 10 Updates [x104] ronment. If coexistence was due to the presence of geno- types of quasi-equivalent fitness, we expected the number Figure 4: Coexistence of genotypes during the contin- of coexisting genotypes to decrease over time. We found ued ecology phase with limited-resources. Genotypes that the number of coexisting genotypes had declined are numbered as in Figure 3. (A) Genotype dynam- to three in all replicate populations by 300,000 updates. ics throughout this phase in a representative generalist These three genotypes were then stably maintained up population. Dark-gray, genotypes 1/2; light-gray, geno- to the end of the experiment at 500,000 updates (Figure types 3/4; black, genotypes 5/6/7/8. Genotypes 1,3 and 4a). In all cases, only one member of each resource uti- 5 coexist at the end of the run. (B) Genotype dynam- lization type was maintained. Genotypes 1 and 5 from ics throughout this phase in a representative specialist groups 1 and 3, respectively, were maintained in all of the population. In decreasing order of abundance genotypes runs. From group 2, genotype 3 was maintained in two are: 1, 2/3, 4/5, 6/7 and 8/9. Differences in equilibrium runs and genotype 4 in three runs. In five control runs genotype abundances result from the different rewards restarted from the specialist population, all nine geno- gained for using each resource. types were maintained for 100,000 updates (Figure 4b). These results suggest that the nine genotypes of the spe- cialist population represent a stable ecosystem, whereas figure 5, all populations quickly became dominated by a the eight genotypes of the generalist population can be single genotype. This genotype was always the one cal- grouped into three types by their resource use profile. A culated as having the highest absolute fitness based on stable ecosystem is formed when only one genotype from the rewards given for the tasks it was able to perform. each of these types remains. These results indicate that density-dependent selection The most likely explanation for the continuing coexis- was responsible for the stable coexistence of genotypes tence of genotypes in the specialist and generalist pop- during the ecology runs. ulations described above is that density-dependent se- lection acts to favor rare phenotypes. This selection is Discussion caused by the reciprocal relationship between the benefit Despite decades of study, the role of resource-based for using a resource and the number of organisms using competition in promoting diversity remains unre- it. To test this hypothesis, we took the five specialist solved (Schluter 1996). In this study, we demonstrate and five generalist populations saved from the extended the evolution of high diversity in environments in which ecology runs described above, and restarted them in the organisms were forced to compete with one another for same environment, except that resource levels were set resources. This diversity was caused by the stable coex- to be infinite. In this environment there is no inherent istence of genotypes in these populations and continued advantage in using an underutilized resource so that the to be stable for many generations. In contrast, when genotype most efficiently doing the most valuable task(s) resources were not limiting, only one genotype was ever is expected to exclude all other genotypes. As shown in maintained. Coexistence did not depend on any spatial in Artificial Life VIII, Standish, Abbass, Bedau (eds)(MIT Press) 2002. pp 227–232 5

4 10 we evolved, we increased the level of resources in the en- A vironment so that they were not limiting. This disrupts 3 10 density-dependent selection by removing the penalty for using the same resource as other organisms and by no

2 10 longer providing an advantage for being one of a few or- ganisms using a resource. Effectively a single niche is

1 10 created wherein only the fittest genotype is expected to

Genotype Abundance survive (Kassen, et. al. 2000). When we did this, as

0 expected, only one genotype was maintained. 10 0 1 2 3 4 5 The theory of competitive exclusion predicts that each environmental niche can support only one species, thus

4 putting an upper bound on the number of species able 10 to coexist in an environment (Hardin 1960). However, B 3 the number of species actually coexisting depends also 10 on the genetics and physiology of the organisms. Whilst

2 there is a general expectation that selection will tend 10 to favor organisms which specialize on few resources (i.e. adaptive radiation), this expectation assumes that 1 10 there are inherent trade-offs of adaptation such that for Genotype Abundance a given resource a specialist will be more competitive 0 10 0 1 2 3 4 5 than a generalist (Futuyma & Moreno 1988). Whilst Updates [x103] trade-offs have been observed in some studies (for ex- ample (Dykhuizen & Davies 1980; Cooper & Lenski 2000)), in others they have not (Reboud & Bell 1997; Figure 5: Coexistence of genotypes during the contin- Bennett, et. al. 1992). Further underlining the uncer- ued ecology phase with infinite-resources. Genotypes are tainty involved in making this assumption, in this study numbered as in Figure 3. Note that a log scale was used we observe the evolution of both specialists and general- for the y-axis. (A) Genotype dynamics throughout this ists starting from the same ancestral genotype and evolv- phase in a representative generalist population. Dark- ing in the same environment (compare Figure 3 panels gray, genotype 1; light-gray, genotype 3; black, genotype A and B). This finding may reflect either evolutionary 5. Genotype 1 remains at the end of the run. (B) Geno- contingencies in the physiology of the organisms or that type dynamics throughout this phase in a representative evolution of one or other of the populations was stopped specialist population. Genotype 1 remains at the end of before a final strategy had been reached. Future work the run. will address this issue. As the ability of humankind to influence ecosystems increases, the search for mechanisms that underlie the or temporal heterogeneity in the environment. diversity observed in nature has come to be of prag- The most likely explanation for the maintenance of matic as well as scientific interest (Tilman 2000). The multiple genotypes in a resource-limited environment is Avida platform represents a uniquely tractable and pow- that density-dependent selection acts to create multiple erful experimental model that has previously been used niches. This selection is generated because the level of a to answer evolutionary questions on a scale not pos- particular resource depends on the number of organisms sible with traditional systems (Lenski, et. al. 1999; using it, and the benefit for being able to use a resource Wilke, et. al. 2001). The extension that we introduce depends on its level. This reciprocal relationship creates here will allow this system to be used to address ecologi- selection for the use of underutilized resources. Two cal questions requiring the generation of resource depen- broad outcomes of density-dependent selection can be dent interactions between organisms within Avida popu- imagined. At one extreme, organisms could specialize, lations. These studies may be valuable in giving heuristic adapting to one resource at the expense of their com- insight into the workings of natural ecosystems. petitiveness for others. The effect of this is to parti- tion the environment such that as many species as there Acknowledgements are resources are potentially able to coexist. At the other extreme, generalist organisms, able to use under- We thank C. Adami, R. Lenski and C. Wilke for helpful utilized resources while retaining the ability to use those discussion. We are grateful for comments from R. Lenski used by their progenitor, may result. To test whether and C. Adami on an earlier version of this manuscript. density-dependent selection was responsible for the coex- This work was supported by a grant from the National istence of genotypes in the resource-limited populations Science Foundation. 6 in Artificial Life VIII, Standish, Abbass, Bedau (eds) (MIT Press) 2002. pp 227–232

References tion. Am. Nat. 148:s40-s64. Schluter D 2000. Ecological character displacement in Adami, C. 1998. Introduction to Artificial Life. Santa adaptive radiation. Am. Nat. 156:s4-s16. Clara: TELOS Springer-Verlag. Schluter D 2001. Ecology and the origin of species. Adami C, Ofria C, and Collier TC 2000. Evolution of Trends Ecol. Evol. 16:372-379. Biological Complexity. Proc. Natl. Acad. Sci. USA Tilman, D.. 1982. Resource Competition and Commu- 97:4463-4468. nity Structure. Princeton: Pirnceton University Press. Bell GAC 1997. in Chlamy- Tilman D 2000. Causes, consequences and ethics of domonas. I. Short-term selection in uniform and di- . Nature 405:208-211. verse habitats. Heredity 78:490-497. Travisano M, and Rainey PB 2000. Studies of adaptive Bell GAC 1999. Biodiversity of plankton by species radiation using model microbial systems. oscillations and chaos. Nature 402:407-410. Am. Nat. 156:s35-s44. Bennett AF, Lenski RE, and Mittler JE 1992. Evo- Wilke CO, Wang JL, Ofria C, Lenski RE, and Adami C lutionary adaptation to temperature. I. Fitness re- 2001. Evolution of digital organisms at high mutation sponses of Escherichia coli to changes in its thermal rate leads to survival of the flattest. Nature 412:331- environment. Evolution 46:16-30. 333. Cooper VS, and Lenski RE 2000. The population genet- ics of ecological specialization in evolving Escherichia coli populations. Nature 407:736-739. Dykhuizen D, and Davies M 1980. An experimental model: Bacterial specialists and generalists competing in chemostats. Ecology 61:1213-1227. Futuyma D, and Moreno G 1988. The evolution of eco- logical specialization. Ann. Rev. Ecol. Syst. 19:207- 233. Hardin G 1960. The competitive exclusion principal. Science 131:1292-1297. Kassen R, Buckling A, Bell G, and Rainey PB 2000. Diversity peaks at intermediate productivity in a lab- oratory microcosm. Nature 406:508-512. Lenski RE, Ofria C, Collier TC, and Adami C 1999. Genome complexity, robustness and genetic interac- tions in digital organisms. Nature 400:661-664. Morin PJ 2000. Biodiversity’s ups and downs. Nature 406:463-464. Notley-McRobb L, and Ferenci T 1999. Adaptive mgl- regulatory mutations and evolving in glucose-limited Escherichia coli populations. Env. Mi- crobiol. 1:33-43. Notley-McRobb L, and Ferenci T 1999b. The genera- tion of multiple co-existing mal-regulatory mutations through polygenic evolution in glucose-limited popu- lations of Escherichia coli. Env. Microbiol. 1:45-52. Ofria C, Brown, CT, and Adami, C. 1998. The avida user’s manual. In Introduction to Artificial Life (1998). Rainey PB, and Travisano M 1998. Adaptive radiation in an heterogeneous environment. Nature 394:69-72. Reboud X, and Bell G 1997. Experimental evolution of Chlamydomonas. III. Evolution of specialist and gen- eralist types in environments that vary in space and time. Heredity 78:507-514. Schluter D 1996. Ecological causes of adaptive radia-