Incorporating thermodynamics in predator– prey games predicts the diel foraging patterns of poikilothermic predators

1. Models of foraging behavior typically assume that prey do not adapt to temporal variation in predation risk, such as by avoiding foraging at certain times of the day. When this behavioral plasticity is considered - such as in predator-prey games - the role of abiotic factors are usually ignored. 2. An abiotic factor that exerts strong influence on the physiology and behavior of many animals is ambient temperature, although it is often ignored from game models as it is implicitly assumed that both predators and prey are homothermic. However, poikolotherms' performance may be reduced in cold conditions due to reduced muscle function, limiting the prey-capture ability of predators and the predator-avoidance and foraging abilities of prey. 3. Here, we use a game-theoretic predator-prey model in which diel temperature changes influence foraging gains and costs to predict the evolutionarily stable diel activity of predators. 4., Our model predicts the range of patterns observed in nature, including nocturnal, diurnal, crepuscular, and a previously unexplained post-sunset crepuscular pattern observed in some sharks. In general, smaller predators are predicted to be more diurnal than larger ones. The safety of prey when not foraging is critical, explaining why predators in coral reef systems (with safe refuges) may often have different foraging patterns to pelagic predators. 5. We make a range of testable predictions that will enable the further evaluation of this theoretical framework for understanding diel foraging patterns in poikilotherms.

relatively recently it was generally assumed that these cycles were fixed for species, when in fact animals show differences both between and within populations due to differences in environment and habitat (Fox & Bellwood, 2011). Environmental conditions will fluctuate over diel, seasonal and tidal cycles, which can induce temporal changes in foraging success, risk effects and metabolic processes (Houston & McNamara, 2014). There is likely selection for animals to choose the optimal times to be most active, and an understanding of what shapes these patterns could predict how animal activity may change in response to changing environments and climates (e.g. Aksnes & Giske, 1990).
In most parts of the world, light and temperature change dramatically over the diurnal cycle. Diel changes in light levels can profoundly influence the foraging success of predators (e.g. nocturnal predators may have visual systems adapted for low light) and/or the level of safety experienced by prey (e.g. via the effectiveness of vigilance, Metcalfe et al., 1999;Watts et al., 2018). Indeed, temporal variation in risk likely drives activity cycles of many prey (Higginson et al., 2012;Lima & Bednekoff, 1999); for example, orb weaver spiders are most likely to forage during periods when parasitic wasps are least active (Watts et al., 2018). In many cases, these riskinduced cycles lead to prey facing a trade-off between minimizing risk and maximizing growth (Gilliam, 1982;Werner & Gilliam, 1984).
Juvenile salmon are often nocturnal during the winter despite lower foraging success during this time, because they can be detected less readily by predators at night (Metcalfe et al., 1999;Railsback et al., 2005). Similarly, predators should be most active when their foraging success is highest. Cheetahs are primarily diurnal, but will hunt at night during periods of high moonlight intensity (Broekhuis et al., 2014). Predator-prey games suggest that temporal changes in risk and foraging success can simultaneously drive patterns of behaviour in predator and prey. In open ocean ecosystems, game theory models predict that temporal risk drives diel vertical migrations in prey (use deep habitats during the day and move into shallower water at night), which in turn drives similar vertical migrations in predators (e.g. tuna), leading to crepuscular peaks in prey encounter rate (Thygesen et al., 2016). White sharks off South Africa are most active at dawn when their foraging success on juvenile seals is highest, while seal foraging activity is tailored to minimize risk of attack (Laroche et al., 2008).
However, models of animal activity cycles must also consider physiology and its contribution to fitness (Jensen et al., 2021).
Searching for prey costs energy and if prey is not located, the animal will eventually go into energetic deficit. Theoretically, animal daily routines can arise from the animal needing to rest and prevent decline of body condition (Houston & McNamara, 2014). Most models have implicitly or explicitly assumed that the animals are endotherms so that their performance (although not their costs) is constant regardless of when they are active. By contrast, metabolic rates and physiological processes of ectotherms will be intimately connected to ambient temperatures which may range widely throughout diel and tidal cycles (DiGirolamo et al., 2012;Papastamatiou, Watanabe, et al., 2015;Sims et al., 2006). For example, marine predator body temperatures (or water temperatures they are exposed to) can vary by 1-8℃ across the diel cycle (DiGirolamo et al., 2012;Hight & Lowe, 2007;Papastamatiou, Meyer, et al., 2015;Papastamatiou, Watanabe, et al., 2015;Sims et al., 2006;Speed et al., 2012).
Metabolic rates increase with temperature, which will impact the animal's energy expenditure as well as its ability to be active. Within marine systems, this may lead to predators selecting warm waters to forage, and cooler waters to rest and reduce energetic costs ('hunt warm, rest cold'; Sims et al., 2006). Other thermal strategies may exist if (for example) the animal has selected to maximize feeding rates as opposed to energy efficiency ('hunt cold, rest warm';Wurtsbaugh & Neverman, 1988).
Energetic strategies will interact with risk effects based on the animals' energetic needs. For example, juvenile salmon are more diurnal during the summer, as their metabolic rates (and energetic needs) increase and they have to partake in riskier behaviour (e.g. being active during the day) to obtain sufficient resources (Metcalfe et al., 1999;Railsback et al., 2005). However, temperature changes may also impact animal performance via changes in swim speeds.
As muscle temperatures increase so will their contraction efficiency which will also enable predators or prey to swim faster, so temperature can directly influence the outcome of predator-prey interactions (Dell et al., 2014). Predators and prey are likely to have differing thermal response curves, and due to thermal inertia (smaller animals gain/lose heat at a faster rate than larger animals), metabolic rates and/or muscle contraction efficiency may scale at different rates; so changes in ambient temperature may have a disproportionate impact on trophic interactions (Dell et al., 2014;Thygesen et al., 2016). Including thermal physiology into models can further help explain patterns of activity. However, there are relatively few models that consider temporal changes in risk/foraging success and the interplay with thermal physiology, particularly for predators.
Marine predators show cyclical patterns of activity with peaks that include nocturnal, diurnal or crepuscular periodicity (Bosiger & McCormick, 2014;Laroche et al., 2008;Sims et al., 2006). However, for other species, there may be peaks that are not explained by conventional models. Several species of tropical reef shark show peaks in activity a few hours after sunset, meaning searching for prey occurs in the dark (Brewster et al., 2018;Lowe, 2002;Papastamatiou, Watanabe, et al., 2015Shipley et al., 2018). This early evening peak would make it unlikely that light conditions or prey behaviour (e.g. reef fish returning to a shelter at sunset) alone is driving this behaviour. A potential explanation is that the early evening represents the period when the difference in body temperature between large predators and small prey is maximal (due to thermal inertia differences), and therefore predators may have an activity or speed advantage (Papastamatiou, Watanabe, et al., 2015). However, no theoretical framework for predicting what drives activity peaks in poikilothermic predators currently exists. Here, we develop a predator-prey game, which includes effects of temperature on the foraging success of predators and prey, to predict diel patterns of activity.

| A SSUMP TI ON S OF THE MODEL
In this section, we explain the assumptions of our theoretical model. Table S1.

| Diurnal variation of environments
In this predator-prey game model, we focus on the effects of diurnal variation in two environmental variables: ambient water temperature and light intensity. We explore the effect of temperature first, before assessing how robust its effects are when light also affects the animals. Throughout, we refer to the predator as a shark hunting its prey (e.g. reef fish), but the model is general, and potentially applicable to all poikilotherms.
Water temperature is assumed to follow a sine wave with 1 day cycle, that is, where w b and w k are, respectively, the average water temperature and the amplitude over the day, and w is the warmest time of the day. The diurnal variation of water temperature determines the dynamics of prey and shark body temperature, which influence their swim speeds. We assume that prey are sufficiently small and not insulated so that their body temperature tracks water temperature. On the other hand, sharks have relatively large bodies so that thermal inertia and conduction processes can cause a delay of body temperature dynamics, that is, larger sharks are slower to warm up and cool down (Nakamura et al., 2020). We assume that the temperature of the body is uniform due to the circulatory system, and that the production of heat inside of the sharks' body is negligible so can be ignored. Then, the shark's body temperature s(τ) is changed only by heat transfer across the skin between the shark's body and the water. Heat will also be lost via convection across the gills, but empirical data clearly show rate of heat loss in large sharks is a function of body size (Nakamura et al., 2020). Because the thermal conductance rate is proportional to the body surface area while the heat capacity will be proportional to the body mass, the dynamics of the shark's body temperature is proportional to the inverse of the shark's body length L, that is, where k is a coefficient determining the influence of body length on the delay of thermal dynamics (see Appendix A for detail). By solving this after substituting Equation (1), we derived (see Appendix A for detail) the diurnal variation in shark body temperature (Figure 1a).
We assume that the swim speeds of prey and sharks, u(τ) and v(τ), linearly increase with their body temperature, that is,

| Benefit and cost of foraging for predator and prey
We divided a day into T periods (T = 24 throughout) with the first period starting at midnight, that is, t-th period is from τ = (t − 1)/T to τ = t/T. The strategies of sharks and their prey are characterized by their probability of foraging during each time period, {y 1 , y 2 , … y T } and {x 1 , x 2 , … x T }, respectively. In other words, sharks and prey choose foraging probabilities at each time period to maximize their fitness (defined later). Foraging efficiency of prey and predators varies between the time periods (therefore, the mortality rate due to shark's predation), which are assumed to be determined by their swim Assumptions of the diurnal patterns of environmental conditions and their effects on the predator and prey. The horizontal axis is the time of day. The lines show (a) water/prey temperature (w(τ), blue squares) and shark body temperature (s(τ)) for three values of shark body length L: 0.3 (purple triangles), 1 (red circles), 3 (orange diamonds), (b) Speed of prey (u(τ), blue squares) and shark (v(τ), red circles), difference in speed (v(τ) − u(τ), purple triangles) when L = 1.0 speed. The foraging performance of prey is assumed to increase linearly with their swimming speed: where u t is the prey's swim speed at the middle time point of the focal period, that is, u t = u((t − 0.5)/T). α is the availability of the prey's food, and ω is the effect of swimming speed on foraging performance. On the other hand, the successful attack rate of sharks for fully foraging prey population (i.e. x t = 1) is assumed to increase with the difference of the swim speed between prey and predators: where v t is the shark's swim speed at the middle time point of the focal period, v t = v((t − 0.5)/T), and λ and β are coefficients determining the influence of the difference in swim speeds ( Figure 1b). We assume a Type II functional response for the rate of predation, so the energy intake rate of sharks at time t, q t , is where h is the handling time. We assume that sharks can attack both foraging and non-foraging prey (whose proportion is x t and 1 − x t ), although the predation risk for latter ϕ could be smaller (i.e. 0 ≤ ϕ ≤ 1).
The total number of prey killed by the sharks is the products of predation rate q t and the relative density of foraging sharks, that is, m y y t q t , where m y is the relative density of sharks (ratio of number of sharks to the number of prey). By dividing this by the total number of prey that could be attacked by sharks, the mortality rate of prey due to shark predation at time t is We assume different fitness measures for sharks and prey. The shark's strategy y t only changes its own energy intake rate, and therefore we simply assume that the shark is adapted to maximize its total net energy gain over the day: where c is a constant amount of energy use when hunting. On the other hand, prey's strategy x t influences both the energy intake (i.e. foraging performance) and the mortality rate. In such a situation, it is known that the fitness could be evaluated by the ratio of energy intake rate to mortality rate (Houston & McNamara, 1991, see also Appendix B). To represent the mortality of prey in more general form, we assumed two additional causes of prey mortality: (a) predation by other predators; we simply assume such predation rate is a constant value, m x , regardless of the water temperature, but depends on prey foraging and the safety of not foraging ϕ, and (b) baseline mortality rate (m b ), through processes independent of prey behaviour (e.g. from disease). Then, the total mortality rate of a prey individual with strategy x ′ t in a population with strategy x t is Prey try to maximize the daily energy intake (Equation 6) per mortality rate (Equation 11, see Appendix B), that is,

| Finding evolutionarily stable strategies
Equations (10) and (12) show that the optimal foraging strategies of prey and sharks are interdependent. To solve evolutionarily stable strategies, we focused on the fact that if the prey's strategy x t is fixed, the optimal behaviour of sharks y t * is either zero or one depending on the relative magnitude between Equation (8) and c, that is, where x̂t is the threshold density of prey, above which sharks hunt: We assume the sharks' behavioural response to the change of the prey's behaviour is sufficiently quick that prey optimize their behaviour taking the sharks' response to prey behaviour into account. This assumption is adequate for finding stable strategies. If predators were slower to respond, then prey strategy could continually change to outpace the predators, and such dynamic chases are not widely reported in nature. One reason could be that prey have to also adapt to their own food source, which reduces the advantage of altering their foraging time. Based on these assumptions, we substitute Equation (13) into (12) and numerically solved the optimal foraging strategies of prey (and so those of sharks) in the same way as the classical optimal diet model (Krebs et al., 1978) (see Appendix C for details of how we find the evolutionarily stable states).
In the analysis, we parameterize to match the location and season where blacktip reef sharks are post-sunset crepuscular (Papastamatiou, Watanabe, et al., 2015): Palmyra Atoll in the central Pacific in July. Here, the water temperature over the day varies between 25 and 30℃, nautical dawn is at 05:50, and full daylight at 06:39, civic dusk at 19:06 and full dark at 19:55.
The following parameters are assumed to be constants, because altering these values would have the same influence as changing other parameters: (i) the coefficient of the delay of thermal dynamics, k, only scales with body length L.
(ii) availability of the prey's food (α) has no influence on the optimal strategy (provided α is constant over t) because it simply scales the ratio of gain to mortality (Equation 12); (iii) for the same reason, the baseline mortality rate of prey (m b ) just determines the scale of m x and m y ; that is, only the ratios m x /m b and m y /m b influence behaviour; (iv) the average swim speed of prey (u 0 ) just determines the scale of v t and ω.
A summary of all parameters and the values we use are given in Table S1.

| C ATEG ORIZ ATI ON OF AC TIVIT Y
At the evolutionarily stable state, sharks are represented as sequences of length 24 of proportions indicating the extent to which they are foraging, between completely resting (0) and totally active (1) in each hour of the day (see Appendix B for the mathematical proof). In practice, all but one of the proportions is zero or one, with the other showing partial activity when the prey density is slightly below the threshold density for predators to be active x*. In almost all of parameter space, prey forage continuously or are diurnal, due to the advantage in avoiding sharks when waters (and thus small fish) are warm. That said, the start and end times of their daytime foraging are sensitive to parameter values and shark behaviour, varying between dawn and almost noon and between mid-afternoon and dusk, respectively. The shark strategies were much more variable and complex. To make clear predictions about predator behaviour, it was necessary to categorize the various activity patterns. We divided the day into six periods of 4 hr each (Figure 2), and named them as follows: (1) 00:00-03:59 "late night"; (2) 04:00-07:59 "sunrise"; (3) 08:00-11:59 "morning"; (4) 12:00-15:59 "afternoon"; (5) 16:00-19:59 "sunset"; and (6) 20:00-23:59 "early night". In the analysis, we detected active peaks (continuously used periods) and categorized their activity peaks based on these time zones. Across all of parameter space, we predicted a subset of around three-quarters of the 2 6 = 64 possible strategies. We grouped these into 13 catego-  Figure 3d).
Finally, we introduce the dependence of the prey's foraging efficiency on its body temperature (ω = 1). Then, prey can obtain a higher benefit from foraging when the water temperature is high  Figure S2) and coloured as shown in Figure 2. Stars indicate the parameter combinations shown in other panels, indicated by the adjacent letter. (b, c, e, g, i, j, k) The upper parts show at each time period the prey's payoff under no predation (i.e. energy intake per mortality rate when x ≤ x*; skyblue), the payoff from full use under predation (i.e. energy intake per mortality rate when x = 1; blue) and the shark fitness when x = 1 (energy gain minus hunting cost; red). Predation occurs in time periods in which both blue and red curves are positive. In the lower parts, the vertical axes show the proportion of each hour that the prey (blue dashed lines) and the predators (red solid lines) hunt under the evolutionarily stable strategy and prey at dusk is larger than around noon, the foraging benefit is sufficiently large that prey tend to be active even if the predation risk is high. The result is that predators tend to be active at dusk (Figure 3i, blue area in Figure 3h). If the predator's speed advantage (controlled by v b ) is sufficiently large, they become active from before noon (Figure 3j, skyblue area in Figure 3h), but if their swim speed is a moderate level and m y is small then prey forage in the morning and so sharks show two foraging periods: one around dawn and one after dusk (Figure 3k, green area in Figure 3h).

| Effects of body size and prey safety
Smaller sharks show similar temperature dynamics to prey, whereas larger sharks show smaller fluctuations and are more mismatched over time to prey (Figure 1). This results in the smaller sharks tending to be more active in daytime (orange, yellow and skyblue areas in Figure 4a are wider than Figure 3h), whereas larger sharks have a greater potential predation rate at night time so nocturnal foraging is too risky for prey and they stop night foraging. Since predation efficiency is too small for large sharks in the day, they may be crepuscular (green, lime green area is larger in Figure 4b).
The influences of body temperature on swim speeds, v k and u k , have similar effects to shark's body length, that is, sharks tend to be diurnal when v k is large and u k is small and tend to be nocturnal when v k is small and u k is large (Figure 4c,d). This is because v k and u k directly control the amplitude of the swim speed, that is, relatively small v k cause flat swim speed dynamics like the larger shark, and vice versa.
The safety of non-foraging prey ϕ also has a significant influence on the results. The reason why ϕ has a critical influence is because it controls the relative power of sharks and prey in the outcome of the game.
Under very low ϕ, sharks can forage only when prey forage; this means the sharks strategy strongly depends on the prey's decision. Because prey swim speed (i.e. their foraging efficiency) is maximal around t = 15 and minimum around t = 3, the sharks are also active around t = 15 and inactive around t = 3. This is the reason why under low ϕ sharks stop foraging before morning, and tend to be diurnal (Figure 4e).
On the other hand, under large ϕ, sharks determine their own foraging time (in most case, midnight) regardless of prey's decision because they can attack resting prey; consequently, sharks attack prey when they are much faster than their prey, from evening until morning. This is the reason why under high ϕ nocturnal is the dominant strategy when the base swim speed of sharks v b is small, and constant activity is the primary strategy when v b is large (Figure 4f). Prey determine their time of peak activity in response to the sharks' peak activity under high ϕ, while sharks determine their time of peak activity in response to the prey's active period under low ϕ ("preylead shark-follow" game or "shark-lead prey-follow" game).
There is only a slight influence of handling time h (Figure 4g) and sharks' energetic cost of predation c ( Figure S3 in Appendix E), although very large h causes sharks to be nocturnal because the realized predation rate becomes smaller and so it could be acceptable risk for prey (i.e. analogous to reduced m y ). The risk from other predators (m x ) slightly changes the proportion of each area of parameter space, but negligibly ( Figure S4); the ratio of m y to m b is far more important. We have assumed that the temperature dependence of swimming speed is the same for both predator and prey (u k = v k ), which is unlikely to be the case. However, halving or doubling each independently has negligible effects on the predictions ( Figure S5).

| LI G HT EFFEC T ON PREDATI ON
Up to now, the model has not included any effect of light, but it is known that predation efficiency can vary depending on the light intensity because predators and/or prey can more easily detect each other in brighter conditions (Johnsen, 2014). To incorporate this factor, we considered an extended model in which the coefficient of the successful attack rate λ (see Equation 7) depends on the light intensity at the time period.
The diurnal variation in light intensity relative to midday is assumed to be the positive part of a sine wave of which peak is at where σ controls the duration of the darkness. We assume that the successful attack rate is dependent on the light intensity: where I t is the light intensity at the middle time point of the focal period relative to midday, that is, I t = I((t − 0.5)/T), μ is the baseline predation efficiency, and ρ and κ determines the influence of light on the predation efficiency. λ t is higher during daytime when ρ is positive (positive light effect: orange and red curves in Figure 1c), while it is lower during daytime when ρ is negative (negative light effect: green and blue curves in Figure 5a).
After replacing all calculations with a parameter λ by λ t , we found that if the strength of the light effect is very strongly negative or positive, sharks tend to be nocturnal or diurnal, respectively (Figure 5c,e), even if temperature is constant ( Figure S6, top-left and bottom-left panels). However, when the light effect is moderate, any effects are dominated by the effect of temperature (Figure 5b,d, Figure S6, middle rows). These tendencies were robust regardless of the sharks' body length or the safety of non-foraging prey (not shown).
Compared to μ and ρ, κ has little influence on the results ( Figure S7).
In pelagic systems, there may be little variation in temperature but a strong negative or positive light effect and this will cause nocturnal or diurnal behaviour, respectively, in prey and sharks, a result that is not sensitive to shark body size or the safety when inactive ( Figure S8).

| D ISCUSS I ON
Predicting the foraging behaviour of animals requires understanding how prey respond to the risk of predation, and, in turn, how (15) I ( ) = max ( + (1 − ) cos (2 + ) , 0) , predators have evolved to maximize their chance of catching prey.
While there have been models of diel patterns of hunting and foraging, these have considered the effects of light on hunting success, the threat of predation, and/or energy stores and body condition (Houston & McNamara, 2014). Similarly, previous models have primarily considered endotherms, which will display a different physiological response to temperature (e.g. muscle temperatures may remain relatively constant regardless of changing ambient temperatures). Here, we replicate a wide range of diel foraging strategies seen in the wild by considering the effects of light on predation risk, habitat characteristics, and importantly, the relative differences in body temperature between predator and prey. These include expected foraging behaviours (e.g. nocturnal, diurnal, crepuscular) in addition to less obvious strategies (e.g. early evening peaks in F I G U R E 4 The effect of parameter values on predictions. Categories of shark foraging pattern for a range of the relative risk from sharks m y (vertical axis) and the body length of sharks L (horizontal axis). Results are shown for 101 × 101 combinations of these parameters, categorized by following the flowchart ( Figure S2) and coloured according to Figure 2. Pairs of panels show the effect of (a, b) body length L, (c, d) the influence of temperature on the swim speed of prey and predators, u k and v k , (e, f) the relative predation risk of non-foraging prey ϕ, (g, h) handling time of sharks h activity). Although we have characterized the model as sharks hunting for fish, the general predictions may apply to a wide range of ectotherms including terrestrial invertebrates, amphibians and reptiles. In terrestrial habitats, temperature fluctuations may be more extreme than in marine environments, and some animals may be less able to avoid areas where there are predators (e.g. in ponds).
Muscle performance is generally dependent on temperature, with rates of force development and power output increasing with temperature, while twitch durations decrease (Bennett, 1985;Johnston & Temple, 2002). Consequently, increased muscle temperatures lead to increased maximal attainable and sustainable speeds (Johnston & Temple, 2002). As such, differences in muscle temperature between predator and prey can have considerable impacts on the outcome of predator-prey interactions. For instance, the low diversity of marine mammals in the tropics is attributed to a reduced difference in muscle temperature between endothermic mammals and ectothermic prey in warm water (Grady et al., 2019).
With a reduced speed advantage, the foraging success of marine mammals was apparently reduced to a level where speciation rates were influenced. Over shorter temporal and spatial scales, grey reef sharks at a Pacific atoll make brief dives below the thermocline where they are in a highly active state . One explanation for this behaviour was that due to thermal inertia, sharks should be significantly warmer (for short periods of time) than reef fishes that reside below the thermocline, providing sharks with a short foraging advantage.

Incorporating differences in body temperatures between predator
and prey in our model also illuminated a previously unexplained behavioural strategy; increased activity in early evening. Blacktip reef and Caribbean reef sharks showed peaks in activity around 8-9 p.m., which is shortly after sunset (Papastamatiou, Watanabe, et al., 2015;Shipley et al., 2018). This peak can now be potentially explained as the time period when hunting success can be highest due to the largest differential between predator and prey body F I G U R E 5 Effect of light dynamics on predations. (a) Light effect on predation efficiency ρ = 1.0 (blue triangles), 0.5 (green diamonds), 0.0 (black crosses), −0.5 (orange circles) and −0.9 (red squres). Note that in each case the baseline μ is also changed to keep the maximum predation efficiency equal to unity. (b-e) Categories of shark foraging pattern for a range of the relative risk from sharks m y (vertical axis) and the average speed of sharks v b (horizontal axis). Results are shown for 101 × 101 combinations of these parameters, categorized by following the flowchart ( Figure S2) and coloured according to Figure 2. Positive light effect on predation efficiency, with moderate (b, ρ = 0.5 so minimum efficiency is 50% of maximum) and strong (c, ρ = 0.9 so minimum efficiency is 90% of maximum), and negative light effect on predation efficiency (ρ < 0) with moderate (d) and strong (e) levels. Values of μ were chosen to ensure light effect was always unity at midday. For comparison to Figure 3h temperatures. Previous models have considered the role of body temperature on predator foraging efficiency in the context of diel vertical migrations in tuna (Thygesen et al., 2016). However, the relative difference in temperature between predator and prey was not considered.
In our results, we have assumed a fairly large diurnal temperature range, and variation may be small in many systems. However, not enough is known about the scaling of muscle performance against temperature. In our model, this scaling is controlled by the parameters u k and v k , which are currently arbitrary. Further work that enabled greater accuracy in these parameters would be valuable for understanding predator-prey interactions. There will be parts of the deep ocean especially where diurnal change is negligible-our model will be most applicable to coastal shelf and other shallower ecosystems, or areas where there is very strong vertical stratification of layers. Many animals move vertically over the day which may negate diurnal fluctuations in ambient temperature as differences between locations are often larger that differences between night and day. Similarly, some animals aggregate at stable ocean thermal fronts where there may be dramatic horizontal gradients in water temperature (Kirby et al., 2008). A model considering thermal physiology of tuna at fronts predicted early evening hunting to be an optimal strategy, although predator and prey behaviour were not considered as a game (Kirby et al., 2008).
However, it seems that migrations, at least vertical ones, often exaggerate temperature changes (Papastamatiou, Watanabe, et al., 2015;Sims et al., 2006), making the dynamics we have studied more likely to be common.
Our model also highlighted how broad the predictions of the predator-prey game are and how they are sensitive to parameters including predator size (L), the relative safety of prey when not foraging (ϕ), the degree of risk exerted by sharks (m y ) and the morphological advantages of predators (e.g. average speed difference v b -u b ). These results help explain how patterns of predator activity will vary by species, location and even habitat. Sharks swimming at low-medium speeds and foraging in habitats where risk to prey are low are predicted to be nocturnal. These predictions may also explain differences in activity cycles of reef shark species at the same location; for example, grey reef sharks hunting on the forereef at Palmyra atoll are nocturnal, while blacktip reef sharks foraging in backreef habitats are post-sunset crepuscular (Papastamatiou, Watanabe, et al., 2015. Habitats within reef environments will vary in terms of shelter and vertical relief (e.g. backreef tends to have high vertical relief coral, while the opposite is true on the forereef) and therefore predators occupying these habitats may be active at different times. Hunting patterns may also change within a habitat, for example as a function of moonlight intensity, which will change the degree of risk and is known to alter predator foraging patterns (e.g. in cheetahs Broekhuis et al., 2014).
We presented our results in terms of the relative risk from the focal predator (m y ) and the average speed of the focal predator (v k ) because these have particularly large effects on the hunting pattern.
To some extent, their effects are aligned, which causes the diagonal patterning of most figures. m y is the maximum possible consumption of prey by the predator so dependent on relative population densities; v k controls the consumption rate of the individual. Hence, they both control predation risk by the sharks, but have different effects because of how prey respond to the risk. When v b is small and m y is large, sharks can only catch prey when the water is cold but catch many, so the prey are strictly nocturnal and sharks cannot hunt them. When v b is large and m y is small, sharks can always catch the prey but have small effects on them overall so prey largely ignore them and so sharks hunt at all times.
Another parameter which emerged as particularly important to predictions was ϕ, the risk incurred by prey when not foraging.
Changes in ϕ can cause a shift in optimal foraging times while all other parameters are kept constant, including switches from nocturnal to crepuscular, and continuous hunting. These can also explain differences in behaviour between habitats (e.g. within a coral reef), or between predatory strategies (sit and wait vs. active patrolling).
Such differences may also explain differences in predator behaviour between reef and pelagic habitats. The only way for prey to locate safer habitats in pelagic environments is to move vertically through the water column, and predator-prey games suggest that trade-offs between predator avoidance, reduced growth, and body temperature, drive diel vertical migrations in the deep scattering layer and predators such as tuna (Thygesen & Patterson, 2019). However, a range of activity patterns can be seen in pelagic predators including diurnal, nocturnal or asynchronous activity patterns (Gleiss et al., 2019;Papastamatiou, Iosilevskii, et al., 2018).
The impact of ϕ was due to its influence on the decision of prey to attempt to avoid predators. Their degree of avoidance was also affected by the relative risk for prey from the predators in our model, which is a proxy for the risk from any focal predator species on a prey species. For instance, if a focal predator's main prey is also prey for many other predators-that do not behave similarly to the focal predator-then prey will not be under strong selection for behaviours to avoid the predator. Subsequently, the focal predators will forage at times when they have the greatest speed difference leading to the post-sunset crepuscular strategy seen in blacktip reef sharks (Papastamatiou, Watanabe, et al., 2015).
Body size of predators has strong effects on diel foraging patterns because it determines the times of day that the predation risk is highest. In general, the model predicts that small predators will be diurnal and large predators nocturnal or crepuscular, but size interacted in testable ways with other parameters, especially the magnitude of risk from sharks and the relative risk when not foraging (Figure 4a,b). For instance, larger sharks are likely to be crepuscular but only when they pose a relatively small risk to prey. Additional factors may come into play such as smaller predators also being prey to other animals and having to incorporate vigilance into their behavioural strategy (e.g. Martin, 2004). Body size will thus provide a relatively straightforward way to test our predictions.
The effects of light on predation risk can dominate the effect of temperature in determining strategies, so we encourage studies that attempt to assess these patterns across a range of systems. We incorporated light effects in our model and the results were intuitive for very strong effects and when the temperature did not vary, but for weaker effects the effect of temperature on prey and predator foraging success tended to dominate. Further work is needed to quantify the relative strength of these effects. The risk may depend on the relative light sensitivity of predators and prey eyes, as well as the depth at which the animals live. In shallow water, the light intensity changes as much as on land, but in deep water there may be no diel fluctuations in light. Therefore, we expect broad impacts of depth, but mitigated by visual sensitivities, which are more difficult to measure.
One metric not included in our model was the metabolic costs associated with changing temperatures, which may be particularly important for some ectotherms. For example, the nocturnal foraging activity of some temperate reef sharks is at least partially driven by sharks resting in deeper, cooler water during the day where metabolic costs are reduced (Sims et al., 2006). For some tropical species, the reduced diel variation in water temperature likely means that diel metabolic rates of ectothermic predators are more a function of swim speeds, than water temperature Udyawer et al., 2017). We also assume that the thermal response of swim speeds may be similar in predator and prey (although we consider differences in thermal inertia), whereas there may well be asymmetries in their response (Dell et al., 2014).
Predator and prey may have differing thermal activity curves and show asymmetry in their level of performance of the response, or response activation energy (Dell et al., 2014). Future models should include the additional complexity of temperature effects on metabolic costs and speeds, how these may vary between predator and prey, and how these may contribute to diel strategies.
In conclusion, we have developed a predator-prey game which accurately predicts a variety of activity patterns seen in marine ectothermic predators. We also highlight parameters that are important in driving the results of these games, providing a framework for future studies investigating the evolution of predator activity patterns.
In particular, we highlight the importance of relative differences in body temperature and body size between predator and prey, in addition to the relative safety prey obtain when not foraging. Even measuring activity patterns of wild marine predators has been challenging, but an increasing number of studies have started to reveal the variability that may exist across and within systems (Brewster et al., 2018;Lear et al., 2021;Papastamatiou, Iosilevskii, et al., 2018;Shipley et al., 2018). Our theoretical framework will enable hypothesis testing to help explain this variability in terms of when predators prefer to hunt.

ACK N OWLED G EM ENTS
The authors are particularly grateful to Christian Jørgensen and two anonymous reviewers for very valuable comments on the manu-

CO N FLI C T O F I NTE R E S T
All authors declare that there are no conflict of interest.

DATA AVA I L A B I L I T Y S TAT E M E N T
The code used to generate the results is available at GitHub: https:// github.com/hmito/ TempS wimSpeed (Ito, 2021).