In this study, we independently examine effects of three ecological processes on the competition between aging and non-aging individuals: (i) absolute and relative fecundity of the aging vs. non-aging individuals, (ii) individuals’ mating preferences for the same or opposite phenotype, and (iii) various impacts of parasitism. In addition, we run the corresponding simulation scenarios under two types of sexual reproduction, in populations formed by simultaneous hermaphrodites or by genuine males and females.

We begin with a population composed of N simultaneous hermaphrodites of two phenotypes: aging and non-aging. Our model is an agent-based simulation model that allows phenotypes of all individuals to be modelled explicitly and their competitive dynamics to be followed over time. Time is discrete, with the time step corresponding to the age increment of 1 and with all relevant rates and probabilities defined on a per time step basis. Simulations are run for T time steps and each scenario is replicated a given number of times. All model parameters and variables are summarized in Table 1. Moreover, a model flowchart is provided in Fig. 1 and explained in detail below in this section. The model is then modified to include populations composed of males and females. We note that our models are modifications of the classical models of the evolution of sexual reproduction29,30,31,32 which moreover take into account individual age and aging and non-aging phenotypes.

Table 1 Default parameter and variable settings used in the hermaphrodite model. Full size table

Figure 1 Flowchart of our simulation model. For details see the Methods section. Full size image

Aging and non-aging phenotypes

Aging and non-aging phenotypes differ according to demographic rates. Individuals are characterized by age a. We define the probability that an aging individual of age a dies during a time step as

$$d(a)={d}_{0}+(1-{d}_{0})\frac{(a-1)}{(a-1)+{k}_{d}}.$$ (1)

This function increases from 0 < d 0 < 1 for a = 1 to 1 as a grows large. Similarly, we define the fecundity of an aging individual as

$$b(a)=\frac{{b}_{0}}{1+{k}_{b}(a-1)}.$$ (2)

Hence, the fecundity b(a) declines with age from b 0 > 0 for a = 1 to 0 as a grows large. Mortality of newborns in their first year of life is included in the parameter b 0 and equations (1) and (2) are thus applicable to individuals of age a > 0. Non-aging individuals die during a time step with an age-independent probability δ and produces β offspring in each time step, irrespective of age.

Genetics

In addition to age, each individual is characterized by two genome portions. The phenotype genome, composed of n g loci, serves to determine whether a newborn individual is of the aging or non-aging phenotype (see below). The role of the immunity genome, composed of n i loci, is to check for an individual’s resistance to a parasitic infection (see below). Both genome portions are assumed haploid. Also, individuals are characterized as susceptible or infected (all are initially susceptible, and all are born susceptible).

Any phenotype genome locus may feature one of two allele types, with 0 and 1 denoting alleles contributing to the aging and non-aging phenotype, respectively. There are many viable options how to determine the aging and non-aging phenotype from a genome. However, it is important to realize that there are several interconnected causes of aging33,34 including DNA double-strand breaks (DSBs)35,36, Telomere attrition37, decreased proteasomal activity38 and others39. Therefore, any non-aging organism has to be equipped with several fine-tuned molecular pathways repairing damage from both intrinsic and extrinsic sources. Furthermore, it is likely that disturbance of any of these pathways would result in an aging phenotype. In accordance with this line of reasoning, we assume in our model that a number of phenotype loci must be in harmony to produce a non-aging phenotype; as a result, we have opted for adopting a threshold rule. In particular, two conditions must be met for an individual to be considered non-aging: (i) the specific proportion p f of phenotype loci (e.g. the first p f n g loci) must contain the allele 1, and (ii) the proportion of all phenotype loci that harbour the type 1 allele must exceed a given threshold value p g > p f .

In the immunity genome, alleles denoted as 0, 1, …, n a − 1 represent n a alternative variants of the immunity allele. The phenotype and immunity genomes of each offspring are determined following the free recombination of their parents’ genomes and a random choice of one of two resulting genomes. No mutations are assumed to occur on the phenotype and immunity genomes. For the phenotype genome, alleles at all loci of aging individuals are initially of type 0 and alleles at all loci of non-aging individuals are initially of type 1. Individuals are initialized with an allele randomly selected for each locus in the immunity genome.

Parasites

For scenarios examining effects of parasites on the competition between aging and non-aging phenotypes, we consider a parasite population of a fixed size P. Individual parasites are characterized by the haploid antigen genome, with n a alleles denoted as 0, 1, …, n a − 1 that are initially randomly distributed across the n i loci. Genetic variation at the antigen loci is maintained by setting the per locus mutation rate to μ a per parasite generation. When a mutation occurs at a locus, the existing allele is replaced by an allele randomly chosen from the n a alleles 0, 1, …, n a − 1. Parasites affect their hosts either by reducing their fecundity by a factor E 1 or increasing their mortality via imposing an extra probability E 2 of dying during the time step.

Since parasite life cycles are commonly faster than those of their hosts, we assume there are n p non-overlapping parasite generations per time step. During each parasite generation, hosts are drawn sequentially in a random order and each is exposed to a randomly selected parasite. We use a matching alleles model of infection genetics29,30,31,32,40,41 to establish whether the exposed host is actually infected: if the immunity genome of the host and the antigen genome of the parasite match exactly at all loci, the parasite establishes infection in the host, otherwise it dies. Hosts in which infection is established are marked as infected. At the end of each parasite generation, P new parasites appear in the environment by drawing individuals at random (with replacement) from among the successful parasites. Following introduction of a new parasite, its antigen alleles may mutate to any of the n a alleles 0, 1, …, n a − 1, each with the probability μ a .

Host demography

The parasitic phase is followed by host demography. First, individuals mate and reproduce. There is a preference p c of aging individuals for aging mates and of non-aging individuals for non-aging mates, but otherwise mates are chosen randomly. We note that p c = 0.5 indicates no mating preference and thus a random choice of mates by all host individuals regardless of phenotype. Upon mating, a Poisson-distributed number of offspring are produced, with mean b(a) and β for the aging and non-aging individuals, respectively. This number is reduced by the factor 1 − E 1 if the reproducing host is infected. The offspring are born susceptible, with age 1 (as we emphasize earlier, fecundity already accounts for the first-year mortality), and the phenotype genome of each offspring are determined (see above). The phenotype (aging or non-aging) of each offspring is then determined using the above-described threshold rule.

Background mortality of other than the newborn hosts then occurs: the aging and non-aging individuals die with probability d(a) and δ, respectively. This is followed by the extra mortality probability E 2 of the infected hosts. The age of all surviving individuals is augmented by 1 and we record the numbers of aging and non-aging individuals. Eventually, a maximum of N individuals is randomly selected to form the population appearing at the beginning of the next time step.

Two-sex model version

To adapt our model for males and females, some of its components are replaced and a few new elements are introduced. Aside from these modifications, the principles of the two-sex model mirror those of the above hermaphrodite model. First, we replace hermaphrodites with females and males. Therefore, females select their mating partners from among males and only females produce offspring. Since simultaneous hermaphrodites need to allocate some amount of resources to both male and female functions, then – relative to females – their fecundity is commonly assumed to be reduced, as much as by one half42. Therefore, to fairly compare simulations of the two model versions, we assume female fecundity to be twice that of hermaphrodites. Both females and males are assumed to have identical mortality patterns, depending on whether they are aging or non-aging.