A laboratory and simulation platform to integrate individual life history traits and population dynamics

Understanding populations is important as they are a fundamental level of biological organization. Individual traits such as aging and lifespan interact in complex ways to determine birth and death, and thereby influence population dynamics; however, we lack a deep understanding of the relationships between individual traits and population dynamics. To address this challenge, we established a laboratory population using the model organism Caenorhabditis elegans and an individual-based computational simulation informed by measurements of real worms. The simulation realistically models individual worms and the behavior of the laboratory population. To elucidate the role of aging in population dynamics, we analyzed old age as a cause of death and showed, using computer simulations, that it was influenced by maximum lifespan, rate of adult culling and progeny number/food stability. Notably, populations displayed a tipping point for aging as the primary cause of adult death. Our work establishes a conceptual framework that could be used for better understanding why certain animals die of old age in the wild. To help determine how life history traits of individuals result in emergent properties of a population, laboratory studies of Caenorhabditis elegans were combined with an individual-based simulation, pointing out to potential factors that influence old age as a cause of death.

A nimals maintained in laboratories or captivity, where conditions are gentle and consistent, display age-related degenerative changes and progressive frailty; eventually this frailty becomes so severe that it results in death, referred to as dying of old age. It is possible to determine the maximum adult lifespan of animals in such a population, which depends on genotype and environment. The maximum adult lifespan varies widely between animals, ranging from ~1 day in mayflies, ~40 days in Caenorhabditis elegans (C. elegans), ~80 years in Asian elephants and ~120 years in humans; however, animals evolved in the wild, where conditions are neither gentle nor consistent, leading to an important question: do animals in wild populations also display age-related degenerative changes that result in frailty and lead to death? Alternatively, extrinsic causes of mortality such as disease, predation, accident or starvation may kill wild animals before the onset of age-related frailty. In a foundational paper, Medawar suggested that the answer is important for understanding the evolutionary biology of aging 1 . Based on contemporary studies by field scientists, Medawar thought few senescentrelated deaths would occur in wild populations because individuals typically succumbed to extrinsic mortality, an understanding deeply imbedded in the theory he proposed. However, starting in the 1990s, extensive field studies have documented senescence in wild animals from insects to birds and mammals [2][3][4] . For many species, wild animals display age-related degenerative changes that are likely to contribute to mortality, although the extreme frailty displayed by animals aged in captivity are not observed 5,6 .
To gain deeper insights into how individual traits such as lifespan impact population dynamics, we used C. elegans, a nematode worm that is a major model system to investigate the molecular and cellular control of aging. Individual C. elegans cultured in the laboratory display age-related degenerative changes that ultimately result in frailty and death, similar to other animals in captivity; however, in nature worms live in populations and environmental conditions fluctuate. To understand the role of aging in these conditions, we established a laboratory system in which a population of C. elegans with an Escherichia coli (E. coli) food source can be propagated indefinitely. By measuring the number of worms and the amount of bacteria, we can monitor the population as it fluctuates over time. C. elegans is well suited for this purpose due to their brief, welldefined life cycle of around three days, brief mean lifespan of ~15 days, and ability to build clonal populations due to its hermaphroditism. Worms can be cultured in liquid medium and counted using an automated system, enabling frequent monitoring of large populations. Laboratory populations, also referred to as experimental microcosms, have a long history in ecology. Ecosystems developed for Didinium nasutum and its prey Colpidium campylum-as well as Daphnia and its prey, phytoplankton-have revealed important aspects of population dynamics and predator-prey interactions [7][8][9] .
Individual-based models (also known as agent-based models) have been used in a variety of applications from economics to ecology. In this modeling approach, the system consists of individuals that operate in an environment. At each time step, the model updates the environment and computes individual behaviors as specified by a series of rules. These models are powerful as the behavior of individuals considered in aggregate results in emergent properties of the population, which are not directly specified. We designed the laboratory population to be well suited for simulation modeling, and the coordinated development of the laboratory population and the individual-based model is a distinctive feature of this study 10 . Here we describe the development of an individual-based model called wormPOP that is informed by measurements of individual worms in multiple food environments. The model specifies Development of wormPOP using individual worm measurements. Conceptualizing the C. elegans life cycle as a flux system. The tools to analyze laboratory populations have limitations and do not reveal details such as the developmental stages of individuals, longitudinal information about individual life histories, or cause of death. To complement the laboratory population and address these issues, we created an individual-based computational model in which the agents are C. elegans [11][12][13] . The simulation environment consists of bacteria in a 5 ml volume. We conceptualized the C. elegans life cycle as a flux system that accounts for individuals and mass flow (Fig. 1g,h). Five nodes correspond to developmental stages of worms: egg, larva, dauer, adult and parlad (parent/larva/ dauer). A dauer is an alternative L3 larval form that is stress resistant. A parlad, also called a bag of worms, is the result of matricidal hatching, which occurs when hermaphrodites stop laying eggs and self-fertilized eggs hatch into larvae and mature into dauers inside of the hermaphrodite 14,15 . Starvation can trigger matricidal hatching in fertile hermaphrodites, which promotes survival of the fertilized eggs and is most likely adaptive 16 . Each node is characterized by two values: the number of worms and the total mass of those worms. Nodes are connected by arrows labeled worm transition (wt) that represent rates in units worms/time or mass/time. An egg transitions to a larva when it hatches. A larva eats bacteria and grows; it transitions to an adult when food is plentiful and to a dauer when food is limiting. A dauer transitions to a larva when food is plentiful. An adult eats bacteria, grows and generates eggs when food is plentiful, thereby transferring germline parental biomass to progeny. An adult transitions to a parlad when food is limiting. A parlad generates dauers, thereby transferring somatic parental biomass to larval progeny. A worm transitions out of the system when it dies from one of three possible causes: all stages can die from culling, larvae and adults can die of starvation, and adults can die of old age. Worm transition rates are not directly specified as parameters of the model but rather are emergent properties of the system.
The system contains one bacteria node that has a value equal to the mass of bacteria in the system. The bacteria node is connected by arrows labeled bacterial transition (bt) that represent rates in units mass/time (Fig. 1h). Bacterial mass enters the node by periodic feeding and can exit the system by culling. Bacterial mass transitions to C. elegans larval and adult mass by ingestion. The system is grounded by conservation of mass -worms must consume bacterial mass to grow and produce progeny. The model uses discrete time steps of 3 h. At each time step, the environment and every virtual worm is evaluated and updated based on a defined set of decision trees (Extended Data Fig. 1). The Methods describes the basic decision trees, whereas Supplementary Section 2 is an overview, design concepts, and details (ODD) protocol 17,18 description of the model, and Supplementary Section 3 provides detailed descriptions of decision trees and a comparison to the laboratory population. The frequency and amount of bacteria input, and the frequency and percent culling rate are user-programmable parameters specified for each run. The model compiles the complete trajectory of each individual, including rates of growth, time of transitions, production of progeny, and cause and time of death (Supplementary  Tables 2 and Supplementary Data 1). Individual data can be combined to yield properties of the population.
Laboratory measurements of worms to inform the simulation. To create a realistic model, we measured the properties of individuals cultured in conditions similar to the laboratory population: growth of larvae and adults, egg-laying by adults, transition of dauer to reproductive growth and adult lifespan. The concentration of bacteria was varied to evaluate this key environmental factor. Growth, egg-laying and dauer transition to reproductive growth were highly sensitive to the concentration of bacteria, whereas adult lifespan was relatively insensitive (Fig. 2). Measured data were coded into the decision trees so that virtual worms mimic the behavior of real worms. Simulated individual worms and worms measured in the laboratory displayed similar behavior, providing a first level of validation (Fig. 2 Step 2 Analyze Initialize 250 larvae 10 mg bacteria 5,000 µl S-medium Step 1

Cull
Step 3   There is variability between biological replicates in the laboratory and between runs of the simulation model. Supplementary Tables 3-6 indicate that variability in the laboratory tends to be greater than variability in the simulation, but not in all cases.

Comparing population dynamics in laboratory and simulation.
To compare simulated and laboratory population dynamics, we performed three biological replicates of the laboratory population and three runs of the simulation using 10% culling and 10 mg bacterial feeding every 24 h for 100 days (Fig. 3a,b, Extended Data Figs. 2-4, Supplementary Fig. 9 and Supplementary Table 7). The simulation initialization phase increased to a maximum of ~122,000 worms on day 10, and then declined to ~60,000 on day 18 (Supplementary Table 7). This pattern reflects the concentration of bacteria, which accumulated for six days before declining into a daily oscillation (Fig. 3c,f,g). The laboratory population initialization phase increased to a maximum of ~120,000 worms on day 26, and then declined to ~35,000 on day 39. During the maintenance phase, the simulated population oscillated with an average of ~62,000, a maximum of ~104,000, and a minimum of ~21,000; the laboratory population oscillated with an average of ~32,000, a maximum of ~71,000 and a minimum of ~3,000. Although the simulated population displayed larger average, minimum and maximum numbers of worms, the overall patterns of initialization and maintenance phases were similar. . Worms were computationally simulated in bacteria concentrations that correspond to the laboratory conditions (red lines). a,b, Average daily progeny production of individual adults in the laboratory (a) and simulation (a,b). The single red curve in a corresponds well with the gray laboratory data with the same concentration of E. coli. c, Summary statistics: time spans are black arrows (1-3); peak egg number is a red arrow (4); total egg number is the gray area under curve (5). d, Comparison of peak egg number and total egg number from laboratory and simulations. Values are mean ±s.d. of minimum three independent experiments. e,f, Average daily mass of individuals in the laboratory and simulation. The single red curve in e corresponds well with the gray laboratory data with the same concentration of E. coli. g, Summary statistics: time spans are black arrows (1)(2); mass values are red arrows (3)(4). h, Comparison of size at sexual maturity and maximum size from laboratory and simulations. Values for maximum size are mean ±s.d. of minimum three independent experiments and for sexual maturity size the mean of two independent experiments for maturation size. i,j, A population of dauers were cultured with bacteria starting at t = 0 (data show average percent of larvae in the population). Laboratory animals were in the dauer stage for as long as ten days. Average percentage larva in the laboratory (i) and simulation (i,j). The single red curve in i corresponds well with the gray laboratory data with the same concentration of E. coli. k, Summary statistics: time span is a black arrow (1); percent larvae is a blue arrow (2). l, Comparison of percent of dauers that transition after 120 h from laboratory and computation. Values are mean ±s.d. of minimum three independent experiments. m,n, Survival curves for populations of individuals cultured with the bacterial concentration beginning at the L1 stage in the laboratory (m) and the simulation (m,n). Lower concentrations of bacteria did not cause a substantial extension of adult lifespan, as might have been expected based on studies of caloric restriction. Notably, we initiated exposure to the bacterial concentration at the L1 and L4/young adult ( Supplementary Fig. 8) stage and continued this same concentration throughout the adult life, whereas caloric restriction experiments often involve specific protocols for exposure to the restricted food environment. o, Summary statistics: time spans are black arrows (1 and 2). p, Comparison of mean adult lifespan from laboratory conditions and computational simulations.
The simulation data include longitudinal measurements of every individual, allowing a detailed understanding of population dynamics. Figure 3d-g displays the number of animals in each node over time; the population reached a minimum size of ~17,000 animals on day 41, including ~3,000 adults. With food available, these adults produced a burst of eggs that peaked on day 43 with ~60,000 eggs. Eggs hatched into larvae that peaked at ~85,000 on day 45. This large population depleted the bacterial food, triggering starvation as adults transitioned to parlads on day 44 and larvae transitioned to dauers that peak on day 46. As the population declines and bacterial food increases, adults begin to appear on day 47 and a new cycle begins. The average behavior of the system can be displayed graphically, which reveals that most worms are eggs, larvae and dauer, with few adults and parlads. Adults primarily generate progeny by forming eggs, and primarily die of starvation and culling; very few die of old age. Most larvae starve or form dauer; relatively few transition to adults (Fig. 3h).
In constant food environments, individual traits of simulated worms correspond closely to individual traits of worms measured in the laboratory, validating the simulation model in this specific environment; however, in variable food environments the longitudinal experiences of individual simulated worms were not validated by measuring worms in the laboratory. Thus, the model might diverge from reality in these cases, and similarities between population dynamics in the simulation and laboratory population do not formally validate the longitudinal experience of worms in the simulation.
The influence of feeding and culling on population dynamics. Common sense predicts that decreasing bacterial feeding will decrease the average worm number in the population. To quantitatively investigate this relationship and evaluate the correspondence between laboratory and simulation, we reduced bacterial feeding from 10 mg per 24 h to 5 mg per 24 h in both (Extended Data Figs. 2b,c,f, 3b,e and 4b,c, and Supplementary Table 7). In the laboratory, the average number of worms decreased from 35 × 10 3 to 15 × 10 3 (~58%), whereas in the simulation, the average number of worms decreased from 59 × 10 3 to 33 × 10 3 (~42%). Thus, laboratory and simulation displayed the same trend, confirming the commonsense prediction. The quantitative change is similar (about 50%), although the absolute number of worms in the simulation is higher than the laboratory. Common sense predicts that decreasing culling percent would increase average worm number. Using 5 mg per 24 h feeding, we reduced culling from 10% per 24 h to 5% per 24 h in both laboratory and simulation (Extended Data Figs. 2c,d,e, 3b,e and 4c,d, and  Supplementary Table 7). In the laboratory, the average number of worms increased from 15 × 10 3 to 29 × 10 3 (~93%); in the simulation, the average number of worms increased from 33 × 10 3 to 37 × 10 3 (~11%). Although the quantitative change was larger in the laboratory, the simulation and laboratory displayed the same trend, confirming the common-sense prediction.
We changed both culling and feeding simultaneously by comparing 10 mg bacteria and 10% culling every 24 h to every 48 h in both laboratory and simulation (Extended Data Figs. 2a,b,g, 3c,f and 4a,b, and Supplementary Table 7). Because these changes to culling and feeding have opposite effects, the outcome is not a commonsense prediction. In the laboratory, the average number of worms decreased from 36 × 10 3 to 26 × 10 3 (~28%); in the simulation, the average number of worms decreased from 59 × 10 3 to 24 × 10 3 (~59%). Thus, the decrease in food is the dominant factor compared to the decrease in culling. The trend is the same in the laboratory and simulation, and the percent decrease was greater in the simulation. In the feeding and culling every 48 h regime, the number of worms in the laboratory population (26 × 10 3 ) and simulation (24 × 10 3 ) were very similar. Importantly, simulation parameters were fixed according to the training set (Extended Data Fig. 2b) and never changed afterwards to fit laboratory data (see Supplementary Section 4).
Old age as a cause of death in the simulation. Progeny number and death from old age. The simulation indicates adults typically die of starvation and culling, but rarely of old age. To identify conditions where adults frequently die of old age, we reasoned that culling only dauer and larva stages in the simulation would (1) decrease competition for food, thereby reducing starvation as a cause of adult death and (2) by definition eliminate culling as a cause of adult death. When dauer and larva culling in the simulation was varied from 0-85% per 24 h, the average number of worms decreased from ~66,000 to ~13,000 (Fig. 4a). The fraction of eggs and adults increased progressively, whereas the fraction of larva and dauer decreased progressively (Fig. 4b,c and Supplementary Table 8). The amount of bacteria displayed an upward inflection at around 80%, indicating that overall consumption decreases dramatically at this level of dauer and larva culling (Fig. 4d). Aging as a cause of adult death displayed tipping-point behavior (Fig. 4e). With 75% per 24 h dauer and larva culling, periodic episodes of food deprivation caused ~99% of adults to die of starvation, whereas only ~1% died of old age (Fig. 5a-c). Slightly increasing dauer and larva culling to 80% per 24 h reduced food deprivation to just three episodes at the transition to the maintenance phase, and ~52% of adults died of starvation whereas ~48% died of old age (Fig. 5d-f). Slightly increasing dauer and larva culling to 85% per 24 h eliminated episodes of food deprivation, and 100% of adults died of old age ( Fig. 5g-i). The simulation makes it possible to examine the behavior of each node in these different environments (Extended Data Figs. 5 and 6, and Supplementary Figs. [10][11][12][13][14][15][16][17]. The egg-laying behavior of individual adults in the simulation revealed that dauer and larva culling of 10% per 24 h results in a low average total progeny number of 25, as adults frequently die of starvation. By contrast, dauer and larva culling of 85% per 24 h results in an average total progeny number of 106, as adults have adequate bacterial food their entire lives (Fig. 4f).
The tipping point is associated with a reservoir of dauers. To investigate the tipping-point phenomenon, we analyzed the effect of culling only eggs in the simulation. When egg culling was varied from 0-90% per 6 h, the fraction of eggs and adults increased progressively and then displayed an upwards inflection around 84% ( Fig. 4h and Supplementary Table 9). The fraction of larva decreased progressively, and the fraction of larvae, dauer and parlad displayed a downward inflection around 84%. Aging as a cause of adult death displayed tipping-point behavior, with a sharp inflection around 84% ( Fig. 4g and Supplementary Table 9). These results indicate the tipping point is caused by reducing progeny number, which can be accomplished at the stage of eggs or dauer and larvae. To explore the role of dauers in the tipping-point phenomenon, we analyzed simulated mutant worms that cannot effectively transition from larvae to dauer or adult to parlad, and rapidly die of starvation in the dauer stage. This greatly reduced but did not entirely eliminate dauers from the system. When dauer and larva culling in the simulation was varied from 0-85% per 24 h, the fraction of eggs and adults increased progressively, whereas the fraction of larva decreased progressively ( Fig. 4j and Supplementary Table 10). Aging as a cause of adult death did not display tipping-point behavior, but rather displayed a fairly linear increase in the percentage of animals that die of old age starting at 20% culling ( Fig. 4i and Supplementary Table 10). The tipping-point phenomenon is thus associated with a reservoir of dauers and is not intrinsic to the design of the computational simulation.
Maximum lifespan and death from old age. Having established conditions in the simulation where all adults die of old age, we investigated the effects of intrinsic adult lifespan. The maximum adult lifespan is a user-programmable parameter that was initially set to 40 days on the basis of laboratory measurements 19 . To explore this life history trait, we analyzed virtual mutant worms with maximum lifespans of 25 or 60 days. Both mutants displayed a tipping point in the simulation, but the percent dauer and larva culling necessary to cause 50% of adults to die of old age shifts from 77%, to 80%, to 85% as the maximum adult lifespan increased from 25 to 40 to 60 days, respectively (Fig. 6a-c and Supplementary Tables 8, 11 and 12).  3, degree of freedom (Df) = 3 and P < 0.001 followed by a Tukey's post-hoc honest significant test (HSD), 10 % versus75% P = 0.0012, 10% versus80% P = 0.0000003, 10% versus85% P = 0.0000001, 75% versus80% P = 0.000008, 75% versus85% P = 0.000002, 80% versus85% P = 0.17). g-h, Summary statistics for simulated populations with a variable percentage of egg culling (values are averages of ten independent experiments). g, Cause of death for adults; with no adult culling, adults only die of starvation or old age. h, Average percent of eggs, larva, adults, dauer and parlad among all worms. i,j, Summary statistics for simulated populations of mutant worms that do not accumulate as dauers with a variable percentage of dauer and larva culling (values are averages of ten independent experiments). i, Cause of death for adults; with no adult culling, adults only die of starvation or old age. j, Average percent of eggs, larva, adults, dauer and parlad among all worms.
Thus, if maximum adult lifespan is longer, then progeny culling must be more stringent to allow adults to die of old age.
Adult culling and death from old age. Starting with conditions in the simulation that cause 50% of adults to die of old age and 50% to die of starvation, we analyzed the effect of adult culling. When adult culling was varied from 0 to 40% per 24 h, aging and starvation as causes of adult death decreased rapidly, replaced by culling (Fig. 6d-f and Supplementary Table 13-15). Long-lived worms were the most sensitive to adult culling, with no animals dying of old age at an adult cull rate of ~20% per 24 h. By contrast, short-lived worms maintained some adults dying of old age until 40% per 24 h adult culling (Fig. 6g). These results confirm a common-sense prediction, which validates the simulation model, and also establish quantitative relationships between adult culling and the ability of adults to die of old age.
Thus, these observations in the simulation identify three factors that influence aging as a cause of adult death: (1) large numbers of juveniles create food instability, increasing starvation as a cause of adult death and thereby decreasing old age as a cause of adult

Discussion
Biological systems are characterized by levels of organization that proceed from microscopically small to immense; understanding the emergent properties that appear at each level is a challenging and important research goal that is inherently interdisciplinary. These levels include atoms, simple molecules, complex macromolecules, organelles, cells, organs and organisms, encompassing the fields of biochemistry, cell biology, physiology and developmental biology.
In the next level, organisms assemble to form populations, which display the emergent property of population dynamics. We reasoned that life history traits of individual organisms ultimately determine population dynamic behavior, and new tools were needed to elucidate rules that govern the interface between the level of individual organisms and population dynamics. To bridge this gap, we developed a laboratory population with just two species: C. elegans and its food source E. coli. A complementary computational model that simulates C. elegans population dynamics as a flux system based on measured individual traits adds data depth and predictive power. Controlled laboratory ecosystems have been previously established-mainly with plankton algae in large water tanks 20 -and are used to investigate topics such as prey evolution 21 , steady state biomass levels 8 or toxicity of heavy metals 20 . Although the zooplankton species Daphnia magna is used as a model organism 22 , it is rarely used in aging studies. By contrast, C. elegans is a premier model organism for studies of development and aging 23 . The experimental system described here is distinct in several respects: first, the C. elegans laboratory population was designed to facilitate a complementary individual-based simulation, so it is well suited for this purpose; second, the simulation outputs include intuitive graphical representations of the C. elegans life cycle, conceptualized as a flux system, integrating the development and physiology of individuals  with the properties of the population; and finally, the simulation was designed to facilitate the analysis of mutant worms, creating a platform that complements the large collections of C. elegans mutants that can be analyzed in the laboratory. C. elegans is difficult to analyze in nature because of its small size and subterranean lifestyle. Wild C. elegans populations are hypothesized to undergo boom-bust cycles 24 . A cycle begins when a dauer enters a new food patch such as a rotten apple. The dauer transitions into a larva, matures and reproduces to initiate a new population. This population proliferates until the food source is exhausted, leading to the generation of many dauers. These dauers must disperse to find a new food patch to restart the cycle 25 . Galimov and Gems developed an individual-based simulation to test the hypothesis that programmed death is an adaptive strategy for C. elegans to secure food for clonal progeny 26 . They modeled a single food patch on a grid that allowed worms to disperse; the endpoint was the number of dauers formed when food is exhausted, interpreted as a measure of colony fitness. Dispersal rates, progeny production and adult lifespan influenced the number of dauers produced in a single boom-bust cycle. Although there are similarities, the approach described here is different in several ways. We measured individual worms in the laboratory as a function of food concentration to establish parameters for the model. wormPOP models an accessible, real-world situation-the laboratory population-and we measured the behavior of the laboratory population for comparison with the simulation results; wormPOP has strict mass accounting, which constrains growth and progeny production to the amount of bacterial food ingested by an individual.
In the laboratory population that was analyzed, simulation modeling indicates adults typically die of starvation and culling rather than old age. The simulation was used to identify conditions where adults frequently die of old age. One key factor is progeny number, which was manipulated by stage-specific culling. Old age as a cause of adult death displays tipping-point behavior-it rarely occurs with high levels of progeny but can become frequent when progeny levels are reduced to a critical level. The tipping point did not occur when simulated mutant worms cannot accumulate in the dauer stage, indicating that the tipping point is not an inevitable outcome of the model design. The results suggest that a reservoir of dauers promotes adult death from starvation, as dauers reenter reproductive development whenever food becomes abundant and consume the excess food. The tipping point suggests the population can exist in two states. State 1 is characterized by frequent episodes of starvation and an abundance of dauers, whereas state 2 is characterized by a stable food supply and an absence of dauers. This result may be related to observations in the wild-abrupt shifts of ecosystems from one state to another state have been observed and described 27,28 . We have not confirmed that the tipping point occurs in the laboratory population; thus, it is possible the model deviates from reality in this respect. Future experiments to validate the tipping point in the laboratory require development of new methods to perform stage-specific culling (which may be possible using    (2), 60 days (3). c, Bars depict the lowest percent of dauer and larva culling that causes 50% of adults to die of old age based on the data in b. d-f, Summary statistics for simulated populations with a variable percentage of adult culling: average percent of adults that die of starvation, old age or culling. At each point on the horizontal axis, the values sum to 100%. We used the dauer and larval culling value that causes 50% of adults to die of old age with 0% adult culling: 77% for the 25-day maximum lifespan (d), 80% for the 40-day maximum lifespan (e), and 85% for the 60 day maximum lifespan (f). g, Bars depict the lowest percent of adult culling that causes 0% of adults to die of old age based on the data in d-f. h, Summary of the relationship between maximum lifespan, food security (progeny survival) and extrinsic adult death (culling). Triangles indicate conditions in which more than 50% of adults die of old age. i, Multiple factors influence the number of adults in the population that die of old age. Values are averages of minimum three independent experiments. size-exclusion nets) and to determine the cause of adult death (which may be possible by detailed visual inspection and individual culture of worms from the laboratory population).
A second key factor is adult culling. As expected, when adult culling increases, fewer adults die of old age. The third key factor was the maximum adult lifespan, with a shorter maximum lifespan increasing the number of deaths from old age compared with a longer maximum adult lifespan. However, the maximum lifespan only matters in specific conditions; when no animals die of old age or all animals die of old age, the maximum adult lifespan was not relevant. Thus, conditions that promote adults dying of old age include: (1) reproductive restraint, which leads to food stability and minimizes death from starvation; (2) infrequent adult culling; and (3) a short maximum adult lifespan.
The factors defined here provide a framework that can explain diverse animals that die of old age in the wild (Extended Data  Fig. 7). For example, elephants are intrinsically long-lived animals that have been observed to have aging as a cause of adult death in nature. Our model predicts that elephants must have a low level of adult culling and a small number of juvenile animals. Indeed, elephants make very few progeny, and their large size makes them essentially immune to predation [29][30][31] . Mayflies have a very short intrinsic lifespan and have been observed to have aging as a cause of adult death in nature. These adults do not ingest food, so they are immune to starvation, and even though they are subject to high levels of adult culling, the lifespan is so short they can still frequently die of old age 32,33 .
Our future goal is to combine this experimental platform with the advanced tools of C. elegans genetics to bridge the gap between individual traits and the behavior of populations and expand our understanding of eco-devo 34 . The current laboratory experiments only involved wild-type worms. One future direction is to measure the population dynamics of mutants that have different growth rates, egg-laying behavior, adult lifespan, or altered dauer entry and exit behaviors. All worms have the same genotype in the current version of wormPOP. The simulation model can be modified to have two or more different genotypes in the same environment, and the laboratory population can also be modified to perform competitions between two or more different genotypes of worms. These advances would allow this platform to integrate population dynamics with population genetics to understand how specific alleles flow through a dynamic population over time. The laboratory population is based on regular addition of E. coli bacteria that do not reproduce because they lack a carbon source. The system could be modified to include a carbon source for bacteria, resulting in two reproducing species and greater ecological relevance. The system has the potential for a deeper investigation of aging. Hughes et al. proposed that reproductive aging is an adaptive trait that promotes an optimal number of progeny and stabilizes population dynamics 35 . The experimental system described here establishes the foundation to test this intriguing hypothesis.

Methods
General experimental methods. All experiments were conducted at 20 °C with E. coli OP50 and the C. elegans wild-type strain N2. Eggs were isolated by bleach treating gravid adults (2 ml NaOH, 4 ml NaClO, 4 ml H 2 O) and incubated in M9 for 15-18 h on a shaker to allow L1 larvae to hatch and arrest development. Growth. Hatched larvae were cultured in 30 ml S-medium with 16, 12, 4, 2 or 0.4 mg ml -1 E. coli. Worms were imaged every 24 h (cross-sectional) with a Leica M80 microscope equipped with a camera, and images were analyzed with ImageJ and the worm-sizer plugin 36 . Worms were scored as adults when they displayed eggs and measurements were continued until the first progeny matured to adults. Worm mass was calculated using the measured volume and reported mass densities 37 .
Lifespan. For exposure to different bacteria concentrations from the L1 larval stage, hatched larvae were cultured in 96 well plates with approximately 5-10 larvae per well. Each well contained 100 µl S-medium and 4, 2, 1 or 0.5 mg ml -1 E. coli. For exposure to different bacteria concentrations from the L4 larval stage, hatched larvae were first cultured in 2 mg ml -1 E. coli for two days. L4 larvae were then washed and cultured in 96 well plates with approximately 5-10 larvae per well. Each well contained 100 µl S-medium and 2, 1, 0.5, 0.25, 0.125 or 0.6 mg ml -1 E. coli. After 48 h, 0.15 mM 5-fluorodeoxyuridine (FUDR) was added to prevent progeny development. Adults were scored as alive or dead based on movement and body tension. This method was adapted from ref. 38 .
Dauer transition to larva. To obtain dauer larvae, we cultured a population in liquid medium, starved the animals for ten days or one month, and isolated dauers by treatment with 1% SDS for 30 min (ref. 39 ); 5-10 dauers were placed in 96 well plates with 2, 1, 0.5, 0.25, 0.125, 0.06, 0.03, or 0 mg ml -1 E. coli. The transition to larvae was scored after 12 h and every 24 h thereafter by visual inspection. After 120 h, we added 4 mg ml -1 E. coli to the control with no E. coli and measured transition to larvae.
Laboratory population. The population in the laboratory was initialized with 250 larvae and 5 or 10 mg live E. coli in 5 ml of liquid S-medium 38 in a 50 ml cell culture bottle. To analyze the worm number and/or E. coli concentration, we removed 5-10% of the volume every 24 or 48 h. To maintain a constant volume and provide a source of food, we immediately added 5 or 10 mg live E. coli in 250 or 500 µl S-medium. Samples were analyzed using (1) a COPAS Biosort to count the number of worms in a 10-50 µl sample, which was used to calculate the total number of worms in the population, and (2) a spectrophotometer to measure OD600, which was converted to bacterial concentration (miligrams per mililitre) using a standard curve (Supplementary Fig. 1).  1.4.1717), using a oneway ANOVA with F = 197.3, Df = 3 and P > 0.001 followed by a Tukey post-hoc test (see Fig. 4f). All error bars show standard deviations. In lifespan assays, wells with worms were excluded if FUDR treatment failed and P0 could not be distinct from F1, or if the bacteria concentration was too dense to clearly to observe the worms. Worms were censored if wells could not be measured during a lifespan experiment due to worms sticking to plastic walls or cloudiness. Data points were excluded in the population dynamic experiments if the COPAS biosort failed. No statistical method was used to predetermine the sample size. Sample size were chosen based on standard C. elegans procedures, and usually involve 20-100 individual animals which in the experience of C. elegans genetic experiments is thorough 35,40 . Worms were randomly assigned through pipetting to different food concentrations to measure individual characteristics. The investigators were not blinded to allocation during experiments and outcome assessment.

Design of the individual-based computational simulation model wormPOP.
wormPOP is an individual-based model, implemented in Delphi Pascal vx 7. It is programmed in console mode (text only) with input in the form of a single text file and output in the form of CSV files. Source code is available at https://github. com/mitteldorf/C-elegans_pop_dynamics. The only environmental variable is the amount of food in the 5 ml of medium in the vial. Periodically, a portion of the medium is removed and replaced with new food, at times scheduled according to the program input file. When (for example) 1 ml of the medium is removed to be replaced with food, the pre-existing food is reduced by 20%, and every worm at every stage of life is exposed to a probability 0.2 of disappearing from the model. The total volume in the vial is always 5 ml. The amount of food in the vial is decreased with every worm's consumption, in every time step.
Aside from the food in the medium, there are only worms. Individual worms are characterized by the following variables: • Stage of life, with six possible values: egg, larva, dauer, adult, parlad, dead (all dead worms are removed from the model at the end of each time step and no longer tracked). • Birthday: the time step in which an egg was laid or a parlad burst to release dauers. • Time of last transition (from egg to larva, or from larva to adult and so on).
• Egg mass (stored by adults, not yet laid).
• Food available in last time step. (Note that starvation transitions depend on averaging the available food over two time steps. Each worm sees a different amount of food in each time step because worms eat sequentially. More details below.) • Time of entry into dauer (if applicable) or a notation that this worm has never entered into dauer (if it has not). This is important as the dauer option is only available to a larva once during its lifetime.
Worm behaviors in each time step are dependent on the amount of food in the environment, on the internal state and, in some cases, on chance. In each time step the worms are taken in a (different) random order, and the possibilities appropriate to its stage of life are programmed (Extended Data Fig. 1). Time is tracked as a floating point variable and each time step is divided into a number of increments equal to the number of worms alive in that time step; thus, the time of each event is tracked not as an integer count of time steps, but as the real time when that event occurred.
At the beginning of each time step, a number called appetite is computed for each worm. How much food would it eat if the current food concentration were available, without competition from other worms? These numbers are summed and each worm is allotted a pro rata portion of the available food. Food consumption for each worm is then computed as worms are taken in a random order, and the formula for food consumption for each worm is such as not to exceed that worm's portion. This helps to mitigate the arbitrary effect of random ordering.
Only larvae and adults eat food. As laboratory measurements of food consumption are impractical, appetites are inferred from energy requirements. For larvae, the appetite is the sum of the energy required for metabolism plus the biomass needed for growth, divided by an efficiency constant. Growth is a function of current mass which is derived from an empirical curve that has been fitted to a hyperbolic tangent. For adults, appetite is the sum of these same terms plus the biomass needed for reproduction, divided by the same efficiency constant. Exact algorithms for appetite are shown in Supplementary Table 17.
Eggs. Eggs are uniform in size (each 65 ng). All eggs hatch after (at least) 15 h = five time steps, after which time they have become larvae of 65 ng. If an egg is laid late in one time step, and its random order comes up early in the ordering five time steps later, it could take almost six time steps before the hatching event.
Larvae. Larvae consume food according to a semi-empirical schedule, which depends on their size, the concentration of food in the medium and the other worms competing for that same food. Food consumption may be limited either by the size of the larva or by competition for available food. The amount of food consumed in a 3 h time step is computed according to a formula that takes the two limits into account, and is always less than the smallest of the two (the exact algorithm is shown in Supplementary Table 17). Biomass consumed by a larva in a given time step is divided among (1) growth, (2) inefficiencies in conversion of food biomass to growth and (3) energy consumed by metabolism. If food is below a threshold averaged over two consecutive time steps and if the larva is within a range (0.6 times the canonical dauer mass < m < two times the canonical dauer mass) then the larva becomes a dauer. The larva starves to death if it is smaller or larger than the specified mass range. If the larva does not dauer or starve, it continues to grow at a rate determined by ingested food. The larva becomes an adult if its mass exceeds a threshold value of 800 ng between time steps 20 and 28, but dies of starvation if it does not achieve this mass by 28 time steps.
Dauers. Dauers consume no food and lie dormant. They will turn back to larvae and resume growth if they detect sufficient food. The probability per time step for a dauer resuming life as a larva is proportional to the square root of the food concentration times a constant, fixed by experiment at 3.24 × 10 −5 , independent of how long it has been a dauer. If a dauer resumes life as a larva, it picks up exactly where it left off, with the same mass and the same (constructive) age. Larvae that have once been dauers cannot take this path a second time. In practice, this means that if food availability again becomes low, they probably will not grow sufficiently to graduate to adulthood, and so they will starve.
Adults. Adults ingest food according to a formula governed by the same two limits described for larvae above. Adults continue to grow. The food they eat is partitioned between metabolism, growth and egg production, in accordance with measured curves for both growth and fertility. Food consumption slows with age because egg production declines with age. As determined by experiment, egg production rises rapidly to a peak and then declines. The model fertility curve is matched to the experimental curves for five different food levels, and our model of food consumption is inferred from growth and fertility ( Supplementary Fig. 18). Death from old age is controlled by a Gompertz curve, which is calibrated to laboratory results (independent of food and fertility). Formulas for food consumption and egg production are shown in Supplementary Table 17. Eggs are rounded down to an integer before appearing as a reproductive event. The fraction is stored as egg mass and carried over to the next time step. Logistic growth continues with an asymptotic maximum size. When total food falls below a threshold of 2,500 ng for two successive time steps, an adult transitions to a parlad.
Parlad. The parlad is dead and does not ingest bacteria, but is presumed to be consumed by the growing larvae within. Worms hatched from a parlad start life as dauers with canonical dauer mass, fixed as 228 ng, which is the geometric mean between egg mass and minimum adult mass. After ten time steps = 30 h (independent of external conditions), the parlad bursts and releases a number of dauers into the population. The number is determined by reducing the parlad's biomass by an efficiency factor of two-thirds, then dividing by mass of one dauer.
Reporting Summary. Further information on research design is available in the Nature Research Reporting Summary linked to this article.

Data availability
The settings for the simulation experiments are described in Supplementary  Section 4 and Supplementary Tables 18-20. See the Methods for details on the experimental laboratory data.

Articles
NaTUrE COmpUTaTIONal SCIENCE Extended Data Fig. 1 | Diagram of wormpop, an individual-based computational simulation model. Worms exist in one of five nodes that are displayed as ovals and labeled egg, larva, adult, parlad and dauer. Diamond-shaped boxes indicate yes/no decisions. "culled?" indicates a stochastic decision whether an animal dies from culling or not."Die of old age?" indicates a stochastic decision whether an adult animal dies from old age or not. "too long a dauer" indicates a stochastic decision whether a dauer stage animal dies from starvation or not. Other decisions are deterministic and depend on the number of time steps an animal has been in a stage, the mass of the animal in ng, or the amount of bacterial food ingested in a time step. rectangular boxes indicate (1) bacterial ingestion, which depends on the size of the animal, the concentration of bacteria, and the appetite of other worms. Bacterial ingestion is somewhat stochastic, since it is influenced by other worms, and (2) growth and egg production.