{'fraction_non_alphanumeric': 0.03228539156626506, 'fraction_numerical': 0.007435993975903614, 'mean_word_length': 4.452655889145497, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Computer simulations of history of life: speciation, emergence of complex species from simpler organisms, and extinctions

We propose a generic model of eco-systems, with a {\it hierarchical} food web structure. In our computer simulations we let the eco-system evolve continuously for so long that that we can monitor extinctions as well as speciations over geological time scales. {\it Speciation} leads not only to horizontal diversification of species at any given trophic level but also to vertical bio-diversity that accounts for the emergence of complex species from simpler forms of life. We find that five or six trophic levels appear as the eco-system evolves for sufficiently long time, starting initially from just one single level. Moreover, the time intervals between the successive collections of ecological data is so short that we could also study ``micro''-evolution of the eco-system, i.e., the birth, ageing and death of individual organisms.


I. INTRODUCTION
During last one decade, theoretical research on coevolution of species in eco-systems and the statistics of extinctions have been strongly infleunced by the pioneering interdisciplinary works of Per Bak and his collaborators [1,2,3,4]. In the same spirit, we address some fundamental questions of evolutionary ecology from the perspective of statistical physics.
How did the higher species emerge in eco-systems inhabited initially only by primitive forms of life, like bacteria and plankton [5,6,7]? The available record of the history of life, written on stone in the form of fossils, is incomplete and ambiguous. An alternative enterprise seeks to recreate the evolution on a computer by simulating theoretical models [8,9]. In this paper we propose a theoretical model that not only addresses the question raised above but also provides a versatile conceptual tool for studying evolutionary ecology. In particular, it describes both the "macro"-evolutionary processes (e.g., origin, evolution and extinction of species) as well as "micro"-evolution, (e.g., age-distribution in the population of a species, mortality rates, etc.).
If watched over a short period of time, the dynamics of the eco-system appears to be dominated by birth and death of the individual organisms as well as by the prey-predator interactions. However, over longer period of time, one would see not only extinction of some species but also the appearance of new ones. Besides, in many situations, macro-evolutionary changes occur at rates that are comparable to those of the ecological processes [10,11]. The artificial separation of this process into "ecological" time scales and "geological" time scales [12] has been made in many earlier theoretical works only for the convenience of modelling.
The "ecological" models, that describe population dynamics in detail using, for example, the Lotka-Volterra equations [13,14] usually ignore the slow macroevolutionary changes in the eco-system; hardly any effects of these would be observable before the computer simulations would run out of computer time [15]. On the other hand, in order to simulate the billion-year old history of life on earth with a computer, the elementary time steps in "evolutionary" models have to correspond to thousands of years, if not millions; consequently, the finer details of the ecological processes over shorter periods of time cannot be accounted for by these models in any explicit manner [1,16]. Limitations of these approaches are well known [17,18,19]. Moreover, most of the recent computer models of ageing [20] focus attention on only one isolated species and, therefore, cannot capture macro-evolutionary phenomena like, for example, extinctions which depend crucially on the prey-predator interactions.
We wish to develop one single theoretical model which would be able to describe the entire dynamics of an ecosystem since the first appearance of life in it up till now and in as much detail as possible. This dream has now come closer to reality, mainly because of the availability of fast computers [21,22,23,24,25,26]. It has become feasible now to carry out computer simulations (in-silico experiments) of eco-system models where, each time step would correspond to typical times for "micro"-evolution while each of the simulations is run long enough to capture "macro"-evolution.
The prey-predator relations in any eco-system are usually described graphically in terms of food webs [27,28,29,30]. More precisely, a food web is a directed graph where each node is labelled by a species' name and each directed link indicates the direction of flow of nutrient (i.e., from a prey to one of its predators). We incorporate in our model the hierarchical organization of the species at different trophic levels of the food web.
In real eco-systems, the food web is a slowly evolving dynamic network. For example, species are known to change their food habits [31]. These changes in diets may be caused by scarcity of the normal food and abundance of alternative food resources. Moreover, higher organisms appear through speciation in an eco-system that initially began with only simple forms of life. These not only occupy new trophic levels but also introduce new prey-predator interactions with the existing species. Therefore, it is also desirable that these self-organizing features of natural eco-systems should be reproduced, at least qualitatively, by the theoretical models.
The aim of this paper is to propose a model that would capture the desirable features of eco-systems outlined above. Higgs, McKane and collaborators [17,18] have developed a model, called the Webworld model, which was aimed at linking the ecological modeling of food web architecture with the evolutionary modeling of speciation and extinction. The spirit of our model is very similar although the details of the mathematical formulation of the two models are quite different.

II. THE MODEL
We model the eco-sytem as a dynamic hierarchical network. The "micro"-evolution, i.e., the birth, growth (ageing) and natural death of the individual organisms, in our model is captured by the intra-node dynamics. The "macro"-evolution, e.g., adaptive co-evolution of the species, is incorporated in the same model through a slower evolution of the network itself over longer time scales. Moreover, as the model eco-system evolves with time, extinction of species is indicated by vanishing of the corresponding population; thus, the number of species and the trophic levels in the model eco-system can fluctuate with time. Furthermore, the natural process of speciation is implemented by allowing re-occupation of vacant nodes by mutated versions of non-extinct species.
A. Architecture of the network Each node of the network represents a niche that can be occupied by at most one species at a time. The number of nodes in the trophic level ℓ is m ℓ where m is a positive integer. We assume only one single species at the highest level ℓ = 1. The allowed range of ℓ is 1 ≤ ℓ ≤ ℓ max (t), where ℓ max (t) is a time-dependent number in our new model. In other words, in contrast to all cited earlier models, the numerical value of ℓ max in our new model is not put in by hand, but is an emergent property of the eco-system.

B. Prey-predator interactions and intra-species competitions
The prey-predator interaction between two species that occupy the nodes i and k at two adjacent trophic levels is represented by J ik ; the three possible values of J ik are ±1 and 0. The sign of J ik indicates the direction of trophic flow, i.e. from the lower to the higher level. J ik is +1 if i eats k and it is −1 if k eats i. If there is no prey-predator relation between the two species i and k, we must have J ik = 0. Although there is no direct interaction between species at the same trophic level in our model, they can compete, albeit indirectly, with each other for the same food resources available in the form of prey at the next lower trophic level.
We now argue that the elements of the matrix J account not only for the inter-species interactions but also for the intra-species interactions arising from the competition of individual organisms for the same food resources. Let S + i be the number of all prey individuals for species i on the lower trophic level, and S − i be m times the number of all predator individuals on the higher trophic level. Since we assume that a predator eats m prey per time interval, S + i gives the amount of total food available for species i, and S − i is the total contribution of species i to the pool of food required for all the predators on the higher level. If the available food S + i is less than the requirement, then some organisms of the species i will die of starvation, even if none of them is killed by any predator.
The intra-species competition among the organisms of the same species for limited availability of resources, other than food, imposes an upper limit n max of the allowed population of each species; n max is timeindependent parameter in the model. Thus, the total number of organisms n(t) at time t is given by i is larger than S − i then food shortage will be the dominant cause of premature death of a fraction of the existing population of the species i. On the other hand, if S − i > n i − S + i , then a fraction of the existing population will be wiped out primarily by the predators.
In order to capture the starvation deaths and killing by the predators, in addition to the natural death due to ageing, a reduction of the population by is implemented at every time step, where n i is the population of the species i that survives after the natural death. C is a constant of proportionality. If this leads to n i ≤ 0, species i becomes extinct. We assume that the simplest species occupying the lowest trophic level always get enough resources that neither natural death nor predators can affect their population.

C. Collective characteristics of species
An arbitrary species i is collectively characterized by [23]: (i) the minimum reproduction age X rep (i), (ii) the birth rate M (i), (iii) the maximum possible age X max (i) that depends only on the trophic level occupied by the species. An individual of the species i can reproduce only after attaining the age X rep (i). Whenever an organism of this species gives birth to offsprings, M (i) of these are born simultaneously. None of the individuals of this species can live longer than X max (i), even if an individual manages to escape its predators or starvation.

D. Mutations
With probability p mut per unit time, each of the species randomly increases or decreases, with equal probability, their X rep and M by unity. (X rep is restricted to remain in the interval from 1 to X max , and M > 0.) Moreover, with the same probability p mut per unit time, they also re-adjust one of the links J from prey and one of the links J to predators [32]. If the link J ij to the species i from a higher level species j is non-zero, it is assigned a new value of J ij = J ji = 0. On the other hand, if the link J ik to a species i from a lower species k is zero, the new values assigned are J ik = 1, J ki = −1. These readjustments of the incoming and outgoing (in the sense of nutrient flow) interactions are intended to capture the facts that each species tries to minimize predators but look for new food resources.

E. Speciation
The niches (nodes) left empty because of extinction are re-filled by new species, with probability p sp per unit time [33]. All the simultaneously re-filled nodes in a trophic level of the network originate from one common ancestor which is picked up randomly from among the non-extinct species at the same trophic level. All the interactions J of the new species are identical to those of their common ancestor. The characteristic parameters X rep , M of each of the new species differ randomly by ±1 from the corresponding parameters for their ancestor.
However, occasionally, all the niches at a level may lie vacant. Under such circumstances, all these vacant nodes are to be filled by a mutant of the non-extinct species occupying the closest lower populated level. As stated above, the lowest level, that is populated by the simplest species, never goes extinct; the possible ageing of the species at the lowest level [34] is not relevant here. All the individual organisms of the new species are assumed to be newborn babies that begin ageing with time just like the other species. Since space does not enter explicitly in our model, it does not distinguish between sympatric and allopatric speciation [? ].

F. Emergence of new trophic level
In order to understand why the total number of trophic levels in food webs usually lie between 4 and 6, we allowed adding a new trophic level to the food web, with a small probability p lev per unit time, provided the total bio-mass distributed over all the levels (including the new one) does not exceed the total bio-mass available in the eco-system. This step is motivated by the fact that real ecosystems can exhibit growing bio-diversity over sufficiently long period of time. Increase of the number trophic level means the diversification at the erstwhile topmost level as well as all the lower levels and the emergence of yet another dominating species that occupies the new highest level. The total number of levels, which determines the lengths of the food chains, depends on several factors, including the available bio-mass [36].

G. Birth and natural death of organisms
At each time step, each individual organism α of the species i gives birth asexually to M (i) offsprings with a probability p b (i, α). We also assume the time-dependent probability p b (i, α) is a product of two factors. One of these two factors decreases linearly with age, from unity, attainable at the minimum reproduction age, to zero at the maximum lifespan. The other factor is a standard Verhulst factor 1 − n i /n max which takes into account the fact that the eco-system can support only a maximum of n max individual organisms of each species. Thus, p b (i, α) is equal to the Verhulst factor at X = X rep .
Each individual organism, irrespective of its age, can meet its natural death. However, the probability p d of this natural death depends on the age of the individual. In order to mimic age-independent constant mortality rate in childhood, we assume the probability p d of "natural" death (due to ageing) to be a constant p d = exp[−r(X max − X rep )/M ], (with a small fraction r), so long as X < X rep . However, for X > X rep , the probability of natural death is assumed to increase following the Gompertz law p d = exp[−r(X max − X)/M ]. Note that, for a given X max and X rep , the larger is the M the higher is the p d for any age X. Therefore, in order maximize reproductive success, each species has a tendency to increase M for giving birth to larger number of offsprings whereas the higher mortality for higher M opposes this tendency [37]. However, even with a constant p d = 0.1 we found qualitatively similar results.

H. Summary of the dynamics of the eco-system
The state of the system is updated in discrete time steps where each step consists of a sequence of six stages:

I-Birth II-Natural death III-Mutation IV-Starvation death and killing by prey V-Speciation VI-Emergence of new trophic level
In all our simulations we began with random initial condition, except for M = 1 for all species, mostly with only three levels in the food web, and let the eco-system evolve for T w time steps before we started collecting ecological and evolutionary data from it; these data were collected for the subsequent T = 5T w time steps where the longest runs were for T = 10 8 . We have not observed any qualitative differences in the data for n max = 100 and n max = 1000, keeping all the other parameters same. Most of our simulations were carried out with m = 2, as we did not observe qualitative differences between the data for m = 2 and m = 3, 4 in test runs. The maximum lifespans in the levels were assumed to be X max = 100, 71, 50, 35, 25, .... starting from the highest level.

A. Lifetime distributions
Several theories, based on extremely simple models, claim that the distribution of the lifetimes of the species should follow a power law with a slope of −2 on the loglog plot. The distributions of the lifetimes of the species in our model are shown in fig.1 for a few different sets of parameter values. Although our data do not rule out an approximate power law over limited regime of lifetimes, one single power law over the entire range of lifetimes seems impossible.

B. Distribution of minimum reproductive ages
In fig.2 we plot the distributions of the minimum reproductive age X rep of the species for several different sets of values of the model parameters. Although over relatively short time scales of observation this distribution appears quite broad it narrows down with evolution and the non-zero values of this distribution correspond to reasonable values of age.

C. The number of trophic levels
Due to the randomness in the evolutionary process, occassionally, all of the niches in a level (except the lowest one) may lie vacant. We have monitored ℓ max (t) and also N (t), the number of those levels at time t in which at least one niche is occupied by a non-extinct species. In fig.3 we plot N as a function of time for one single run. This clearly shows how, over geological time scales, ℓ max reaches 6. In this run, the sixth level (the highest one) emerges after 10 5 time steps. It also demonstrates that at all stages of evolution, the number N (t) keeps fluctuating. During the very late stages, N keeps fluctuating between 5 and 6, although N is more often 6 than 5 for all times beyond 10 6 . The ratio of occurrences of six levels and five levels in the eco-system stabilized only after 10 7 time steps.
We have also computed the distributions (histograms) of N by averaging the data over large number of runs. As shown in fig.4, the distribution becomes narrower for longer runs and the trend indicates than in the extreme long time limit would be sharply peaked around one single value of N , as indicated by the fig.3.

IV. SUMMARY AND CONCLUSION
In this paper we have introduced a theoretical model of eco-systems with a generic hierarchical trophic level structure. Because of data collection at suffciently short intervals, we have been able to monitor the ecological phenomena like, for example, birth, ageing and death of individual organisms and, hence, the population dynamics of the species. We have also been able to run our simulations upto sufficiently long times (10 8 , with stationarity achieved at around 10 7 ) so that the model also accounted for macro-evolutionary phenomena like extinctions of species as well as speciation that leads not only to emergence of species at the existing levels of complexity but also to higher species that occupy an altogether new trophic level in the food web.
From the infinite possible life forms, we start with one or a few, and then let our ecosystem grow in diversity and complexity until the limitations of biomass restrict it to hundreds of individuals in dozens of species, organized into about five trophic levels.
Although our model food web is hierarchical, it is not a tree-like structure. The hierarchical architecture helps us in capturing a well known fact that in the normal ecosystems the higher is the trophic level the fewer are the number of species. It is well known that the body size and abundance of a species are strongly correlated to their positions as well as to their interactions with other species in the food web [38,39]. If we neglect parasites and herbivorous insects on trees, then, in general, predators are fewer in number and bigger in size as compared to their prey species [39]. This is very naturally incorporated in the hierarchical food web structure of our model. Let us assume that in the model the body size of individual organisms on each level ℓ is about m times smaller than that on its predator level ℓ−1. On the other hand, the maximum possible populations of organisms, including all the nodes, in a level ℓ is m times that at the level ℓ − 1. Consequently, the maximum amount of biomass on each level is, approximately, the same.
Since each individual organism appears explicitly in our model, one could, at least in principle, assign a genome to each individual and describe Darwinian selection which takes place at the level of organisms [40,41]. Unfortunately, additional ad-hoc assumptions would be required to relate the genome with the reproductive success [21,25]. Instead of introducing an ad-hoc mathematical formula to relate genotype with phenotype, we have worked directly with phenotype, particularly, quantities that decide the reproductive success of the organisms; these quantities are X rep , X max and M .
From the perspective of self-organization, the new model surpasses all cited previous models as not only the characteristic collective properties of the species but even the nature of inter-species interactions as well as the total number of trophic levels in the food web are determined by self-organization of the eco-system.