Extinction and survival of species are the two extremes of population dynamics. Generations of theoretical ecologists tried to model different aspects of the rich dynamics observed in natural populations and communities. For example, the complex interactions between the various species in an entire ecosystem is mostly modeled by trophic networks1,2. On the other end, for a single species, rigorous analytical treatment of the stochastic dynamics can be achieved3,4. Moving from a single-patch view, the incorporation of space into the model was initially pursued using the concept of metapopulation5,6.

The patch-occupancy approach to metapopulations was used to study the steady-state fraction of occupied patches using the local probabilities of colonization and extinction7,8. Later on, stochasticity was added to this approach, resulting in stochastic patch-occupancy models (SPOMs). SPOMs incorporate the probability of patches to be occupied as a function of local rates of colonization and extinction, which depend on factors such as patch quality and connectivity9. However, SPOMs lack explicit population dynamics and thus do not include “mass effects” - a term referring to how variation in population densities can affect migration10,11. Depending on rates of migration and local heterogeneity in the metapopulation, neighboring patches can be synchronized or asynchronized, leading mass effects to alter the probability of local recolonization12. Furthermore, “rescue effects” whereby populations on the brink of extinction are recovered by an inflow of individuals from occupied patches can be generated by mass effects13.

Combining space and species interactions resulted in the concept of metacommunity, a framework proposed to study inter-connected communities of interacting species14,15. Metacommunity models are used extensively in recent years16,17, often with a simplification of using only a small number of species. In particular, victim-exploiter models such as predator-prey systems are very popular first step approximations in studying more diverse ecosystems, dating back to the classical Lotka-Volterra equations18,19.

A long term paradox of spatially extended predator-prey systems is the fact that local dynamics tend to be unstable while the global dynamics escape extinction. The unstable properties of small systems were shown already in the 1930's by the seminal experiments of Gause20. Recent experiments with predator-prey21,22,23,24,25 host-parasite24 and single species26,27 systems imply that migration amongst spatial patches is a two-edged sword: if too weak, it doesn't allow recolonization of empty patches by their neighbors hence leading to a short lifetime of the system. On the other hand, when too large, the system synchronizes, thus reducing the effect of local refuges, leading to the global extinction of all patches28,29,30. The discrepancy between the system's behavior along the range of migration regimes could be understood by different stabilizing mechanisms31. These involve limited migration coupled to either spatial heterogeneity32, or to stochasticity that induces desynchronization between neighboring sites17,33,34.

Both metacommunity and metapopulation models may still lack essential properties of real space and real migration patterns of individuals. To overcome this issue, hierarchical metapopulation models were recently proposed35. Hereby, we take a different approach, by modeling the spatially extended system on a regular lattice. This approach is simpler compared to hierarchical metapopulation models and require less assumptions on the population structure. On the other hand, it is computationally more intense. Modeling population dynamics on regular lattices exhibits spontaneous emergence of local communities (“islands”)36. These islands effectively move in a collective motion and interact with neighboring communities/islands. Using this framework we investigate predator-prey dynamics, based on the original Lotka-Volterra local interactions terms18,19. We add prey competition to the local dynamics37, in order to limit the maximum prey population, thus allowing us to study how predators invade a stable prey population and how prey can survive this invasion using individual migration patterns.

Modeling scheme

We follow Durret and Levin38 by looking at four modeling categories for describing ecosystem dynamics (see Fig. 1). In this way, the impact that spatial features and discreteness of individuals have on these systems can be systematically evaluated39. We begin by modeling the system using a set of Ordinary Differential Equations (ODE). This is a mean-field, single-patch approach where a species population is described by a single continuous density. The addition of explicit space results in Reaction-Diffusion (RD) equations, where spatial patterns and complexity emerge. A different approach uses stochastic single-patch (SSP) models, that neglects space, but individuals are taken as autonomous entities that stochastically interact with each other. Finally, the combination of the RD and SSP approaches leads to Interacting Particle System (IPS)38,39, in which discrete individuals interact locally and migrate between patches that are connected through an explicit spatial structure.

Figure 1
figure 1

Four different modeling schemes and their relation to each other.

ODE - Ordinary Differential Equations, RD - Reaction Diffusion, SSP - Stochastic Single-Patch, IPS - Interacting Particle System.

ODE models are used extensively in various fields and give good results when the modeled system is well mixed and the number of individuals is large4. Analytical solutions can often be found for this set of models and otherwise numerical solutions are generally easy to obtain. One major drawback of this modeling approach is that in order to study extinction, arbitrary cutoff criteria need to be applied, which may invalidate predictions of extinction events based on this modeling approach.

In the context of ecological systems and predator-prey interactions, many ODE models use different non linear terms to include complex interactions. For example, Rosenzweig & Macarthur37 used the type II functional response40 to implicitly incorporate the time it takes one predator to handle a single prey unit. Here, we modeled the predation using the simple type I functional response40, as we aim to capture the simplest possible model while maintaining the discrete and spatial properties of real systems, as described below.

The inclusion of space into a local continuous model naturally leads to the RD modeling approach, which is often analyzed with standard tools for solving partial differential equations41. Using these tools, analytical approximations can be made in some cases, but more often, numerical methods are applied. Spatio-temporal dynamics, such as invasion fronts and scale free patterns, often emerge from basic model assumptions using the RD modeling approach42,43,44. This is also a natural setting to study the effects of environmental noise, as it can easily be incorporated into the model45. However, since the species densities are continuous, studying extinction is still problematic for the same reasons as described above.

A direct modeling approach to capture extinction events uses individual agents with stochastic interactions between them46. In order to gain tractability, spatial structure is often not included, resulting in SSP models, where all interactions take place on the same site. With discrete numbers of individuals, the model is subject to demographic noise3, naturally leading to the possibility of extinction. For the simple logistic growth dynamics, the timescales for extinction could be obtained using analytical tools under some simplifying assumptions4,47. For more complex dynamics, stochastic simulations can be used46, allowing the study of a wider set of systems.

If however, we do not neglect space, then we have the full blown spatial and stochastic IPS model. Analytical tools for these models are mostly absent and the numerical tools used are often similar to those used for SSP models. Due to the large systems described in this approach, as compared with the SSP case, simulation times are often a major limiting factor. A thorough examination of the model is therefore more problematic, requiring the use of methods that approximate the dynamics of the model48. It is however in this group of models that complex behavior such as extinction due to spatial features of the system can be described. Moreover, since the basic model assumptions are still rather simple and straightforward, it is often possible to retrace complex emergent phenomena to its basic components17,34,36,49,50,51,52,53,54. This contrasts with the more complex modeling approach of Agent Based Models (ABM), in which each particular individual is described separately. Simulations of ABM systems take much longer times and the connection between microscopic behavior and macroscopic phenomena is harder to obtain39.

Current study approach

In this study we use an IPS model (the “ABC” model) to investigate the influence of spatial heterogeneity and discreteness of individuals on the dynamics of species survival and extinction. This model, described in detail in the methods section, follows the interactions between A (resource), B (prey) and C (predator) agents. The A agents, that never die out, act as catalysts in the system, allowing for B reproduction to occur in the same location and are thus the source of environmental noise. The B agents reproduce only in the presence of A agents and compete with other B agents. The C agents prey on the B agents, replacing a B agent with a C agent. All these agents interact locally and move stochastically on the underling migration matrix of the system.

By using approximate simulation methods on IPS, the effect of model parameters can be investigated in reasonable times55. This is done by scanning the parameter space for specific relevant parameters and building a parameter-space map, where each point in the map describes the eventual state of numerous simulations under the same conditions. In the context of predator-prey interactions, we chose the predation rate and the prey mortality as the main parameters investigated, as they pertain to the robustness of predators and prey, respectively. We note that a wide set of parameter values has been studied and the specific parameter values chosen do not greatly affect the results described. Using this methodology a more general understanding of the behavior of the system can be gained, showing how the eventual state of the system depends on model parameters. In particular, we are able to trace back global extinction events to the individual migration events that cause them and find their dependence on model parameters.


The importance of being spatial and discrete

We begin our investigation by taking the commonly used ODE representation of the Lotka-Volterra equations and adding in turn first spatial heterogeneity, then discreteness of agents and finally combining these two features. For the simple ODE case, the system is generally in coexistence of predator and prey, except when either the predator or prey are very weak (low predation rate and high mortality rate respectively), which leads to survival of the prey or extinction of both, respectively. These three possible phases of the system can be seen in Fig. 2a, combined with phase transition lines derived from linear stability analysis of the ODE system, which are consistent with the simulation results. We move to an RD model with spatial heterogeneity, by randomly distributing a finite number of resource agents in a spatial system. We see no significant effect on the parameter space for this different model, as can be seen in Fig. 2b. This similarity stems from the fact that without discreteness of the predator and prey agents, extinction only occurs when the effective reproduction of the species is lower than its effective mortality. These effective values do not directly depend on the spatial structure, but only on the resource density in the system.

Figure 2
figure 2

Parameter space maps for different models studied: long times behaviors of the model (following the introduction of predators) are shown for different values of the predator's (C) predation rate (γ) and prey's (B) decay rate (β).

Extinction of both species (B and C) is shown in black, survival of the prey after the extinction of the predator in green and coexistence of both species in cyan. In each panel, both axes are in logarithmic scale, with larger γ at the top and longer B life span to the right. Phase transition lines derived from linear stability analysis are marked in red (a). In the panels on the upper row (a&b), B and C fields were taken to be continuous while in the panels on the lower row (c&d) these agents followed a discrete dynamics (see text for details). The left column (a&c) corresponds to a single site (well-mixed) system while the right column (b&d) refers to a 1D ring composed of 500 sites. In the continuous dynamics (upper row), parameter-space is dominated by the coexistence phase, except for the regime of either weak B (on the left; shorter B life span) or weak C (on the bottom; lower γ) of each panel. In the discrete system it is clear that while a coexistence phase remains just above the low predation regime, the system's state transforms into either extinction (of both species) or survival (of the B's) phase along different transition lines.

Adding discreteness of agents to the system, instead of spatial structure, has more dramatic effects. Results of the SSP model, seen in Fig. 2c, show a vast region of parameter space where the predators are more efficient in catching prey, leading to the extinction of both predator and prey. This well known consequence of over-predation56 occurs when the predators eliminate all of the prey in this single-patch system, thus left with no food source and die out. It did not occur in the continuous model since prey levels never reach zero in such a setting, but only exponentially small numbers. Finally, by combining spatial heterogeneity with discrete numbers of predator and prey, we reach a more complete description of predator-prey interactions. In this system, resource agents diffuse throughout the system, enabling the reproduction of prey agents when in the same location. Islands of prey agents naturally form around the diffusing resource agents, which interact with other islands and predators, leading to complex emergent behavior36,57. As seen in Fig. 2d, for values of high predation, the system reaches a state where the prey survives, but the predator is absent. This unintuitive result is surprising not only because it is the more efficient predators that die out, but because they go extinct without eliminating the prey in the process. We would like to focus on the survival mechanisms that allow this prey persistence to occur, not when the predators are too weak to hunt them, but when they are too efficient in doing so.

Survival mechanisms

In a predator-prey system, survival mechanisms may refer to the survival of the predators, a transition between Coexistence and Survival phases, or to the survival of prey instead of their extinction, which is the transition between Survival and Extinction phases. We focus on the prey survival and investigate two distinct mechanisms that enable it, stemming from microscopic interactions between discrete agents, moving around in a heterogeneous space. We term these mechanisms “Diaspora” and “Ebola” for reasons that will be explained below.

The Diaspora mechanism allows prey to survive for intermediate predation levels, when prey agents come back from fringe areas of the system to recolonize regions where the prey has been eliminated by predation. To understand this mechanism we look at a simpler system, a single island mesoscopic view, in which a single resource agent supports a population of prey agents around it.

To this island we then insert predator agents and see how this system reacts over time and how its final state depends on system parameters. The evolution of the system after the introduction of predator agents strongly depends on the predation rate, as seen in Fig. 3a. For very low predation rates (V), the predators are inefficient and simply die out without any significant effect on the prey population. With higher predation rate however (IV), the effective predation rate is high enough to overcome the predators own mortality and a coexistence of predator and prey is reached in a monotonic manner.

Figure 3
figure 3

Dynamics and Parameter-space map for a single island system: a 1D ring of 200 sites with one static A agent.

(a) Five representative points in parameter-space (I..V) were chosen to demonstrate the dynamics in real space for different time points after the C agents were introduced into the system. All five points are on the β = 10−2 line, while the values of γ change (I: 10−1.75, II: 10−3.0, III: 10−4.25, IV: 10−5.5, V: 10−6.75). For very low γ (V), the C's are inefficient and even with a large number of B's cannot reproduce, hence the C's go extinct without affecting the B's. At low γ (III,IV), the B numbers diminish at first, but while for lower predation (IV) they quickly rebound and never fall to zero, for higher predation (III) the B density falls to zero (time 100) in the main site and only diffusion of B's from neighboring sites saves the system from extinction. For still higher predation (II) the C agents eliminate all B's from the main site and its vicinity (time 500) and they follow soon after and decay (time 1000). some B agents remain on the fringe of the island (time 1500) and due to their long lifespan they manage to diffuse back to the main site and repopulate the system (time 5000). For very high γ (I) fewer B agents remain and they do not manage to return to the main site, thus leaving the system at a state of extinction. (b) Parameter-space containing points (I–V), shows how the coexistence phase expands upwards compared to the single site case (Fig. 2a) and reaches the same transition line as the many A agents case (Fig. 2d). One can see that one (static) island is largely sufficient to explain the coexistence phase of the full IPS model.

Coexistence is reached in a less direct manner for medium levels of predation (III). For these values of predation rate, a single-patch system would end up in extinction, but here the addition of space plays a significant role. Shortly after the introduction of predators their numbers explode in the central site and the prey are eliminated from that site. The predators also spread to neighboring sites, but due to lower numbers of prey they cannot multiply as quickly and so the fringe prey populations are largely untouched. As the predator numbers drop in the central site the prey agents from the fringe slowly move back to the main site and are not killed as quickly by the predators, due to their low numbers. The prey agents now multiply by the use of the resource agent and the cycle can now go on, with predator numbers jumping due to high prey concentration. These cycles are damped by the limiting factor of the prey competition, so that the system settles to a coexistence state. The stabilizing effect of the fringe sites seen here, which leads to coexistence in spatial heterogeneous systems, has been previously described as a migration induced stability32,58.

This rescue effect, of fringe prey population returning to repopulate an extinguished island, is what allows the Diaspora survival mechanism to take place. For higher predation rate (II), the prey population after a predator invasion is largely decimated, with only a sparse population of prey in the fringe. The probability of each prey agent to come back to the resource site is negligible, but taken as a whole, the prey have a viable chance to reform an island around the resource site. Thus, the Diaspora mechanism is directly affected by the probability of an agent to get to a given location in space, often termed a first passage problem59. Given a very high predation rate (I), the number of prey agents to survive the predator invasion is insignificant and thus the probability that any of the remaining prey agent will return to the resource site quickly goes to zero. This transition of survival to extinction can therefore happen if either the prey have a shorter life span, or the predators are more efficient, as seen in Fig. 3b.

Considering how an island in decimated by predators given the opportunity, we are left to ask what happens if the predators cannot reach some of the islands. This scenario allows a different survival mechanism that we term the Ebola mechanism. When competent predators reach an island, they quickly invade into its main site that contains the resource and spread across the island. As described above, the future of the island depends on the predation rate, but regardless of the island's fate, the predators may move on to infect other islands if they are near enough. Thus, if there are enough resources in the systems, all islands become connected and the predators easily migrate across the system. In a system with only a few resource units however, the islands are not connected and the predators cannot migrate between them. In this scenario, if the predation is high enough, the islands reached by the predators will be decimated. The predators will soon follow and die out, leaving the distant islands untouched and given time, the prey will repopulate the system. Thus, the Ebola survival mechanism clearly depends on the spatial structure of the system. Moreover, since a single predator can create a whole new invasion wave if it reaches a distant island, its correct description requires discrete agents. An example of the dynamics of these two mechanisms can be seen in Fig. 4.

Figure 4
figure 4

Time evolution of two 2D systems, exhibiting the Ebola (upper row) and Diaspora (lower row) effects.

Both system have γ = 10−1 but different value of β. A, B and C agents are colored in red, green and blue respectively. Soon after their arrival to the system, the C agents quickly spread throughout the system (times 20,100). For higher β (upper row), with smaller B islands, the C's cannot reach certain parts of the system which are left unharmed; soon afterwards the C's go extinct (time 1000). The remaining island of B's (time 2000) slowly repopulate the whole system (time 10000). For lower β (lower row), the islands are bigger and thus the C's reach all of them and only a handful of B's survive on the fringe (time 300). These however have a higher chance of reaching an A agent by diffusion due to their longer lifespan, (time 1000) and once they do, they repopulate the system more rapidly due to the larger island size (time 3000).

For the case of very high predation rate, we use a simple cluster toy model (see methods section) to validate our understanding of these two mechanisms. By assuming each island has an effective radius in which predators can propagate, we ask what part of the system is covered by the islands for this given radius. A system in which more than one cluster of islands exist, will end in a state of prey survival by the Ebola mechanism, while if all the clusters are connected, the Diaspora mechanism might allow prey survival. The results from the cluster toy model are compared to the IPS model in Fig. 5 a&b.

Figure 5
figure 5

(a–b) Average probabilities of the different phases as a function of the resource number (a) and prey decay rate β (b). The probabilities are compared to an estimation using the cluster model (see methods section). (c–f) Parameter-space maps for a 1D system with 500 sites and different numbers of A agents ((c):10, (d):25, (e):50, (f):100). Phases are shown in different colors as indicated in the bottom legend. The probabilities in (a) were calculated from aggregating the results of 10,000 realizations of 100 different parameter choices (the upper right corner in (c–f): 0.1 < γ < 1 and 10−7 < β < 10−6) for every NA value shown. In panel (b), NA was fixed to 25, while for every β value shown, the probabilities were calculated from aggregating the results of 1,000 realizations where 0.1 < γ < 1 (the upper stripe in (c–f)). The magenta arrows indicate two paradoxes mentioned in the text, in which more robust prey (horizontal arrow) and predator (vertical arrow) are more prone to extinction.

Extinction of the fittest

With the understanding of the mechanisms that allow prey survival in high predation regimes, we can turn to the general question of how predator and prey robustness effects their persistence. As seen in the top-bottom arrow in Fig. 5e, we find that predators are more susceptible to extinction if they have a higher predation rate. This result can be seen as a specific case of the “Tragedy of the commons” of over predation56, but we note two interesting additions. First, the predator persistence is increased by the spatial heterogeneity, as seen when comparing the coexistence range of a single-patch system in Fig. 2c, to the IPS model shown in Fig. 5. Second, despite the over predation by efficient predators, the prey may persist due to the survival mechanisms previously described. This effect however, is largely dependent on the prey's own characteristics. As seen in the left-right arrow in Fig. 5e, more robust prey, with a longer life-span, leads to extinction of the prey, rather than its survival. This is a side effect of the Ebola mechanisms, that depends on the prey scarcity in space for its survival. If the prey is too abundant throughout space, then the predators can reach all the prey communities and eliminate them. Thus, it is the weaker and scarcer prey, that might survive a predator invasion.

Enrichment and dimensionality

A closer look at the role of resource abundance, by comparing the different parameter-space maps of Fig. 5c–f, shows another paradoxical consequence of the Ebola mechanism. With more resource agents in the system, the region of Extinction of both predator and prey, prevalent for high predation and high prey life span, is enlarged. Taken together with a slight enlargement of the Coexistence region for low predation, these two effects contrast with the classic view of the “Paradox of Enrichment”60. Here, instead of instability due to enrichment, we see that the predators actually benefit, even if only slightly, from the addition of more resources. Further, it is the prey that become unstable by the addition of resources. In the high predation regime, where a low resource density would allow prey survival, more resources bring a higher risk of prey extinction.

We finally look at the effect of system dimension on the results presented. As seen in Fig. 6a&b, the phase regimes are similar for both one dimensional (1D) and two dimensional (2D) systems, but some differences are noticeable. More specifically, we see that the Diaspora mechanism is more dominant in a 2D setting and that the both the Coexistence and the Extinction phases take up larger regions. This appears to be a specific case in which with higher dimensions, possible outcomes become more extreme, with larger coexistence and extinction domains. In the limit of a fully connected system, we nearly come back to the single-patch system, in which a Survival phase is largely nonexistent and only Coexistence and Extinction prevail.

Figure 6
figure 6

Parameter-space maps of different topologies of the system.

(a): 1D system, with a higher density of A agents than for Fig. 2d. N = 500, NA = 50. (b): 2D system exhibiting a very similar parameter-space to that of the 1D case, except for a finite-size effect at high predation and low β, due to the small number of sites for this dimensionality. N = 2500, NA = 75. (c): A fully connected system, with a parameter-space very similar to the single-patch system, except for an enlarged coexistence phase due to the minimal heterogeneity in this system. N = 100, NA = 5.


The routes to extinction are numerous, yet natural populations manage to prelude them by various mechanisms. We have shown how having a population made of discrete individuals in a heterogeneous landscape can allow the system to retain its stability, even in adverse conditions. These mechanisms, which allow for the persistence of populations, depend on the probability of individuals to reach far away populations. For parameters in which the transition between survival and extinction occurs, a single individual's migration will determine the fate of the whole population. It is therefore instrumental to use explicit stochastic modeling when investigating the stability of the system and its dependence on system parameters. Moreover, since the migration probabilities depend on the spatial structure of the system, by allowing spatial heterogeneity to emerge from intrinsic properties of the system we can focus on the role of basic species interactions on its stability properties.

Indeed, the choice of predator-prey interactions allows us to do just that. The Lotka-Volterra model is quite compelling in terms of the minimal number of assumptions from which the predator-prey systems properties are deduced. Yet its framework has two shortcomings: some of the empirically observed phenomenology cannot be explained and the effects of discreteness and spatial extension have not been followed to their last implications. As it turns out these two issues are solved together, as the effects of discreteness and spatial structure correspond very well to features which would a priori seem to be outside the Lotka-Volterra original framework. Over-fitness of the prey individuals as could be measured in the absence of predators leads to increased fragility of the prey population to predator attack and over-fitness of the predator individuals (as could be measured on a single site) leads to the extinction of the predator population before it even exhausts the prey. Such effects, not expected in the original ODE formulation of the Lotka-Volterra systems, are intrinsic to the discrete spatially extended system and are in agreement with the empirical observations11,24.

One may speculate that it is the kind of mechanisms described above that put limits to the degree of individual fitness which is optimal from the point of view of species survival. This leads to the possibility that the ecology is inherently never in equilibrium: as individuals of a species increase their fitness the species survival expectation decreases. Instead of converging towards some optimal plateau, one may rater imagine the ecology as an ever evolving system in which new imperfect species are born, they evolve towards higher individual fitness by the usual Darwinian selection and are eliminated by their excess efficiency, destroying the very ecological basis of their existence. Thus one would have two levels of evolution: The usual Darwinian one that leads to individual fitness increase and an additional one that acts on species. This latter is actually destroying the species whose individuals are too fit, leaving space for new imperfect species to take their place. This macro over-individual mechanisms may facilitate a theoretical framework to account for major biological jumps that take the system out of local equilibrium and throw it into a more efficient but very different global states (unattainable by local optimization). In particular it may constitute a mechanism for the dynamics responsible for punctuated equilibrium.

It is rewarding that an entire series of empirical observations which seem contradictory to the assumptions of the Lotka-Volterra model, are in fact are borne out by the Lotka-Volterra original framework as soon as discreteness and spatial extension are properly accounted for.


The model

The “ABC model” considered in this paper describes a system with three types of agents interacting in it; namely: resource (A), prey (B) and predator (C). The system is composed of a finite number of sites linked through a coupling (migration) matrix to form a meta-population system. Each agent is positioned on a specific site of the system. There is no limit to the number of agents allowed on a site. An agent can react only within that site, or diffuse to adjacent sites according to the connectivity matrix which defines the topology of the system. The probability of an agent migrating is density independent and as such is not affected by the number of agents in the site. Each of the possible reactions and migrations occurs with a specific probability per time unit (rate). The different types of reactions and migrations are described in table 1.

Table 1 Descriptions of the different reactions and migrations in the ABC model

The objective of the current study is to investigate the stability features of the system. In the simulations, we create a semi-steady state of the system by initializing the A's and B's randomly and simulating the system in the absence of C's until a time T. The time T is chosen such that there is no qualitative difference between the state system at time T and the state at time 2 · T.

We then introduce a number of seed C agents to the system at a randomly chosen position. We classify the various realizations of the systems in three phases according to their final state:

  • The Coexistence phase: both B (prey) and C (predator) agents coexist in the system for a long period of time.

  • The Survival phase: only B agents remain, having survived after the C agents were introduced into the system and eventually went extinct.

  • The Extinction phase: no B or C agents remain in the system.

Extinction is an absorbing phase - once the number of B and C agents has reached zero, no recovery is possible. Moreover, given the stochasticity of the system, internal fluctuations will eventually take all finite systems into the extinction phase for infinite time. We therefore consider a system to be in a specific phase if it remains in that phase for a long enough time so that only very rare fluctuations (with a probability exponentially small in the system size) will take the system out of its current phase.

Choice of parameters

The parameters chosen in this study represent the system's behavior for a wide range of parameters. The main parameters that were varied are the prey decay rate (β) and the per capita predation rate (γ). These relate to the robustness of the prey and predator, respectively and their values were varied between 100 and 10−7. The other reaction and diffusion rates were kept constant. The prey reproduction rate (α) was set to 0.5, since we are interested in the regime where prey can survive, in the absence of predators, with a few resource agents. The predator decay rate (δ) was set to 0.1 to ensure that the predators are dependent on the prey for long term survival. The prey competition rate () was set to 10−6, to allow for large communities of prey to exist. Diffusion rates for all agent types (DA, DB, DC) were set to 10−2, except for the results shown in Fig. 3, where DA was set to 0 for simplicity. We note that as long as the different diffusion rates have similar values, the effective movement of the A agents compared to the B and C agents is negligible, since many more B and C agents exist, so that at least some of them end up following the A agent whenever it moves to a different site.

Other alternatives to consider spatial heterogeneity exist. One such variation was considered by altering the original AB model36 to include mortal A agents that re-appear randomly after they die61. This variation showed very similar behavior to the original AB model in which A agents are immortal and move on a lattice similar the A's in the ABC model studied here. Nevertheless, we cannot rule out the possibility that the survival mechanisms described in this paper will change in some extreme limits of the diffusion coefficients or when considering consumable resources (A's).

Numerical methodology

To display the role of spatiality and discreteness, we compared the spatially extended discrete model (Fig. 2d) with models where either the discreteness (Fig. 2b) or the spatial extension (Fig. 2c) or both (Fig. 2a) were missing. The parameter-space maps for the discrete systems in Fig. 2c&d, were obtained by stochastic Monte-Carlo simulations, using the following binomial algorithm62:

We consider a time step, Δt, to be a sequence of updates of N sites, where N is the number of sites in the system. The choice of which site to update is drawn randomly from a uniform distribution, independent of previous choices. After updating the N sites, the time is progressed by Δt. A site update consists of the following operations:

  • The order in which actions are performed (migrations and reactions, as described below) is random with equal probabilities.

  • Migrations: for each agent type, the number of agents that migrate is drawn from a Binomial distribution b(pi, Ni) where Ni is the number of agents of type i in the site and pi = DiΔt (Di is the migration rate for agent of type i). The agents that were chosen to migrate are then randomly distributed amongst the adjacent sites, using a binomial distribution as well: if nD agents were chosen to migrate and nN is the number of nearest neighboring sites, nD1 = b(nD, 1/nN) will migrate to the first neighbor, nD2 = b(nDnD1, 1/(nN − 1)) to the second nearest neighbor and so on.

  • Reactions: several different reactions are carried out simultaneously within the site, with reaction probabilities as listed below. The change in number of agents is computed for all reactions first and only later are these summed and the number of agents is updated.

The probabilities of the different reactions that take place, which were then used for the Binomial distribution for each site update, were calculated as:

  • Prey reproduction probability:

  • Prey death probability:

  • Predation probability:

  • Predator decay probability: Pγ = δΔt

where NA, NB are the number of A and B agents at the site where the reaction takes place respectively. The time step size was set to Δt = 0.1 in all simulations. This ensures that the probability for all linear reactions and diffusions are never more than 0.1. With smaller Δt the simulation becomes more like a Gillespie simulation46 and the set of equivalent simulations from both algorithms were compared to insure consistency of the results, (see the subsection below describing the comparison to the Gillespie algorithm).

The continuous simulations (Fig. 2a&b), were carried out in a similar fashion, but instead of a binomial distribution, the average probability was used to determine the fraction of agents that will undergo each process. As suggested by the name, the number of agents was allowed to take any non-negative real value. A cutoff value of 10−50 was used at the end of the simulation to determine the fate of the system (A cutoff of unity gives similar results, but requires a much longer run time of the system). We note that these continuous simulations are not completely equivalent to true ODE and RD models, as they use discrete time steps with average probabilities. In practice however, within the parameter range in question, the differences are negligible, as can be gleaned from the phase transition lines in Fig. 2a. These lines were derived from a linear stability analysis of the true ODE system.

The systems were studied either on a 1D (Fig. 2,3,5,6,7) or 2D (Fig. 4,6) lattice with periodic boundary conditions, or a fully connected system, with each site connected to all others via migration (Fig. 6c). The system is initially seeded with a certain number of A agents which are randomly placed, as well as 4 · N B agents, a number large enough so that for all the simulations, sites with A agents will be potentially inhabited by B agents. The system is then run until it reaches a semi-steady state of A's and B's (t = 106 was found to be sufficient for that purpose, throughout the parameter space investigated). Here a steady-state indicates that doubling the system initialization time results in a qualitatively identical system. At that time, 10 C agents are put into the site with the highest B density (enough so that the predators can have a chance at predating before demographic fluctuations might eliminate them) and the simulation continues until the phase of the system is determined, as detailed below. All simulations were made using a custom code written in C, using the Tausworthe generator for random number generation available through the gsl library63. For building a parameter-space, 100 different realizations were carried out, each realization having a different randomization seed used for the stochastic simulations. Averaging over additional realizations did not show any qualitative difference on the parameter-space and hence a 100 realizations was considered sufficient. This was repeated for different values of β and γ, mapping the range of these parameters from 100 to 10−7 with logarithmic resolution of 100.1. The average result from these realizations was used for the analysis and for coloring each pixel in the parameter-space maps, with the different phases Coexistence, Survival and Extinction colored by cyan, green and black respectively. These phases were defines as:

  • Coexistence (cyan) - After the introduction of C agents a system is run for additional 2 · 104 time steps and still has both B and C agents in it.

  • Survival (green) - A system that has no more C agents, after these were already introduced and has a viable number of B agents (NB > 100) in sites with A agents, (that is, the B agents will continue to survive for a long time). Here we make no further time requirement as in the coexistence phase, since a system with only B agents is generally much more stable than when C's also inhabit the system.

  • Extinction (black) - A system that has neither B or C agents, before or after the C agents are introduced. No time requirement is necessary as this is an absorbing state.

Figure 7
figure 7

The system phases Survival (Ebola), Survival (Diaspora) and Coexistence as a function of the predation rate, derived using both the Gillespie algorithm and the binomial algorithm.

System size was set to N = 64 and NA = 8 (resource agents). Prey's decay rate was set to β = 10−2 (a) and β = 10−3 (b).

The Survival phase was further differentiated into three cases, depending on the history of the system that led to this phase (as seen in Figs. 57). These are:

  • Survival by weak predator (red) - No islands of B agents have been wiped out by the C invasion.

  • Survival by Ebola (green) - At least one island of B agents is left untouched by the C invasion.

  • Survival by Diaspora (orange) - All islands of B agents have been wiped out by the C invasion.

Cluster toy model

The phase probabilities derived from the IPS model were also analyzed using a cluster model, see Fig. 5a&b. Here, it is assumed that for each A agent an island of B agents exists around it. Since the C's have a higher decay rate than diffusion rate, they can only (on average) pass through sites with a minimum number of B agents. In this respect, each island has an effective radius in which the C's are able to propagate, defined as a d-sphere (d being the the dimension of the system). Under the assumptions of this model, if d-spheres with a given radius are randomly placed in the system, then as one increases the radius and the number of spheres, initially the spheres will not be connected (NC), but eventually they will make one connected cluster (OC) and finally they will cover the whole system (WS). Although all systems that are WS are also OC, we will refer to these systems as only WS. For a given number of spheres with a certain radius, there is therefore a probability of having either a WS, OC or NC system. The WS state implies an Extinction phase, since the C's propagate through the whole system, killing off all B's, while the NC implies a Survival phase (via the Ebola Mechanism), since the C's cannot reach the different islands. Between these, the OC state gives either a Survival phase (via the Diaspora Mechanism), assuming the surviving B's on the fringe manage to reach an A agent, or an Extinction phase, if they fail to do so.

To calculate the probabilities of the three states, for each different sphere radius and sphere number, 105 different realizations were run with the positions of the spheres randomly chosen from a uniform distribution. All these simulations were conducted for a 1D system with 500 sites. To calculate the effective radius of the island (the radius of the spheres), the profile of B density (its dependence on the distance from an A agent) was averaged from 100 different realizations of single island stochastic simulations (200 sites in a system with 1 A agent). Assuming the C's immediately change all B's in that site to C's (which is approximately the case for high predation rates), then the probability of C's propagating to the next site Pi, from a site with NB B agents, is approximately given by the binomial distribution:

Where 1/δ approximates the lifetime of a single C agent and hence approximates the probability it will not diffuse to the next site. The probability P(r) of C's to reach the site that is r sites away from the A agent is therefore:

This function has a sigmoid shape and we can assume that the r value for which it changes rapidly between 0 and 1, is the effective radius in question. We therefore want to find the maximum of its derivative with respect to r. A good approximation for this value is the first moment of the difference function of the probabilities and we use it as the effective radius:

We note that for the calculation of probabilities of OC and WS we use a sphere size of R − 1 and R respectively, since for WS we do not require the C's to continue propagating the last hurdle, only to eliminate the last B's, while for OC we do. We finally note that given an OC state, the probability of the surviving B's to reach the A agent nearest them is approximately:

With NB given by the original B number on a site just outside the effective radius and Ppass is a rough approximation of the probability of a single B agent to reach an A agent, assuming a lifetime of 1/β and considering the relation of mean square displacement for a random walker.

Comparison to Gillespie algorithm

The de facto standard method of simulating the dynamics of an agent base model is to use the Gillespie algorithm, as previously mentioned. While it allows to simulate a specific realization of a system with the exact probabilities for all processes, it is very inefficient, especially for a large number of agents. In this study we chose to use a binomial algorithm, as described in the Numerical methodology subsection, which although being an approximation to a correct realization of a system, is more computationally efficient. For example, when calculating the parameter-space (as previously done in this study) for a small system (64 sites), the binomial algorithm was approximately 500 times faster than the Gillespie algorithm. However, the question remains whether the binomial algorithm approximates the dynamics and more importantly, the values measured in the system. The main parameter controlling these values is the time step used for the binomial method, which for consistency, was taken as Δt = 0.1 throughout this study. We compare the results of the algorithms for a small system of 64 sites, choosing two values of prey decay rate and looking at the phase probabilities as a function of the predation rate (Fig. 7).

The Gillespie algorithm takes a specific state of the system and stochastically finds the next event to occur, as well as the elapsed time until it takes place. More specifically the algorithm is:

  • Choose some initial state of the system (see initial and final conditions below).

  • Calculate for each site in the system, the rates of all possible events in the system (as detailed below).

  • Choose at random which event will take place, with the probability of choosing each event taken at its rate as was computed in step 2.

  • Update the system according to the chosen event (that is, for the case of diffusion randomly choose an adjacent site to move the agent to, or, in the case of a reaction add and/or remove an agent in the given site).

  • Choose at random a time step, according to an exponential distribution with the mean value of one over the sum of rates of the different possible events.

  • Update the time using the time step chosen in step 5 and go back to step 2.

Steps 2–6 are repeated until a predefined final condition takes place. The rates of different events, calculated for each site, are:

  • Total prey reproduction rate: Rα = αNANB

  • Total prey death rate:

  • Total predation rate: Rγ = γNBNC

  • Total predator decay rate: Rδ = δNC

  • Total resource diffusion rate:

  • Total prey diffusion rate:

  • Total predator diffusion rate:

NA, NB, NC are the numbers of the A,B,C agents in a specific site, respectively.