Predation and the Phasing of Sleep: An Evolutionary Individual-based Model

: All mammals thus far studied sleep, yet important questions remain concerning the ecological factors that influence sleep patterns. Here, we developed an evolutionary individual-based model to investigate the effect of predation pressure on prey sleep. We investigated three ecological conditions, including one that assumed a dynamic interaction between predator and prey behaviour. In condition 1, we found that monophasic predators (i.e., with one sleep bout per 24 hours) select for monophasic prey that sleep perfectly out of phase with predators. In condition 2, predators were monophasic but the safety of prey varied as a function of their activity (sleeping versus awake). In this condition, the prey adjusted their sleeping behaviour to lower the risk of predation. Finally, in condition 3, we modelled a more dynamic interaction between predator and prey, with predator activity dependent on prey activity in the previous hour. In this scenario, the prey adjusted their behaviour relative to one another, resulting in either greater or lesser synchrony in prey as a function of predator searching behaviour. Collectively, our model demonstrates that predator behaviour can have a strong influence on prey sleep patterns, including whether prey are monophasic or polyphasic (i.e., with many sleep bouts per 24 hours). The model further suggests that the timing of sleep relative to predator behaviour may depend strongly on how other potential prey partition the activity period.

All mammals thus far studied sleep, but the reasons for sleep remain shrouded in mystery (McNamara et al. 2008(McNamara et al. , 2009;;Siegel 2008;Cirelli & Tononi 2008).Why would an animal spend time sleeping when this entails sacrificing opportunities to find mates, resources, or invest in offspring?The costs of sleep might also have more immediate negative effects on survival, for example when a sleeping animal is more at risk of predation (Lima et al. 2005;Lima & Rattenborg 2007).Among mammals, the risk of predation at the sleep site varies remarkably.For example, most ungulates on the African savanna are probably too large to find safe sleep sites, while meerkats in the same area avoid predation by sleeping in burrows underground.
To offset the costs of sleep, it seems likely that sleep provides substantial benefits (see also Cirelli & Tononi 2008).A variety of benefits have been proposed for sleep, including benefits related to memory consolidation, energy conservation and immune function (Meddis 1983;Zepelin et al. 1989;Berger & Phillips 1995;Stickgold 2005;Lesku et al. 2006;Capellini et al. 2009;Preston et al. 2009).One recent comparative study, for example, found that the number of white blood cells covaries positively with sleep durations across species (Preston et al. 2009), while other studies found that sleep characteristics covary with aspects of brain size (Lesku et al. 2006;Capellini et al. 2009).Many recent phylogenetic comparative studies have focused on sleep duration, including the duration of rapid eye movement (REM) and non-rapid eye movement (NREM) sleep (e.g., Lesku et al. 2006;Capellini et al. 2008a).Other fundamental questions concern the phasing of sleep throughout the 24-hour cycle (Tobler 1989;Ball 1992).In one compilation of data on sleep phases, for example, anthropoid primate species were found to exhibit monophasic sleep, in which they typically concentrate the majority of their sleep time into a single sleep bout per 24 hours, while the carnivores were polyphasic sleepers with many sleep bouts (Capellini et al. 2008b).
Based on comparative studies of mammalian sleep durations, it is also clear that ecological factors constrain the duration of sleep.For example, Capellini et al. (2008a) found that sleep durations are shortened when animals have high metabolic rates for their body size, consistent with foraging constraints that limit the time available for sleep.Capellini et al. (2008a) also found that when animals are more exposed to predation at sleep sites, their sleep durations decline (see also Allison & Cicchetti 1976;Lesku et al. 2006).In another study, these authors used phylogenetic methods to investigate the factors that influence the phasing of sleep (Capellini et al. 2008b; see also Tobler 1989;Ball 1992).They again found evidence for some predicted ecological constraints, for example that polyphasic sleep is associated with small body size, which may reflect relatively higher metabolic rate and the need to shorten the time between foraging bouts.Capellini et al. (2008b) also predicted that polyphasic sleep would covary positively with predation pressure, but they found no support for this prediction.
Sleep also can be investigated using modelling approaches (Mirolli & Parisi 2003;Beckman et al. 2007;Lima & Rattenborg 2007;Acerbi et al. 2008, Phillips et al. 2010).In this paper we describe a simulation model that builds on our previous study of ecological constraints and sleep by including predation risk (Acerbi et al. 2008).In the previous model, we investigated how the spatial distribution and the relative amount of food and sleep sites impacted the phasing of sleep and sleep durations.We found that increased travel distance between sleep and food sites favoured monophasic sleep, an effect that was driven by the costs of locating resources when switching between sleep and foraging.Similarly, when the rate at which food patches deplete in the model was increased, sleep durations declined.This likely reflects selection on individuals to invest more of their limited time on foraging when food resources are more difficult to obtain.Models can have different purposes.Here, our goal is to sharpen our intuition about the role of predation in the timing of sleep, while also using the model to search for new insights and predictions for future tests.Our model is grounded in tradeoffs among fitness-enhancing tasks, one of which involves the benefits of sleep, and in predator and prey behaviour over the daily cycle as a dynamic, competitive game (e.g., Kotler et al. 2002;Lima et al. 2005).The model we developed is individual based, meaning that we simulate local interactions at the level of individual agents (Grimm & Railsback 2005), and also evolutionary, in that the agents use evolutionary algorithms to solve ecological challenges that we designed.More specifically, in our evolutionary individual based model, some characteristics of individuals are encoded in free parameters (e.g., an artificial genome) and optimized using evolutionary computation techniques involving genetic algorithms (Holland 1975).Genetic algorithms are a process inspired by natural selection in which the individuals who perform better on a task contribute more than other individuals to the next generation, and their "offspring" inherit their artificial genome with a mutation rate.In this way, modellers can identify the range of values that are selected by the evolutionary algorithm under different selective pressures.
Using this framework, we generated situations in which evolutionary principles are applied to solve different ecological challenges.We then used the output from our simulated population to better understand the complexities of natural systems.Our investigation builds on suggestions that predation can influence the timing of prey sleep throughout the 24-hour cycle (Capellini et al. 2008a), possibly in relation to the availability of alternative prey for predators and predator search behaviour (e.g.Lima et al. 2005).Based on comparative studies in mammals, it appears that predation influences sleep patterns, at least in terms of sleep durations (Allison and Cicchetti 1976;Berger & Phillips 1995;Lesku et al. 2006;Capellini et al. 2008a).Evidence also exists for changes in prey sleep patterns when individuals are exposed to predators (e.g., Lesku et al. 2008).These changes can be striking and linked experimentally to predation risk, for example in a population of Norway rats (Rattus norvegicus) that shifted from nocturnal to diurnal activity in the presence of a nocturnal predator (Fenn and MacDonald 1985).Examples such as these are probably only scratching the surface of more intricate interactions between predator and prey.Modelling provides an important, but under-utilized, approach to elucidating the links between predation risk and sleep (Lima and Rattenborg 2007).Here, we envision a generalist predator, such that evolution of prey behaviour does not select for changes in predator behavior (i.e., only the prey evolves).
We structured our study around three questions, which relate directly to the three conditions that we simulated: (1) Monophasic predators: Under what conditions does the circadian rhythm of predators influence circadian rhythms in prey?For example, do monophasic, nocturnal predators select for monophasic, diurnal prey?
(2) Relative safety at sleep sites: How does safety at sleep sites influence sleep patterns?If safety is more of a probabilistic than absolute measure, does this alter sleeping patterns, possibly in interaction with other ecological factors such as foraging constraints?
(3) Predator searching based on combined prey activity: Lastly, we investigated how a predator searching behaviour influences patterns of sleep in a pair of independently foraging prey.
Differently from previous conditions, in this case the predator's activity is a function of the behaviour of a group of individuals (two prey) and in particular is a function of whether they were awake in the previous hour.Does dynamic predator searching impact prey sleep patterns and create synchronous or asynchronous activity in the prey?

METHODS
We follow the ODD protocol identified by Grimm et al. (2006) to describe our model.

Purpose
The purpose of the model is to investigate how sleep characteristics, such as the total duration of sleep and the phasing of sleep-wake cycles (number of sleep bouts) are influenced by temporal variation in predation risk.In particular, we studied three different conditions of predation risk that correspond to the three questions raised in the Introduction.Under condition 1, predators were active in fixed parts of the day, and prey were safe from predation when sleeping at a sleep site.
Under condition 2, predators were again active in fixed parts of the day, but the risk of predation was a quantitative function of whether prey were sleeping or awake (see below).Lastly, under condition 3, the timing of predator activity was flexibly dependent on the activity of two prey in the previous hour, namely on whether they were both sleeping, both awake, or one was sleeping and one was awake.In this last condition, it was possible to assess how predation pressure influences the relative timing of sleep among prey (i.e., synchronous or asynchronous sleep).

State variables and scales
The simulation was run on a square lattice of 40 x 40 cells with a hard boundary (see Figure 1s in the Supplementary Materials).Habitat types were mutually exclusive, with each cell in the habitat matrix identified as either a sleep patch (i.e., a cell of the lattice in which prey can sleep), a food patch (i.e., a cell of the lattice in which prey can eat), or nothing.The number of sleep and food patches was fixed, even if their specific arrangement was subject to stochasticity and varied in each run of the simulation.
The highest hierarchical level in our model was the population.Specifically, each prey was part of a population of 100 non-interacting individuals on which the evolutionary algorithm acted.
The central level of description in our model was the individual prey.Each prey had a location in the landscape.Prey also had two energy levels that were each adjusted positively when eating and sleeping occurred.One energy level concerned "sleep energy" and the other concerned "food energy."Lastly, prey had a circadian rhythm that was determined by 24 "genes" (one for each hour of the day) that were subjected to natural selection by means of a genetic algorithm.Each gene could take one of two possible states that determined the actions of prey: sleep (or search for a sleep site), or eat (or search for a food site; see below).
The model also included a fixed number of predators.Predator activity varied depending on the three experimental conditions and is described in detail in the section "Submodels."The effect of varying the number of predators is analyzed in the Supplementary Materials.
The model was run in discrete time steps.We identify the following terms in this context: minute, hour, day, generation and simulation run.Prey and predators operated on time steps of one minute.An hour (lasting 60 minutes, i.e. 60 time steps) was used as the unit in the circadian rhythm of individuals, with 24 genes -one for each hour of a day -that determined the action of the individuals at any given hour in the 24-hour cycle.A generation encompassed the life of a prey and lasted for 7 days.The prey population was held constant at 100 in each generation, and a simulation run covered 100 generations.

Process overview and scheduling
After initializing the landscape with food sites, sleep sites and predators, the simulation proceeded at each time step by inspecting the appropriate gene (for a given hour) on a prey's genome.
Depending on what the gene specified, the prey stayed in the cell in which it was located or it moved and sought food or a place to sleep based on its circadian rhythm.After the prey's states were updated, the states of predators were updated (see below), and, from that, subsequent effects on prey behaviour took place (i.e., if a predator encounter occurred).Finally, the state of the environment was updated.Food patch depletion was calculated and, if necessary, exhausted food patches were removed and new food patches were created in a random location of the lattice (see "Submodels").At the end of the 7-day generation, reproduction took place, as described below.

Design concepts
Fitness: Sleep and food energy were translated into separate fitness measures.Relationships between energy and fitness were nonlinear and calculated explicitly, with fitness bounded between 0.0 and 1.0 using a sigmoid function (see Figure 2s in the Supplementary Material): where f = fitness (see Acerbi et al. 2008).The overall fitness of prey was calculated by multiplying the two fitness measures so that: The reasoning for using multiplicative fitness is that if a prey achieved zero energy for either food or sleep, its fitness was set to zero.We also investigated the use of additive fitness, and this produced qualitatively similar results to those presented here.
A successful predation event occurred when predator and prey were on the same cell of the lattice.Predation did not result in removal of the individual.Instead, predation "paralyzed" the prey for 60 minutes, thus preventing it from gaining fitness in that period (including searching for a food or sleep site if the prey was not currently on a site, see below).Thus, predation affected prey fitness by reducing the time available to acquire food or sleep energy.This paralysis has similarities to predation pressure in the real world, in which increased proximity to predators causes animals to shift from one activity to a state of vigilance, thus causing them to forego the benefits of the previous activity.By comparison, removal of prey following a predator attack would introduce highly stochastic effects, potentially even resulting in extinction of the prey population at early stages of simulation runs, since the evolutionary algorithm requires multiple generations to optimize prey behaviour.The effect of varying the number of minutes of paralysis is analyzed in the Supplementary Materials.
Sensing: Prey could only sense the cell in which they were currently located and could not make decisions about moving to neighboring cells based on the presence of food sites, sleep sites or predators.Predators also were able to sense prey in their current cell, but not in other cells in the lattice.
Observation: For all conditions, we examined output from the last generation of each experiment, focusing on the proportion of monophasic sleepers in the population, the average number of encounters with predators, the average number of minutes of sleep in a day (i.e., based on actual behaviour rather than the genes coding behaviour, as sleep sites may not be found each time that a gene specifies sleep).Prey were defined as sleeping when in a sleep site and the genome indicates sleep, and defined as awake when feeding or moving through the lattice looking for a food patch or a sleep site.Prey that exhibited only one sleep bout during a 24-hour period (including a single sleep bout that spans the end of one day and beginning of the next day) were considered monophasic sleepers.We also recorded the structure of the genome of the prey with the highest fitness in each run.For condition 3, in which the behaviour of predators depended on the behaviour of two prey in the previous hour, we also quantified the degree of synchrony among prey in their sleep patterns.Synchrony between prey was indicated by the final value of an additional parameter (Sync) on which the evolutionary algorithm acted (see "Submodels").
To ensure that the simulation reached a stable equilibrium, we required that the average fitness of the population exceeded 0.9 for all simulation runs that were analyzed, which indicates that the prey were able to solve the ecological task.

Initialization
The habitat matrix was formed by placing 40 food and 40 sleep patches in random positions on the matrix (see Figure 1s Supplementary Materials).The prey and 40 predators were randomly located on cells in the matrix.Each prey was tested in an independent lattice with the same set of initializing parameters, but with stochastic differences in the distribution of food sites, sleep sites, and predators.Energy levels for the agent were set to zero, which corresponds to a fitness of 0.25 (see Equations 1 and 2).The starting conditions for the genome were randomly selected from among the two states (sleep genes and feeding genes), resulting in an expected distribution of twelve sleep genes and twelve feeding genes (actual numbers varied stochastically around these expected values).

Submodels
Movement: Prey moved through the lattice in a correlated random walk (Renshaw & Henderson 1981) with movement in increments of 45° (i.e., along flat sides or corners of cells on the matrix).
Hence, their probability of major changes of direction in a single step was lower than in a pure random walk.The correlated random walk model enabled individuals to better explore the lattice when searching for sleep and food patches.Specifically, at each time step, prey modified their current orientation with a random value between -15° and +15°, and they changed their actual direction in the lattice in the 45° increments when surpassing 22.5° thresholds.The lattice had a reflective boundary, such that when a prey hit a boundary, its direction reversed.For example, a prey moving at a 90° orientation would automatically change its orientation to 270° after hitting an edge of the lattice.
Prey remained in the same cell during a time step only when they located a food or sleep patch corresponding to their genetic coding for a given hour of the day (sleep or eat).If the gene specified "sleep," the prey moved until it located a sleep site.It then remained at the sleep site until the genome specified another action.If the gene specified "eat," the prey moved until it located a food site.It then remained at the food site until either the genome specified a new action or until the food patch was depleted.
Predators moved through the lattice in a random walk, such that they moved to one of the eight adjacent cells (i.e., flat sides and corners) with equal probability, and with a reflective boundary as described for the prey.
Predator's behaviour and predation: As noted above, predation occurred when a predator and a prey were located in the same cell, and we modeled the behavior of a generalist predator.The probability of predation varied according to the conditions that were simulated, as described below.
When a successful predation event occurred, the prey stopped its activity for 60 minutes, while the predator continued its normal activity.During this period the prey did not gain any fitness while its energy continued to decline.The specific details of predation risk (probability) were as follows.
Condition 1: Predators were active in the first twelve hours of each day and not active otherwise.Prey were completely safe when sleeping: when a predator was active, if it happened to move to a cell in which a prey was sleeping, the prey did not experience predation.
Condition 2: Predators were active in the first twelve hours of the day and not active otherwise.The variable detection rate (d) controlled the probability that, when a predator happened to move into a cell occupied by a prey, it caused paralysis in the prey.This probability depended on the state (sleeping versus awake) of the prey.In particular, if d was equal to zero, prey were safe when sleeping (i.e., if they encountered a predator they had 0% probability to be paralyzed when sleeping and 100% if they were awake).If d = 1, prey were perfectly safe when awake (i.e., if they encountered a predator they had 100% probability to be paralyzed when sleeping and 0% if they were awake).Values between 0 and 1 reflected a more probabilistic measure of predation.If, for example, d = 0.5, prey had the same probability to experience predation (50%) when sleeping and when awake.Thus our use of d assumes that agents experience a tradeoff in safety when asleep versus awake.We ran 100 simulations in which the value of d varied from 0.0 to 1.0, in units of 0.01.
Condition 3: To reflect the possibility for coordinated activity among prey, we paired each of the 100 individuals that constituted the population with a partner.The evolutionary algorithm acted on a single continuous parameter (Sync) that determined the probability that each gene of the partner was equal to each gene of the individual.Therefore, high values of Sync represented pairs that were highly synchronized in their sleep patterns, while low values of Sync represented pairs not synchronized.At the beginning of each run of the simulation, the value of Sync was randomly selected from an uniform distribution ranging from 0 to 1. Mutations occurred at a rate of 5%, and when they occurred the value of the parameter was randomly reinitialized (simulations in which mutations produced an increase or decrease in the Sync parameter gave qualitatively similar results).
To assess in the simplest way the effect of coordinated activity among prey we assumed that the two prey lived in independent and not communicating lattices, with two different sets of predators.However their behaviour , combined, determined the predators' behaviour in both lattices.This situation is analogous to a group of prey that can individually modify their behavior to respond to predation: the fact that prey live in independent lattices and face two independent groups of predators (but with the same behavior) was necessary to make the results of Condition 3 comparable with the other conditions.
More specifically, the behaviour of the predator depended on the activity of the prey in the previous hour, and we tested two specific sub-conditions.At each subsequent hour predators were active if, in the previous hour, at least one prey was active (sub-condition a), or both prey were active (sub-condition b).If a predator was active and happened to move to a cell occupied by a prey, it "caught" it independently of the prey's state (sleep or awake); in other words, unlike the other conditions, the prey were not safe while sleeping or awake.We assumed that predators were active in the first hour at the beginning of the simulation run.
Energy dynamics: Prey acquired sleep energy upon finding a sleep site.In the same way, food energy was acquired when a prey located a food site.Both sleep and food energy declined when searching for food patches, sleep sites, and for 60 minutes after experiencing predation.In all simulations presented here, the rate of loss was 1/3 the rate of gain when prey were on a food or sleep site, as based on initial experiments to determine a level that assured that the populations were able to find adaptive solutions in most of the experimental conditions (see Acerbi et al. 2008).

Food depletion:
The time until a food patch disappeared was held constant across simulations at 60 time steps; in other words, a food patch depleted after a prey foraged in it for one hour.Once the energy for a food patch was depleted, the patch disappeared, and another patch was generated at a random, unfilled location in the lattice, where unfilled means that the cell had neither a food patch nor a sleep patch.Unlike food patches, sleep sites did not disappear; thus, prey were not required to move to a new sleep site to continue obtaining the benefits of sleep.
Reproduction: At the end of each generation, the 20 prey with the highest total fitness levels produced five offspring each.The remaining 80 individuals in each generation did not reproduce, thus maintaining a constant population size of 100 individuals from one generation to the next.
Among the genomes that are passed to the next generation, mutations occurred at a rate of 5% per gene.For Condition 3, the 20 prey with highest fitness additionally passed to the next generation the value of Sync, with a mutation rate of 5% (see "Submodels") -table 1 about here -

Condition 1: Monophasic predators
In condition 1, predators were active in the first twelve hours of each day and prey were completely safe when sleeping.We compared 50 simulation runs in condition 1 with a control condition of 50 simulation runs with the same ecological conditions, but without predation risk.Prey were unable to find a strategy that completely eliminated encounters with predators (average number of predators encounters for each prey individual: 16.26 ± 1.14).We found strong evidence that monophasic activity in the predators favoured the evolution of monophasic activity in the prey (Figure 1).Specifically, the average proportion of monophasic prey in the experimental condition was 0.75 ± 0.17, while the average proportion of monophasic prey in the control condition was 0.35 ± 0.22 (Wilcoxon test: N = 50, P < 0.0001).Compared to the control condition, in which predators were absent (Figure 2, left), under predation pressure we found strong selection for prey to sleep when predators were active and to feed when predators were sleeping (Figure 2, right).
-figures 1 and 2 about here -

Condition 2: Monophasic predators with variable predation risk
In condition 2, predators were again active only in the first twelve hours of each day, but the probability of predation was a function of the state of the prey (sleeping versus awake), as measured by d.Values of d less than 0.5 reflected a situation in which prey were relatively safer when sleeping, and values of d greater than 0.5 reflected that prey were relatively safer when awake.
From simulations in which we systematically varied d, we found that predation influences when prey sleep, and also the amount of sleep that they can afford during a day.When predators were active, i.e. in the first twelve hours of the day, prey tended to sleep if the value of d was roughly less than 0.5 and to be awake otherwise (see Figure 3).This effect was clearly visible for extreme values (close to 0.0 and to 1.0) while in the middle (close to d = 0.5) patterns of sleep were more random.
-figure 3 about here -Figure 3 also revealed that prey spent more time sleeping when d < 0.5; when they were "safer when awake" (i.e., d > 0.5), they invested more of their time in foraging.We investigated this effect further by examining the control condition without predators, which allowed us to estimate the optimal duration of sleep based on only the distribution of food and sleep sites.This optimal duration of sleep was 638 minutes (horizontal line in Figure 4).Under predation risk, we found that prey slept more than this optimal value when they were safer when sleeping (i.e.d < 0.5), and less than this optimal value when they were safer when awake (d > 0.5, Figure 4).However, this effect was not found when prey were perfectly safe when sleeping or awake (d = 0 or d = 1), or when the probability of predator attack was independent of prey activity (d = 0.5).Thus, our model indicates that predation risk and relative safety can have substantial effects on other fitness-enhancing activities.
-figure 4 about here - The presence of monophasic predators tended, as in condition 1, to select for monophasic prey.However, we again found asymmetries in model output depending on whether prey were safer when sleeping or awake: the tendency toward monophasicity was more prominent when prey were safer when sleeping, as revealed by a negative correlation between detection rate and proportion of monophasic prey in the simulation (r s = -0.46,N = 100, P < 0.0001, Figure 5).
Moreover, we observed fewer predator encounters when prey were safe when awake, as compared to being safe when sleeping (Figure 6).This result, together with the asymmetry in the tendency of monophasic prey, appears to reflect underlying foraging constraints, with prey taking greater risks in gaining food energy when d < 0.5, as compared to d > 0.5, where it was easier for the prey to gain both food and sleep energy while predators were asleep (see "Discussion" below).
-figures 5 and 6 about here -

Condition 3: Predator searching based on prey activity
In the last condition, the behaviour of predators depended on the behaviour of two prey in the previous hour.Results revealed that this dependence strongly influenced the synchrony of the prey in their activities (Figure 7).When predators were active if at least one prey was active (subcondition a), the final average value of the Sync was high, indicating prey highly synchronized in their sleep pattern.This effect occurred because periods of synchronous sleep in the prey in one hour caused predators to sleep in the next hour, with the prey then safe for the next hour to forage while the predators slept.
By contrast, when predators were active only when both prey were active in the previous hour (sub-condition b), prey tended to sleep asynchronously.In this way, prey maximized their activity period by inducing greater inactivity in the predators.
-Figure 7 about here -Prey synchrony has a direct effect as an anti-predator strategy as can be seen in the relationship between the final average value of Sync and the average number of predator encounters for each run of the two sub-conditions (Figure 8).In sub-condition a (Figure 8, left), where is important for the prey to act synchronously, we found a significant negative correlation between the number of predator encounters and the prey synchrony (r s = -0.84N = 50, P < 0.001).
Conversely, in sub-condition b (Figure 8, right) the correlation was positive (r s = 0.61, N = 50, P < 0.001), thus showing that less synchronized prey are relatively safer.

DISCUSSION
Our simulations provide new insights to how predator behaviour might impact prey sleep characteristics (see also Lima et al. 2005;Lima and Rattenborg 2007).We studied three different scenarios of predation pressure that presented different ecological challenges for the agents.To quickly recap these conditions and put the results into biological context, in condition 1 predators exhibited fixed monophasic behaviour and animals at sleep sites were assumed to be perfectly safe from the risk of predation.As expected, this safety made it advantageous for prey to behave asynchronously with respect to predators, namely to sleep when predators were active and to forage when they were inactive (e.g., Fenn and MacDonald 1985).From this condition we conclude that monophasic predators favor monophasic activity in the prey.
In condition 2, predators had the same fixed 12-hour activity behaviour but the safety of the sleep site varied from a condition of perfect safety (d = 0, analogous to condition 1) to a condition of extreme risk (d = 1).Prey adapted their circadian rhythm to the relative safety of sleep sites and predator activity, tending to sleep when predators were active when sleep sites were probabilistically safe (d < 0.5), or to be active at the same time as predators when sleeping was more dangerous then being awake (d > 0.5).Variable predation risk also impacted the quantity of sleep.If prey were relatively safer when sleeping, they tended to sleep more at times when predators were active and to concentrate their foraging activity in the remaining twelve hours of the day, resulting in less foraging.When they were safer when awake, they shifted their activity to include a greater proportion of foraging each day.
Similar to condition 1, the fact that predators present a monophasic sleep pattern generally favored monophasic sleep patterns in prey, independently of the relative safety of sleep places (of course, as noted above, the timing of the single phase of sleep depended on the safety of sleep places).Under the ecological conditions simulated here, we also discovered an asymmetry between low and high values of the detection rate.Specifically, safety at the sleep site increased the tendency for the prey to exhibit a monophasic sleep pattern and to spend more time sleeping.We also found an asymmetry in predator encounters, with greater safety obtained when prey were safe during foraging (d > 0.5).Thus, under similar conditions in the wild, greater safety at the sleep site could lead, paradoxically, to greater predation risk.
What drives this asymmetry in behaviour relative to d?At least two factors are likely to be involved.First, a basic asymmetry between sleeping and eating activities is related to the fact that food patches deplete with use while sleep sites do not.During feeding, the depletion of food patches forces the prey to move from one patch to search for a new patch.The costs associated with switching activity makes feeding a more time consuming activity than sleeping (see Acerbi et al. 2008) as seen in the control condition without predators, which indicated that the underlying ecological conditions favoured approximately 11 hours of sleep and 13 hours of foraging.For this reason, in the condition "safe when sleeping" (d < 0.5), prey experience strong selection to sleep for the entire 12 hours when predators are active and to forage the rest of the time.With the condition "safe when awake" (d > 0.5), prey do not sleep for all of the 12 hours in which they are safe from predation, resulting in weaker selection pressure toward monophasicity and shorter sleep times.
Second, because prey are defined to be awake when they are feeding or looking for food or sleep sites, it is more dangerous to have a "feeding gene" between a sleep phase in the condition "safe when sleeping" (d < 0.5) than to have a "sleep gene" between a foraging period in the condition "safe when awake" (d > 0.5).In the former case, the feeding gene directly translates to 60 minutes of risk because activity is initiated, while in the latter it translates into less than 60 minutes of risk because the prey is already active and remains so until -and if -a sleep site is found.Again, this helps to explain asymmetry in the degree of monophasicity and the relative difference in the amount of predation encounters for d < 0.5 and d > 0.5.
In a final set of simulations, we investigated more dynamic effects of prey activity on predator activity.Thus, in condition 3, the predators' behaviour was flexible and depended on the behaviour of the prey in the previous hour.In two sub-conditions, we investigated the relationship between the circadian rhythms of the two prey and the effect that predation pressure can have on this relationship.When predators were active if at least one prey was active (sub-condition a), prey tended to synchronize their activity.However, when predators were active only if both prey were active in the previous hour (sub-condition b), an asynchronous sleeping pattern emerged.In this way, the prey could benefit from periods in which predators were inactive, specifically in the short period following synchronous sleep (as this induced sleep in the predator).
As with any model, the conditions simulated here represent gross simplifications of the real world.This is necessary to make progress with a theoretical model, yet several aspects of this simplification deserve consideration.First, the predator and prey moved in a simple way, which was essentially random (although the ranging actually differed slightly between the two organisms, with prey moving in correlated random walk to better explore the environment in order to find food and sleep patches).We might imagine that prey with a mental map would be able to better locate resources, and, similarly, a "smart" predator would likely hunt in areas of the simulation space that contain prey food or sleep sites (Bennett 1996; for mental maps in primates see: Byrne 2000, Normand & Boesch 2009).In addition, both predator and prey are likely to be able to sense the other and to respond appropriately.While this was taken into account to some extent in condition 3, these and other aspects of predator-prey interactions could be implemented in more sophisticated models (see e.g.Luttbeg & Schmitz 2000).In many cases, these models could be parameterized with real-world data on specific organisms.
Second, we assumed that only prey could change their activity behaviour evolutionarily.In other words, the predators had fixed behavioural strategies in terms of their activity periods, producing evolutionary change in prey but not predators.Although we varied the predators' behavioural strategies across three conditions (and two sub-conditions), in a real-world setting the predators would be capable of coevolving with the prey, and both predators and prey may show more facultative strategies.In the context of coevolution, for example, the asynchronous pattern of predator-prey activity would be unlikely to be as stable as in condition 1, at least for a two-organism system, because predators would be expected to change the timing of their sleep-wake cycle in order to be active when prey are awake.This of course depends greatly on the behaviour of other species in the predator's diet, since availability of other, more plentiful prey may enable another prey species to escape by altering its circadian rhythm (Lima et al. 2005).A predator-prey arms race could be explored in future simulations, where we might expect to find higher rates of evolution and an absence of a stable equilibrium.
Finally we assumed that prey exhibit only two behaviors -sleeping and feeding.As future extensions one may easily model additional behaviors, such as resting, mating, or caring for offspring.The effects would depend on how those behaviors influence risk, and a number of different scenarios are possible.
Our model further indicates the kinds of data that are needed to better understand the links between sleep and predation (see also Lima et al. 2005).For example, it will be important to obtain estimates of safety at the sleep site, and to assess how a behaviourally flexible predator adjusts its activity in relation to prey activity.Similarly, our model reveals that we need more information on how the distribution of resources impacts actual sleep patterns, where resources refer to both food sites and sleeping sites, and details on how the availability of alternative prey impact sleep patterns in other prey species.Lastly, construction of safe sleep sites, such as nests or burrows, should increase safety of sleeping.However, such structures may increase risk when traveling to and from sleep sites, as they offer an easy to discern clue for patterns of prey movement.This effect also could be modeled and investigated using experimental or observational methods.
In conclusion, our model provides new insights to the links between sleep and predation.
By showing that many expected patterns emerge -e.g., in condition 1 -we can be more confident of the pattern that are less intuitive in other conditions, such as condition 2.More generally, our model shows that predation can exert a strong selective pressure on sleep patterns.We also found that differences in safety at sleep and foraging sites can create different dynamics, with the depletion of food resources tending to favor some foraging activity even at times when predation risk is high.Thus, an understanding of mammalian sleep will require more information on a wide range of ecological factors involving the distribution of resources, availability of safe sleeping sites, and predator searching behaviour.The genome (internal clock) of the best-evolved prey in 50 replications without predators (left) and in 50 replications with predators (right).Predators displayed a fixed behaviour of being active from hours 1 to 12. Black squares: "sleeping" genes.Gray squares: "feeding" genes.The genome (internal clock) of the best-evolved prey in 100 replications when varying detection rate (d) from 0.0 to 1.0 in increments of 0.01.Values of d < 0.5 corresponded to greater safety when sleeping, while values of d > 0.5 corresponded to less safety when sleeping (in both cases relative to movement or feeding).Black squares: "sleeping" genes.Gray squares: "feeding" genes.Tables Table 1:

Figure 1 :
Figure 1: Effect of monophasic predators on the proportion of monophasic prey.Box plots of the proportion of monophasic prey in 50 replications without predators (Control) and in 50 replications with predators (Predators).Boxes represent the inter-quartile range of the data.The horizontal lines inside the boxes indicate the median values.The horizontal lines outside the boxes indicate the minimum and maximum values.Circles represent outliers.Predators displayed a fixed behaviour of being active from hours 1 to 12.

Figure 3 :
Figure 3: Prey's internal clock with different values of detection rate (d).

Figure 4 :
Figure 4: Effects of detection rate (d) on the average amount of time spent sleeping.Average number of minutes spent sleeping in 100 replications varying detection rate (d) from 0.0 to 1.0 in increments of 0.01.Values of d < 0.5 corresponded to greater safety when sleeping, while values of d > 0.5 corresponded to less safety when sleeping (in both cases relative to movement or feeding).Dotted line: average number of minutes spent sleeping in control condition without predators.Solid line: non-linear (cubic) fit of the data.

Figure 5 :
Figure 5: Effects of detection rate (d) on the proportion of monophasic prey.Average proportion of monophasic prey in 100 replications varying detection rate (d) from 0.0 to 1.0 in increments of 0.01.Values of d < 0.5 corresponded to greater safety when sleeping, while values of d > 0.5 corresponded to less safety when sleeping (in both cases relative to movement or feeding).Dotted line: average proportion of monophasic prey in control condition without predators.Solid line: linear fit of the data.

Figure 6 :
Figure 6: Effects of detection rate (d) on the average number of predator encounters.Average number of predator encounters in 100 replications varying detection rate (d) from 0.0 to 1.0 in increments of 0.01.Values of d < 0.5 corresponded to greater safety when sleeping, while values of d > 0.5 corresponded to less safety when sleeping (in both cases relative to movement or feeding).

Figure 7 :
Figure 7: Prey synchrony Box plots of the average values of the parameter Sync at the end of simulations for 50 replications.Boxes represent the inter-quartile range of the data.The horizontal lines inside the boxes indicate the median values.The horizontal lines outside the boxes indicate the minimum and maximum values.Circles represent outliers.Sub-condition a: predators active if at least one prey was active in the previous hour.Sub-condition b: predators active if both prey were active in the previous hour.

Figure 8 :
Figure 8: Effects of prey synchrony on the average number of predators encounters.Average number of predator encounters versus average final value of the parameter Sync in 50 replications of sub-condition a (predators active if at least one prey was active in the previous hour -Left) and in 50 replications of sub-condition b (predators active if both prey were active in the previous hour -Right).Solid lines represent a linear fit of the data.