The joint evolution of learning and dispersal maintains intraspecific diversity in metapopulations

The evolution of dispersal tendencies and of cognitive abilities have both been intensely studied. Yet little attention has been given to the question of how these two aspects may relate to each other, as a result of their joint evolution. On the one hand, learning abilities may help dispersers to cope with their new habitat. On the other hand, dispersal may sometimes reduce the need for learning, because local environments may differ in how much there is to learn. To get a better understanding of this relationship, we built an individual-based simulation in which both learning speed and dispersal tendency were free to evolve. We found that both positive and negative correlations could evolve between these traits, depending on properties both of local patches and of the metapopulation as a whole. We also found that dispersal stabilized the co-existence of different cognitive types in the metapopulation, underscoring its importance for maintaining biodiversity within species.


Introduction
Animal dispersal describes the process of individuals leaving their birthplace or to settle and reproduce in a new location (Bowler andBenton 2005, Ronce 2007).This process is of great importance for individual fitness and for the whole metapopulation.Dispersal allows for gene flow between populations and stabilizes metapopulations through source-sink dynamics.Dispersal also plays a crucial role for species in fluctuating environments by allowing individuals to invade new areas with favourable conditions.In this context, the 'spatial insurance hypothesis' emphasizes the importance of dispersal for the persistence of ecosystem functioning in fluctuating environments because it allows better-adapted species to take over the ecological role of less-adapted species when conditions change (Loreau et al. 2003, Thompson andFronhofer 2019).On the other hand, dispersal of invasive species can cause severe damage to ecosystems (Shine 2010), including human agriculture (Paini et al. 2016).In general, dispersal can be divided into three phases: emigration, transfer and settlement (Bowler and Benton 2005).Reasons to disperse can be diverse, the most prominent being avoidance of The joint evolution of learning and dispersal maintains intraspecific diversity in metapopulations conspecific competition, including kin-competition (Bowler and Benton 2005).But also finding mating partners, avoiding predation or finding suitable habitats when the birth place's environment has changed, can induce dispersal.
Costs of dispersal can arise in all three phases, with metabolic costs or even death during the transient phase being the most obvious (Bonte et al. 2012).Yet costs can also arise before departure, e.g.associated with expressing dispersalrelated traits such as wings in locusts or cicadas (Bonte et al. 2012).Costs can also occur long after settlement, e.g.due to loss of familiarity with the environment (Bonte et al. 2012).Another crucial problem for dispersers is the finding of a suitable habitat to which they are phenotypically well adapted.A concept termed 'informed dispersal' (Clobert et al. 2009) has been proposed, stressing the importance of gathering information about conditions in the natal patch and new patches (McNamara and Dall 2011, Delgado et al. 2014, Mortier et al. 2019).The ability to assess and compare an individual's expected fitness in different patches should clearly influence dispersal decisions.Informed dispersal depends crucially on how well individuals can obtain information, how reliable the information is, and in which dispersal phase the information is gathered (Delgado et al. 2014).This need for information processing suggests that cognitive abilities may play a crucial role here.Moreover, cognitive abilities may also help to adjust to local conditions after settlement and therefore influence dispersal decisions -an aspect which has yet not been considered in modelling approaches (Sutter and Kawecki 2009, but see models on resource preferences by Maspons et al. 2019).There is accumulating evidence that individuals differ in their cognitive abilities (Boogert et al. 2018, Cauchoix et al. 2018) and these differences are often correlated with other behavioural traits, forming so-called 'cognitive styles' (Carere and Locurto 2011, Sih and Del Giudice 2012, Niemelä et al. 2013, Griffin et al. 2015).It has been suggested that a speed-accuracy tradeoff is underlying such a correlation and that faster moving or more explorative individuals tend to be cognitively less flexible or enhanced (Sih and Del Giudice 2012).Yet, empirical and theoretical work indicate that correlations between movement behaviour and cognitive abilities can be more varied, depending on environmental conditions (Amy et al. 2012, Trompf and Brown 2014, Guido et al. 2017, Liedtke and Fromhage 2019).In addition to resource availability, predation pressure is relevant in this context because movement under risk is severely reduced (Niemelä et al. 2012, Moran et al. 2016).
In line with this, it has been suggested that different personalities may have different dispersal tendencies (Cote et al. 2010, Wey et al. 2015).Together with other traits (such as morphology, metabolic rates, lifecycles) these personality traits may form so-called dispersal syndromes.It therefore seems likely that individual differences in cognitive abilities may also affect the fate of dispersers beyond the transient phase.However, whether individuals with enhanced cognitive abilities should increase or decrease their dispersal rates is not straightforward.On the one hand, once an individual has familiarized itself with local conditions by means of learning, emigrating may mean to lose this investment.Thus, individuals investing strongly into learning abilities may be more reluctant to leave their current location.On the other hand, cognitive abilities may facilitate adjusting to new circumstances in new locations, thereby reducing dispersal costs.Thus, individuals (or species) which invest in cognitive abilities to adjust to local conditions may pay higher costs of leaving their natal place but also pay lower costs of settling in new patches.
In this study, we therefore want to investigate the joint evolution of cognitive abilities and dispersal, with emphasis on how learning speed helps to cope with local conditions both in the natal and new patch.This approach will complement previous studies which investigated how information gathering during the departure, transient and settlement phase influence dispersal (McNamara and Dall 2011, Delgado et al. 2014, Jacob et al. 2015, Hillaert et al. 2018, Mortier et al. 2019).To this end we develop an individualbased simulation model in which individuals exploit different resources, and resource intake translates to reproductive success in the end of the season.In this model, individuals need to learn how to access certain types of resources before they can exploit them.Further experience in handling these hardto-access resources types will increase the speed with which individuals can handle the resources.Implementing learning as the reduction of handling time of specific resources reflects the idea that some feeding techniques need to be practiced repeatedly before succeeding (e.g.tool use in primates (Boesch et al. 2019) and birds (Kenward et al. 2006), or hunting techniques in dolphins (Guinet and Bouvier 1995)).Moreover, individuals can also decrease predation pressure by 'anti-predation' or 'avoidance' learning whenever they survived a predator encounter.By studying the interplay between the evolution of dispersal tendencies and cognitive abilities, we will also assess the potential effect of dispersal on maintaining within-species diversity in cognitive styles.

Methods
This model is an extension of a previously published model which studied the evolution of alternative cognitive styles through niche-specialisation, albeit without considering dispersal (Liedtke and Fromhage 2019).In order to investigate the interplay between cognitive styles and dispersal, here we implemented a metapopulation setting with N Patches habitat patches (list of abbreviations in Table 1), which are connected through random global dispersal (i.e.individuals have the same chance of reaching any of the N Patches patches when dispersing).Since we focus on how learning abilities may help individuals to adjust to new conditions faced after dispersal, we do not include habitat-matching leading to non-random dispersal, which has been investigated elsewhere (Delgado et al. 2014, Jacob et al. 2015, Edelaar et al. 2017, Holtmann et al. 2017, Maspons et al. 2019, Mortier et al. 2019, Pellerin et al. 2019).Carrying capacity of each patch is set to N Individuals and three traits are allowed to evolve independently for N Generations : learning ability L, exploration tendency E and dispersal tendency D. All three traits are continuous with values between 0 and 1.At the end of each generation, individuals reproduce in proportion to their fitness.For simplicity we assumed asexual reproduction, although including sexual reproduction could be a worthwhile avenue for future studies.We note, however, that insofar as evolution tracks phenotypic optima, phenotypic long-term outcomes may often be robust with regard to recombination and other features of the genetic system (Grafen 1984, Hammerstein 1996).Fitness of individuals is specified by the amount of resources they obtain during their lifetime.We assume an 'income breeder' system where individuals may reproduce independently of their survival until the end of season.
The length of a season (= generation) is defined by the number of days before dispersal T before , plus the number of days after dispersal T after .For simplicity, dispersal does not consume any time and takes place in the middle of the season.Accordingly, T before and T after have equal length in most cases.Cost of dispersal is implemented as mortality risk M during dispersal.
The lifecycle of individuals proceeds in four phases: 1) time before dispersal in which they can collect resources but also face a risk of encountering predators; 2) potential dispersal event i.e. moving with some probability from one patch to another, with a mortality risk defined by M; 3) time after dispersal for collecting resources under a risk of predation; 4) asexual reproduction followed by death.After the last phase a new generation starts with offspring generated by the parent generation.

Environment
The environment of a patch is defined by its patch size N Individuals and the abundance (A Ri ) of different resource types R i .Abundances are defined as the maximal number of resource items of type R i which an individual can encounter in a given period of time (below).Furthermore, resources are defined by their value V Ri in terms of increasing fitness, their handling time H Ri i.e. how long individuals need to handle them before they can obtain their value, and their detectability C Ri , i.e. how easy they are to find.

Predation
Each day an individual, with a given E, faces a probability Ω P of being attacked by a predator (below).For simplicity, there is only one kind of predator present and predation pressure Ω P is the same in all patches throughout the metapopulation.Each time an individual is attacked by a predator, it dies with a probability λ P (called the predator's lethality) that can change according to the individual's previous experience with surviving such attacks.

Learning
Learning is implemented as a reduction in handling-time (H Ri ) of resources due to gaining experience with specific resource types.Up to ten different resource types are implemented, with R 1 being a simple-to-access resource whose handling requires no learning.R 2 to R 10 are resources for which individuals need experience before they can exploit them.Therefore, individuals get better at exploiting resource items of type R 2 through R 10 with time.Similarly, lethality of predators (λ P ) can be reduced through learning from previous predator encounters.A detailed description of how learning was calculated follows below.

Resource intake and predation
First, we calculate the maximum number of resource items per type R i which an individual can collect before dispersal, by multiplying the abundances (A Ri ) in patch P i with the time it has to do so (i.e.T before ).Based on the results found in a previous study (Liedtke and Fromhage 2019), we assumed that individuals will at least move every second time step.Whether individuals would also move in the other timesteps depends on their exploration tendency (E i ).The higher its E i the more likely an individual moves and encounters further resources, such that its maximum number of resource items of type R i is given by This formulation implies that individuals with E i = 0 gain maximally half of what individuals with E i = 1 gain.Next we calculate how often individuals are attacked and whether they will be killed during a specific encounter.To this end we create a vector of length T before .For each day, a binary variable (0 = no attack, or 1 = attack) is drawn from a binomial distribution with probability Ω P × E i , where Ω P is the predator encounter probability and E i is the focal individual's exploration tendency.Accordingly, the more or faster an individual explores its environment, the more likely it will be detected and attacked by a predator.We then calculate the cumulative number of encounters and specify for each encounter how much the lethality (λ P ) would be reduced (due to growing experience) assuming it survived all previous attacks.Thus, the more predator encounters an individual survives, the lower the lethality becomes.The lethality in the current encounter is: where L i is the focal individual's learning ability and λ P_initial is the predator's baseline lethality.Thus, the higher L i , the faster λ P is reduced over the course of repeated encounters.
We then draw for each day a random number between 0 and 1 from a uniform distribution, which functions as a death threshold.On the first day where the lethality of the present encounter exceeds the random death threshold, the individual dies.
We then calculate the amount of resources the individual collected during the T survived days it survived by multiplying the maximum amount of resources (as calculated in Eq. 1) by the proportion T survived /T before of the relevant time period during which the individual was alive: Thus, the earlier in the season an individual dies, the fewer resources it collects and the lower its fitness becomes.If it is not killed at all, it gains the maximum amount of resource items as specified in Eq. 1.
Next we take into account the individuals' exploration tendency E i and the detectability of resource types C Ri .We assume that the faster an individual explores, the less thoroughly it can search; and the harder the items are to detect (i.e.low C Ri ), the less likely they are found.This changes the calculation of collected resources as: Thereafter, we take into account each individual's efficiency of handling resources as influenced by its learning speed L and the number of resource items collected, i.e. how much experience it gained with a specific resource type.This changes the calculation of collected resources as: where H Ri is the handling-time of R i .This formula was selected because it describes a decline of handling time at a decelerating rate.This functional shape appears biologically plausible because perfection may often be difficult to reach, which may slow down progress once more progress has been made.Note that resources with high H need to be encountered multiple times before they can be exploited by a given individual, reflecting the idea that some feeding techniques need to be practiced repeatedly before succeeding (such as tool use in primates (Boesch et al. 2019) and birds (Kenward et al. 2006), or hunting techniques in dolphins (Guinet and Bouvier 1995)).
Finally, we take into account intraspecific competition over resources within a patch.First we estimate the maximum total amount of resources Rmax i collected by all individuals in a given patch, adjusted by a competition factor Ф that controls the severity of the competition: Then we divide this by the sum of resources collected by all individuals as estimated by Eq. 5, to obtain the ratio Rmax i /∑N Ri ‴.If this ratio is < 1, the focal resource type is completely depleted and the share collected per individual is reduced accordingly, as: For example, if resource type R 2 was collected 10 times more often than its Rmax i value for this patch, then for every individual in this patch its amount of collected R 2 items is multiplied by 0.1.

Dispersal
After this foraging phase, individuals could disperse to a randomly chosen patch.An individual's decision to stay or disperse depends on its trait value D and a threshold value between 0 and 1 randomly drawn from a uniform distribution.When the individual's dispersal tendency (D) is higher than that threshold, the individual disperses; otherwise it stays at its natal place.Due to the stochasticity of this process, some patches may have higher or lower numbers of individuals after the dispersal phase.Dispersal costs are implemented as mortality risk M which was set to 0.01 in all cases.Whenever an individual attempts to disperse, a random number between 0 and 1 is drawn from a uniform distribution.If this number is lower than M, the individual dies; otherwise it successfully disperses.After the dispersal phase, surviving individuals are allowed to collect resources again.Resource intake, predation and competition are calculated as in the pre-dispersal phase (Eq.1-7) with the only difference being that the duration of the post-dispersal phase is defined by T after .

Reproduction
After estimating the total resource income of all individuals, reproductive success (fecundity) is calculated as: where L is an individual's learning ability, α a cost coefficient which specifies the cost of learning, and V Total is the total value of all resources collected by this individual.We do not include any explicit cost of E because costs of exploration are implicit in the risks of predation and of overlooking resources.
The next generation is recruited in each patch separately, by independently sampling (with replacement) N Individuals parent individuals to produce one offspring each, with the parent generation's F values used as sampling weights.Thus, the higher a focal individual's F is compared to all other individuals in the same patch, the more likely it contributes offspring to the total N Individuals .

Mutation
Mutation probabilities for all three traits (L, E, D) are set to µ = 0.1.Although this is much higher than natural per-locus mutation rates (Drake et al. 1998), it has the advantage of speeding up the evolutionary process, thereby saving computational time without influencing the outcome qualitatively.Traits evolve independently and new values are chosen randomly from a normal distribution with the parental trait value as mean and SD of 0.1.

Extinction
To increase the incentive to disperse, it is common practice in modelling studies to implement random extinction of patches (Poethke et al. 2003).We do so by erasing, with a given frequency, all individuals of a randomly selected patch in the end of a generation.The empty patch can only be recolonised by immigrants from other patches.

Initialisation
Initially we heuristically explored the parameter space in order to find parameter settings allowing the evolution of different cognitive styles which can coexist within (compare Liedtke and Fromhage 2019) and/or between patches.
In our simulations, co-existence is based predominantly on resource specialization in combination with fast or low exploration tendency: individuals could either specialize on being fast explorers, collecting conspicuous and easy-to-handle resources, or explore slowly but more thoroughly and exploit hard-to-detect resources.In particular, because no biologically meaningful correlations between L and D can occur unless there exists sufficient variation, parameters had to be adjusted so as to avoid giving a decisive advantage to either high-or low-learning styles.For example, provided that environments contained features worth learning, increasing the available time gave a competitive advantage to high-learning types, unless the cost of learning was also increased.To achieve a suitable balance in qualitatively different settings (e.g.where learning was either useful for dispersers or not) multiple parameters had to be adjusted (Supporting information).Rather than describing any particular species, the selected settings were aimed to illustrate biologically interesting possibilities that merit further investigation.
To analyse the link between L and D at the metapopulation level, we used generalized estimating equation models (GEEs) with D as the dependent and L as the explanatory variable.We implemented 'patch ID' as the grouping variable to correct for dependency within patch, Gaussian error structure and correlation structure 'exchangeable' (Halekoh et al. 2006, Zuur et al. 2009).
To investigate the effect of dispersal on the coexistence of different phenotypes (i.e.cognitive styles) within a metapopulation, we compared a simulation with patches being connected by dispersal to another simulation with otherwise identical settings but dispersal being disabled.Since patches in the simulation without dispersal could not be recolonized by immigrants, we allowed no extinction events in this comparison.
In most cases we held resource detectabilities (C Ri ) constant, which led to E evolving to similar values for all individuals.This allowed us to concentrate on the effects of learning abilities on dispersal and vice versa, which is our main interest here.However, in simulations concerning the effect of dispersal on co-existence of behaviour types, we used simulations with different C Ri values.
To analyse the effect of the probability of finding a suitable habitat when dispersing, we changed the frequencies of suitable habitat patches from 2 out of 20 up to 20 out of 20 and recorded the mean dispersal tendencies in each case (Supporting information).We compared these population means by using a linear model with dispersal tendency as the dependent, and frequency of suitable patches as a factorial explanatory variable.We used the 'powerTransform' function of the R package 'car' in order to meet model assumptions.
To analyse the effect of predation, we increased the parameter 'predator lethality' (λ P ) in eleven steps from 0 to 0.1 (Supporting information).To analyse the effect of learning cost, we changed the parameter 'cost coefficient of learning' (α) from low (α = 1/6) to high (α = 1) in eleven steps (Supporting information).Similarly, intra-specific competition (Ф) was changed from low (Ф = 2) to high competition (Ф = 12) in eleven steps (Supporting information).In these analyses, all other parameters were held constant.
Parameter settings for each of the presented simulation sets are given in the Supporting information.All models presented in the main text were replicated 10 times with identical parameter settings to check for consistency.All replicate runs produced qualitatively similar results, with one exception occurring in simulations concerning the co-existence.

Results
We found that dispersal tendency (D) and learning speed (L) are correlated under a range of circumstances.Depending on environmental conditions (e.g.resource composition, predation pressure) and life-history traits (i.e.longevity), this correlation can change direction from negative to positive.

Heterogeneous cognitive demands between patches
For example, we found a strong positive correlation (GEE: n = 1200, p < 0.001, x 2 = 45.38,estimate = 0.3431; SE = 0.05; Fig. 1) when the metapopulation consists of two equally frequent patch types, with one type having only easyto-access, the other only hard-to-access resources.Here, a different cognitive style evolved in each patch type: one low-L style specializing on easy-to-access resources and one high-L style specializing on hard-to-access resources, respectively.In this example, low-L individuals evolved lower dispersal tendency because (unlike high-L individuals) they cannot collect any resources in the 'wrong' kind of habitat for their style.Essentially this makes dispersal costlier for low-L individuals.

Heterogeneous cognitive demands within patches
Under other conditions we can find a negative correlation between D and L (GEE: n = 1200, p < 0.001, x 2 = 197.82,estimate = −0.38388;SE = 0.02729; Fig. 2).Here there are again two equally frequent patch types, but now each patch contains two types of resources: an easy-to-access type and one of two hard-to-access types, where learning progress is not transferrable between the latter two.Low-L individuals then cope equally well in both patch types, whereas high-L individuals perform better in the patch type for which they have relevant experience.The risk of ending up in the wrong patch type thus essentially makes dispersal costlier for high-L individuals.

Habitat type frequency
In general, we find that dispersal tendency increases with the frequency of suitable habitat patches for a given phenotype (Supporting information).This is intuitively expected because, from an evolutionary standpoint, the risk of ending up in unsuitable habitat plays a role similar to the risk of dying during transit: both can be regarded as costs of dispersal.Hence environmental characteristics at two spatial levels affect dispersal: at the level of single patches (e.g.resource abundances) and at the metapopulation level (frequencies of suitable patches).However, when a patch type was very rare (i.e.only 2 out of 20 patches, Supporting information), D in this patch type became highly variable, with an unexpectedly high mean value.This was caused by high number of immigrants coming from the other patch type, especially after extinction events.The more time had passed since the last extinction event, the lower D then became in the rare patch type (not shown) -until another extinction event restarted this process.

Coexistence
When investigating coexistence of cognitive styles, we see that usually in all 24 patches (this higher number of patches was used here to facilitate observing rare events) the coexistence is maintained when dispersal is permitted (Fig. 3).This was true for nine out of ten replicated simulation runs, with the exception being a single patch in a single run, where only one cognitive style was maintained.By contrast, when dispersal was not allowed, the less numerous phenotype went extinct in all patches in all replicated simulation runs (Fig. 3).Thus, indeed, we observed stable coexistence of cognitive styles within patches only in true metapopulation settings, in which dispersal connects the patches.

Predation
Predation pressure has multiple effects depending on its severity (Supporting information).Low predation pressure allows individual to adapt to predation by means of learning and thus leads to an increase in L. Because high L also allows individuals to exploit hard-to-access resources, they benefit more from staying in their natal place.Consequently, dispersal rates are low in general and the correlation between D and L is negative.When predation pressure becomes severe, it reduces life expectancy to such an extent that learning to exploit hard-toaccess resources becomes less beneficial.Consequently, instead of investing in L, individuals then specialise on easy-to-access resources.This in turn selects for increased dispersal because easy-to-access resources can be exploited without learning, which eliminates any reduction of resource intake caused by dispersal.Because all individuals have similar values of L and D, the correlation approximates zero.Predation effects on exploration are straightforward: under low predation pressure, exploration rates are high to increase resource encounter rates; under high predation pressure, exploration rates become low to increase life expectancy (Supporting information).

Learning costs
High learning costs reduce L and increase D, because all individuals specialise on easy-to-access resources (Supporting information).Moderate learning costs induce parts of the population to invest into L and disperse less.Low learning costs induce the majority of individuals to invest in L and exploit hard-to-access resources and disperse even less.We therefore observe that learning costs affect L and D in opposite directions.Because under most levels of learning costs all individuals of the metapopulations evolve to have similar trait values of D and L respectively, the correlation between these traits fluctuates around zero (Supporting information).In cases where two cognitive styles coexist (around α = 1/3), we can see that α explains much of the variation in D as indicated by the high value of Wald statistic (Supporting information).

Resource competition
Effects of intraspecific competition are similarly straightforward: with low competition all individuals specialise on the more abundant and easy-to-access resources.When competition over these resources increases, an increasing number of individuals invest in high L in order to exploit hard-to-access resources and avoid this competition.Consequently, mean L increases and dispersal tendency decreases.Again, because under most settings all individuals have similar trait values, the correlation between those L and D fluctuates around zero (Supporting information).In cases in which two cognitive styles coexist (Ф = 6) we can see that the severity of intraspecific competition explains much of the variation in D as indicated by the high value of Wald statistic (Supporting information).There is no effect of the severity of competition on E and the trait value fluctuates around 0.5 accordingly (Supporting information), at least while all resource types have the same detection probability.

Discussion
We have shown that dispersal tendencies and cognitive abilities (i.e.learning speed) may evolve in a correlated manner, where the direction of the correlation depends both on characteristics of local patches (e.g.resource abundances) and of the metapopulation as a whole (e.g.frequencies of suitable habitats).We also found that dispersal can stabilize the coexistence of different cognitive styles within patches, showing its theoretical significance for maintaining biodiversity within species.The detailed analysis of three key parameters revealed that robust correlations between learning and dispersal can arise whenever pronounced individual differences in learning provide the requisite amount of variation.
Cognitive abilities can influence how well animals can cope with complex, new or changing environmental conditions (Shettleworth 2009).Yet cognitive abilities are costly (Butler 2008, Niven andLaughlin 2008) and thus should be invested in only when needed.Since dispersing individuals may settle in habitats which differ from their natal place, dispersal may generate a mismatch between cognitive abilities and the need for them in the new environmental conditions.More generally the cognitive phenotype, which evolved to match the natal place, might be suboptimally adapted to other environments.We therefore expected that dispersal tendencies and learning abilities may coevolve.Indeed, we found that dispersal tendencies and learning abilities were often correlated in our simulations.However, the nature of this correlation depended on the precise parameter settings.Under some circumstances, animals need to invest highly in learning to cope with their local conditions.If such animals disperse, what they have learned about the old environment may no longer be relevant in the new environment (i.e.loss of familiarity (Bonte et al. 2012)).Therefore, these cognitively advanced individuals may face two kinds of disadvantages, depending on the conditions in the new patch.When dispersing to 'simple' environments in which one does not need high cognitive abilities, they still have to pay the costs of such abilities but can no longer benefit from them.This puts them at a disadvantage compared to locally adapted, i.e. less smart, residents.Alternatively, when high-L individuals settle in complex environments, they need to learn coping with new conditions.While their advanced learning abilities are helpful in this regard, their lack of previous experience in this environment puts them at a disadvantage compared to non-dispersing locals who enjoy a head start in benefiting from their learned skills.
In contrast, individuals adopting a low-learning cognitive style may not suffer as much from loss of familiarity when dispersing, given their specialization on easy-to-access resources for which one does not need experience.Therefore, under such circumstances, low-learning individuals pay lower costs of dispersal and we can find a negative correlation between D and L. It might therefore be expected that typical 'proactive' individuals as described in the personality literature (reviewed by Sih et al. 2004, Cote et al. 2010) have higher dispersal tendencies than 'reactive' individuals.Conversely, when easy-to-access resources are not available in all patches, a positive correlation between D and L may arise because low-learners who end up in the 'wrong' kind of patch perform very poorly, whereas high-learners perform moderately well even in patches where there is not much to learn.In this situation high learning styles essentially function as a generalist strategy for coping with spatial heterogeneity.Due to the somewhat abstract and simplified nature of our model, however, it is hard to predict a priori what kind of correlation between dispersal and learning abilities should be more commonly observed in nature.One line of evidence suggests that successful invasive species tend to be large-brained and seemingly cognitively advanced (Sol et al. 2005, 2008, Amiel et al. 2011).However, given that many invasive species were introduced by humans (Sol et al. 2005, 2008, Amiel et al. 2011), invasiveness does not necessarily imply high dispersal tendencies.Other factors, such as a lack of natural enemies in the new area, may be more important for invasiveness.Moreover, our predictions about dispersal in any given generation cannot readily be extrapolated to multi-generational invasions.For example, the mechanism (namely, loss of familiarity) which sometimes puts cognitively advanced dispersers at a disadvantage in our model does not extend to the dispersers' descendants.
It is worth noting that studies showing a positive correlation between invasion success and learning abilities are mostly done with long-living species such as birds and mammals (Sol et al. 2005(Sol et al. , 2008)).The longer individuals live in their new environment, the more time they have to learn and to recoup their investment into cognitive abilities (comapre Maspons et al. 2019).This mechanism leads us to hypothesize that the higher the longevity of species, the more likely cognitively advanced dispersers can settle successfully in new environments.It would be interesting to investigate if such a three-way correlation between longevity, cognition and dispersal tendencies (compare Maspons et al. 2019) can be found both between similar species and between individuals of the same species.
As mentioned above, a correlation between learning abilities and dispersal requires sufficient variation in learning abilities, which in turn requires a suitable balance among parameters (for example, learning costs, the severity of intraspecific competition and predation, resources abundancies) that might otherwise make learning abilities uniformly high or low.
Predation pressure has a complicated effect.When predator lethality is weak, it can favour investment into higher (anti-predator) learning abilities to reduce mortality risk.If predation pressure becomes so severe that even fast learners cannot substantially reduce the mortality risk, the benefits of learning are diminished, which reduces the mean L of the population and, of course, affects any correlation between D and L accordingly.
Another finding was that when patches with suitable habitats become frequent, higher dispersal tendencies evolve for a given cognitive style in our model.This reflects the fact that a reduced risk of arriving in unsuitable habitat effectively reduces the costs of dispersal (other things being equal).The finding that we also observe high dispersal rates for very rare habitats is explained by a high number of immigrants originating from more frequent habitats types, with correspondingly high dispersal tendencies.This strikes us as a plausible prediction that could be tested in empirical studies of dispersal tendencies in a heterogeneous metapopulations.
Finally, the comparison of simulations with and without dispersal shows that dispersal can stabilize the existence of different phenotypes within patches.Here we simulated the coexistence of two cognitive styles with low versus high learning abilities.Depending on the resource parameter settings, these slow-versus fast-learning styles, could, in principle, have low or high exploration tendencies and thus could either match or mismatch the styles as described in the proactivereactive framework (Sih and Del Giudice 2012).Which cognitive styles was more prone to extinction, and thus depended more heavily on dispersal, was determined by their relative frequencies in the metapopulation.The stabilizing effect of dispersal was presumably caused by immigrants recolonizing patches in which one phenotype had gotten extinct.By contrast, although phenotypes may also be re-introduced by mutation, mutation alone proved insufficient to stabilize the coexistence of alternative phenotypes -even though we assumed rather high mutation rates.These results stress the potential importance of dispersal for the preservation of biodiversity not only at the community level (Loreau et al. 2003, Low-Décarie et al. 2015, Thompson and Fronhofer 2019) but also within species.The maintenance of trait variation within populations may facilitate evolutionary responses to changing conditions, such as evolutionary rescue, and thereby strongly affect the stability of ecosystems (Bourne et al. 2014, Bell 2017).In this way our study hints at how cognitive abilities, dispersal and evolutionary rescue may act in concert to prevent extinction.

Figure 1 .
Figure 1.Positive correlation between dispersal and learning ability, in a metapopulation consisting of 12 patches, N = 100, G = 500.Half of the patches consist of environments with easy-to-access resources (red curve in the density plots).The other half consist of environments with resources requiring learning to access them (turquoise curve in the density plots).Scatterplot shows the frequency of individuals with specific combinations of trait values in the whole metapopulation.Upper density-plot shows densities of trait L values and right-hand density-plot shows densities of trait D values for the two different environmental types.

Figure 2 .
Figure 2. Negative correlation between dispersal and learning ability, in a metapopulation consisting of 12 patches, N = 100, G = 500.All patches consist of environments with easy-to-access and hard-to-access resources.Half of patches contain one type of hard-to-access resources (red curve in the density plots) and the other half contain another type of hard-to-access resources (turquoise curve in the density plots).When dispersing to a patch type different from its natal patch, individuals specialised on hard-to-access resources could not use past experience and needed to learn anew.Scatterplot shows the frequency of individuals with specific combinations of trait values in the whole metapopulation.Upper density-plot shows densities of trait L values and right-hand density-plot shows densities of trait D values for the two different environmental types.

Figure 3 .
Figure 3.Each panel shows the distribution of individuals with specific combinations of trait values: L on the x-axis and E on the y-axis.Dark blue indicates lower, light blue higher number of individuals with the same trait combination.Each panel represents one simulation run with a metapopulation consisting of 24 patches, N = 100, G = 500.The left-hand side columns show results for simulations without dispersal; the right-side columns show results for simulations in which dispersal was permitted.