Cognition Evolves with the Emergence of Environmental Patchiness

Many lifeforms are found in patches that other lifeforms forage for and consume. Here we explore how the patchiness of the former and cognition of the latter may emerge through mutual interaction in an agent-based model. We use a simple 2D grid world consisting of two types of agents—plants (prey) and animals (predators). Across three experiments, we investigate how cognition of animals influences patchiness of plants and evolves in response to it. Here, cognition is a probabilistic model with two parameters, one for distance of perception and the other for determinacy versus stochasticity of movement. We found that plant patchiness emerged alongside the evolution of animal cognition. In addition, greater distance of perception reduced patchiness, while greater determinacy of movement increased patchiness. Conversely, greater patchiness of plants led animals to evolve perception across greater distances but also led to evolution of less deterministic foraging. Environmental patchiness and foraging cognition thus appeared to mutually create a stable dynamic interaction leading to a self-regulating system.


Introduction
Most forms of life are patchily distributed (e.g., forests of trees, herds of deer). Such distributional patterns of the environment greatly influence the cognition and behavior of organisms that evolve within it. For instance, studies in ecology have found that animals living in environments where their food comes in patches have evolved near-optimal cognitive strategies for foraging (Krebs, Ryan, & Charnov, 1974). Similar findings are also reported in artificially simulated foraging studies. Todd and Yanco (1996) evolved simple agents ("minimats") in grid worlds with varying environmental patchiness. They found that agents evolved looping movements that allowed them to regularly return to patches of regrowing resources. Similarly, in Hills' (2004) simulations, agents evolved simple memorybased policies that restricted search to areas with resources. Roberts and Goldstone's (2006) behavioral studies and agentbased models found that foragers initially used locations of other foragers as indicators of potential food-an effective strategy when food is patchy.
The majority of such existing studies focus on the unidirectional influence of patchiness on cognition. Hence, in such investigations, patchiness is regarded as an independent variable that is mostly uninfluenced by the cognition and behavior of agents within it. For instance, in the agent-based model described in Hills (2006), areas of the grid world were pre-allotted as patches of resources and once these were consumed new resources could only regrow in those specified patches. Similarly, in other artificial life work, distributional structures of the environment are typically preordained, largely unaltered by agent interactions (e.g., Todd & Yanco, 1996).
While this approach is effective for studying the influence of patchiness on cognition, it neglects the mutual interaction between environmental patchiness and agent cognition that is representative of real-world patchiness. Distributions of ecological resources are not always static, but rather are emergent, dynamic, and sensitive to the consumption behavior of agents interacting with them. While patchiness on larger scales may be static and dependent on extrinsic factors (e.g., climatic conditions prevent uniform distributions of species), small-scale patchiness is more dynamic and dependent on species interactions (Levin, 1992). For example, krill are patchily distributed on multiple scales of analyses-while on broader scales, their distribution is influenced by temperature and other habitat necessities, on smaller scales their patchiness emerges autonomously through food search behaviors (Hamner et al., 1983). Evidence from ecological studies suggests many behavioral causes of patch formation including predation, competition, and aggregation (Deutschman et al., 1993). Such small-scale dynamic patchiness is ultimately what matters for cognitive evolution since individual behaviors occur in response to the environment at this level. Therefore, combining ecological evidence with results from cognitive modeling, it appears that dynamic patchiness both influences the evolution of cognition, and is influenced by evolved cognition in turn.
In the current work, we use agent-based modelling to investigate this dynamical interaction of patchiness and cognition in a simple two-trophic system (plants and animals). The animals forage for plants and both shift spatially and can evolve over time, enabling us to explore how cognition of animals interacts with patchiness of plants over short and long time-scales. Unlike some previous studies, in our model, plants can grow anywhere in the world, allowing their distribution to be uniform, random, or patchy. Our simulations start with a roughly uniform distribution of plants in the world; the distribution of plants that emerges subsequently depends on the consumption behavior of the animals, as dictated by their cognition. We imagine the animals as primitive organisms and use a simple two-parameter probabilistic model of perceptionbased decision-making for their cognition. The cognition parameters evolve via genetic selection depending solely on their adaptive benefit in the environmental structure. This approach allows the dynamic interaction between cognition and patchiness to freely emerge. We expect that patchiness in distribution of plants will emerge alongside evolution of animal cognition for finding and consuming plants.
The current work is structured as three experiments. In Experiment 1, we evolve the model described abovepatchiness and cognition are left unconstrained to determine if patchiness emerges as animals evolve cognition. In Experiment 2, we fix cognition parameters at various values to explore the influence of animal cognition on plant patchiness. Finally, in Experiment 3, we explore the corresponding reverse influence of patchiness on cognition. The three experiments together allow us to draw a holistic picture of the mutual interaction of cognition and patchiness.

The Model
The world in our model is a 2D square grid of 200×200 cells arranged in a toroid. On every time step, the two types of agents, plants and animals, can perform a small repertoire of basic behaviors if conditions for the behaviors are met. These behaviors regulate the amount of energy units an agent has during its lifespan. An agent starts with 10 energy units and it dies if it runs out. The regulatory behaviors are: 1) Eat. On every timestep, plants eat and gain 5 energy units of an invisible uniformly distributed resource (akin to sunlight). Since the resource consumed by plants is uniformly distributed, if left undisturbed, plants also become uniformly distributed. An animal can eat if it lands in a cell containing a plant-it then gains all energy units of the plant, causing the plant to die.
2) Metabolize. On every timestep, both plants and animals lose 3 energy units as a metabolic cost. Animals lose 1 additional energy unit (leading to a total 4 energy unit loss) which is the metabolic cost of their cognitive and movement abilities. Therefore, if an animal fails to find plants to eat for several timesteps, it will run out of energy units and die.
3) Reproduce. Both plants and animals reproduce asexually whenever they have more than 20 energy units. At this point, half their energy units are given to a single offspring which by default is "born" in a cell adjacent to theirs. This is a simplification of real-world dispersal-in many species (e.g., with dispersing seeds or eggs), birth-position of offspring is not always adjacent to parent-position. However, most species have a higher probability of shorter distances between birthpositions and parent-positions, justifying our simplification. We manipulate the extent of dispersal in Experiment 3 to observe its influence on cognitive evolution.
The parameters associated with these regulatory behaviors remain fixed for all agents within a given simulation-they do not evolve. The amount of energy units consumed and lost by agents through these behaviors was chosen arbitrarily. However, our results are robust to reasonable changes in these values. Results only diverge if these parameter values are changed drastically-for instance, if on every timestep, animals metabolized fewer energy units than plants, they would overpopulate the grid, producing catastrophic declines in plant populations, followed by an extinction of animal agents. Plant agents are introduced at timestep 1 and animal agents are introduced at timestep 300. This allows plants to first densely populate the grid, ensuring that when animals are introduced, there is enough food in the world, such that they do not die immediately due to starvation. Further, by timestep 300, plants become roughly homogeneously distributed-this ensures that any subsequent patchiness that emerges after introduction of animals is not a result of initial patchiness of plants.
For both plants and animals, we initially introduce only 20 agents, dropped at random grid positions. Population sizes increase as agents reproduce. One gridcell can only hold one agent at a time. If an animal moves into a plant cell, it eats the plant; if a plant is born into an animal cell, it fails to take birth; if two agents of the same type land on a cell (i.e., animal on animal cell or plant on plant cell), the agent with the higher number of energy units survives, while the other agent disappears from the grid.

Cognition
Unlike plant agents, animal agents in our simulations are capable of movement and minimal cognition, parameterized to produce variations in foraging behavior. By default, animal agents do a random walk, moving at a constant velocity of one grid cell per timestep. Hence, this limits their possible moves to one of their eight neighboring cells, the choice of which is made through cognition. The animals have basic smell-like perception and simple decision making for deciding where to move next, defined by two cognition parameters: 1) Perceptual strength. An animal agent calculates the food value of each one of its eight neighboring cells based on the amount of food it perceives that it can get from that cell, as well as from the other cells close to that one. Imagine that the animal takes a "sniff" in each of its adjacent cells and picks up the combined scent of any food in that cell and all the cells surrounding that one, decaying with increasing distance (depicted as darkness of blue in Figure 1). An animal's perceptual strength (PS), varying from 0.0 (lower range) to 1.0 (higher range), determines how strongly it perceives the surrounding grid cells. Strength of perception decays exponentially as distance of grid cells increases, at a rate specified by the animal's PS: (1) Here, d is the Chebyshev distance of grid cells to neighboring cell i , and Σfoodd is the total amount of food in all the cells that are exactly d distance from ℎ . For instance, an agent with PS=0 can only perceive food in its neighboring cells and has no perception beyond that (0 0 ⋅ Σfood0 + 0 1 ⋅ Σfood1 …). On the other hand, with PS=1, an agent can perceive all food in a radius of 20 grid cells with equal weight given to all (1 0 ⋅ Σfood0 + 1 1 ⋅ Σfood1 …). An intermediary PS value lets an agent perceive food from adjacent grid cells with greater strength than that from distant grid cells, as illustrated in Figure  1. We have capped the maximum distance that an animal can perceive to a radius of 20 grid cells to increase speed of computation. Further, given our agents' lifespan length (typically <20 steps), they are unlikely to evolve abilities to attend to food that is more than 20 grid cells away.
Intuitively, extreme values of PS are not adaptive. At low values, an agent will be unable to perceive distant food quantities and so cannot aim toward more promising directions of future food; and at high values, an agent would perceive both close and distant food similarly strongly and thereby not be able to attach greater value to immediate food.

2) Decision Determinacy:
After sniffing in the eight neighboring cells, the animal must decide which one it will move into. The food-based values of the neighboring cells, calculated as in Equation (1) based on an agent's PS, are converted into decision probabilities using the decision determinacy (DD) parameter (in range 0.0-1.0). It controls how deterministic or stochastic the resulting movement is. The choice of which cell to move into is calculated through a softmax function: where value(cell i ) is the food value of the neighboring cells calculated via Equation (1). The closer DD is to 0, the more equiprobable the movement to the eight neighboring cells becomes, with 0 leading to pure random movements. DD values close to 1 increase weighting of higher-value cells, leading to nearly deterministic movement to the cell with the highest value. Similar softmax functions have been used to produce stochastic movement in other foraging agent-based models (e.g., Roberts & Goldstone, 2006).
As with PS, agents tend to evolve intermediate values of DD-high values of DD can be less adaptive as they lead all agents to become stuck in local maxima of food. Very low values of DD are also less adaptive, as having some stochasticity in movement decisions enables animals to explore their environment for possibly better but not-yet-perceived sources of food. Further, it reduces competition for resources by leading agents to become more randomly distributed across the grid instead of congregating at the same local maxima. Figure 1 demonstrates intermediate values of this parameter. As can be seen, probability of movement (as indicated by darkness in shades of green) is higher for high valued cells (i.e., cells that have greater amounts of food close to them).
In Experiments 1 and 3, values of both cognition parameters are allowed to evolve over time. Adaptive cognitive abilities will help animals to consume higher quantities of food which in turn will enable them to survive longer and have more offspring. An offspring inherits its parent's cognition parameter values with some mutation. At mutation, a random number generated from a normal distribution (mean 0, SD 0.025), is added to the offspring's cognition parameters. Since plants are finite, animals need to compete for food and less fit agents die out. Hence, inheritance (with mutation) and competition lead the cognition parameters to become adapted to the environmental structure (which itself is changing through the agents' actions).

Patchiness
In our simulations in Experiments 1 and 2, patchiness is not manipulated, but emerges through plant-animal interactions. Throughout each run, we track the patchiness level of plants in the grid, using a variation of the Nearest Neighbor (NN) metric (Clark & Evans, 1954). This is a popular measure of patchiness used in ecology (e.g., Hubbell, 1979;Parrish, Viscido, & Grünbaum, 2002). For the NN calculation, the average distance of each agent to its nearest neighbor is calculated; this is then divided by the expected nearest-neighbor distance for a random spatial distribution of equivalent density, as derived from a Poisson distribution. Therefore, NN is equal to 1 if plants are randomly distributed, less than 1 if plants are patchy, and greater than 1 if plants are overdispersed. For ease of understanding, we used 1-NN as our measure of patchiness, so that greater values indicate greater patchiness, and 0 indicates a random distribution. With small variations, the NN calculation can be generalized to measure patchiness based on the 2 nd , 3 rd , 4 th or n th neighbor (Thompson, 1956). We measured NN using a wide range of n th neighbors and obtained similar results for all. In this paper, we report patchiness based on NN using the 5 th nearest neighbor, as it was most consistent across multiple simulations. Therefore, patchiness is calculated as follows: Figure 1: Functioning of cognition parameters. Darkness of blue illustrates perceptual strength as agent A calculates the food value from neighboring cells N1 and N2 (refer Eq. 1); only two cells are displayed here, but the process is repeated for all eight neighboring cells. Darkness of green illustrates the probability of movement to neighboring cells based on agent A's decision determinacy (refer Eq. 2). As can be seen, probability of movement is higher (green is darker) to neighboring cells that have larger amounts of food nearby. Figure 2 shows the patchiness values for different spatial distributions of agents. In our simulations, patchiness usually does not go higher than ~0.4. This is because our patchiness formula limits the upper range of patchiness values depending on plant population densities. For instance, if plant density is 0.25, the maximum patchiness value that can be theoretically achieved is 0.42; at higher densities, patchiness is further restricted.

Expt 1: Mutual Interaction of Cognition and Patchiness
We first ran simulations of the full model described above, wherein patchiness was free to emerge and cognition was free to evolve. Plants started with a roughly uniform distribution (patchiness ~0) and cognition parameters of animals (perceptual strength and decision determinacy) started at 0. Across the run, we expected animals to evolve higher values of cognition parameters through reproduction with mutation. Concurrently, we expected the distribution of plants to be driven to patchiness by the foraging behaviors of the animals (produced by their evolving cognition).

Results and Discussion
We ran 5 simulations, each consisting of 2000 timesteps-- Figure 3A displays the results for one representative simulation. Results are displayed for timestep 300 onward, when animals are introduced in the world and agent interactions begin to take place. Figure 3B displays a snapshot of the grid at the end of the simulation run. Results from all the simulations and videos can be found in our online Supplemental Materials.
Soon after the introduction of animals, patchiness and cognition parameters begin to escalate. The variables stop increasing and reach stable levels at around timestep 750. Across all 5 simulations, after timestep 750, plants have an average patchiness of 0.41 and animals achieve an average perceptual strength of 0.54 and an average decision determinacy of 0.6. The cognition parameters of all animals in the grid were normally distributed around these means.
As expected, animals evolved intermediary values of cognition parameters. Intermediary perceptual strength allows animal agents to perceive distant food while simultaneously prioritizing adjacent food. An interesting effect in our simulations is that artificially extending the life of agents (by changing the death threshold to -5 energy units) makes higher average values of PS evolve. This makes sense since animals that can live longer and are more resilient to low food consumption can afford passing up adjacent food for a higher amount of distant food. Decision determinacy also evolved to an intermediate level, enabling agents to be exploitative enough to move towards food while also allowing some beneficial exploration of unperceived fertile regions.
Correlations between patchiness and the cognition parameters across timesteps are high (0.80 for PS and 0.81 for DD; p<.001). These correlations primarily represent the simultaneous escalation of all variables from timestep 300 to 750. However, later in the simulation, oscillatory patterns of patchiness and cognition appear, with the parameters sometimes moving in the same direction and at other times in opposite directions. This might suggest a more dynamical relationship rather than a linear one, which we explore further in the following experiments.
In this model, increases in patchiness could be a result of possible confounds such as dispersal patterns of agents (here the birth-position of offspring is next to parent-position, which is likely to produce patchy growth). To help ensure that the emergent patchiness was due to an interaction with cognition and not due to such confounding variables, we ran simulations of a restricted cognition model, where cognition parameters of all animals were restricted to 0 with no mutation. Results of one simulation of this model are shown in Figure 3C and a snapshot of the final grid in Figure 3D. As can be seen, in this case, patchiness remained stagnant at around 0.03, suggesting that the high patchiness of the full model was due to the foraging of animals with higher levels of cognition rather than a confounding variable.
Results from this experiment provide support for our expectation that patchiness emerges alongside the evolution of cognition. Further, through our restricted cognition model, we establish that this emergence of patchiness is not just a result of other confounds. The oscillatory pattern of activity between the cognition and patchiness parameters across a simulation suggest a dynamical interaction between them. However, the nature of this dynamical interaction is not clear-which cognition parameters influence patchiness, and how is the cognition of animals influenced by the patchiness of plants? We tackle these questions in the next two experiments.

Expt 2: Influence of Cognition on Patchiness
The previous experiment showed that patchiness and cognition increased together, but did not reveal which of the two cognition parameters influenced patchiness and how-we explored this with the current experiment. Here, we systematically varied cognition parameters, fixing them to various values. At the end of each simulation, we measured patchiness to determine the influence of the cognition parameter combinations on patchiness. Hence, we did not let cognition evolve, and instead in each simulation all agents had the same cognition parameter value throughout. We ran five simulations of each of 121 parameter combinations-both PS and DD were fixed at values from 0 to 1 at 0.1 intervals. Each simulation was run for only 1000 timesteps, based on the observation that parameter values stabilized after the 750th timestep in Experiment 1.

Results and Discussion
Figure 4 displays average patchiness levels in the last 50 timesteps across the five simulations for various combinations of PS and DD. In some parameter combinations, animal agents in the grid went extinct before the 1000 steps were up. These simulations have been marked with numbers 1-5 on Figure 4, providing a count of the simulations with extinction of animals for that parameter combination. In these extinction simulations, average patchiness of the 50 timesteps before the extinction of animals is used. We present the data from before the extinction of animals because after their extinction plants grow uniformly across the grid with no foraging to limit their growth-hence results from after the extinction are not representative of the interaction between patchiness and cognition.
As can be seen in Figure 4, patchiness declined as perceptual strength increased. This is probably because at higher values of PS, animals prioritized movement toward larger amounts of plants, even if they were distant. Therefore, no patch of plants grew too large-if it did, it would attract animals who would then forage from it, leading to an overall uniform spread of plants. However, when agents had low PS, patchiness was high. In these simulations, animals only searched for food locally and remained and reproduced within those localities, allowing plants to grow elsewhere in the grid.
The opposite trend was found in the relationship between patchiness and decision determinacy-as DD increased, so did patchiness. This makes intuitive sense-at low levels of DD, animal movement and foraging were highly stochastic, allowing for more equal and random distribution of plants. On the other hand, at high levels of DD, animals were extremely exploitative and strongly attracted toward the highest-valued cells which allowed growth of plant patches in low-valued areas. Once those low-valued areas became more fertile than the high-valued cells being foraged on, the previously ignored low-valued areas would become the new points of attraction. Hence, patches of plants emerged and moved dynamically across the grid (videos can be found in online Supplemental Materials).
Patchiness was therefore highest when low PS was combined with high DD. These are also the simulations wherein extinction tended to occur. In these combinations, agents deterministically exploited nearby localities of food. They moved towards local maxima, and once they ran out of plants there, they did not have the perceptual strength to detect and find more distant food, leading to starvation. On the other hand, higher ranges of perception and higher levels of stochasticity enabled agents to explore more and continually move toward global maxima, preventing extinction.
The cognition parameter values that evolved in Experiment 1, a PS of ~0.5 and DD of ~0.6, are indicated by the star on Figure 4. Interestingly, these evolved parameter values are at the edge of the combinations that led to extinction. It is possible that being short-sighted and highly deterministic is a generally successful strategy, but if all agents followed such strategies it can produce instability, leading to extinction. Possibly, in simulations of Experiment 1, animals tended to evolve lower PS and higher DD to become more exploitative in local patches. This then led them to get stuck in local maxima and starve, letting the plants grow less patchy and giving an advantage to other animals with greater PS and lower DD. This dynamic would explain the oscillation patterns of cognition parameters and patchiness in Figure 3A.
This experiment clarifies how the cognition of foraging animal agents influences the patchiness of plant resources: Having low perceptual strengths and high decision determinacy leads to greater patchiness. However, so far, our simulations have not provided insight into the influence of patchiness on cognition-this is tackled in the next experiment.

Expt 3: Influence of Patchiness on Cognition
In this experiment, we artificially manipulated the patchiness of plants and measured its influence on the evolution of animal cognition parameters. Patchiness was manipulated by altering the dispersion of new plant offspring across experimental conditions. In our previous experiments, a new plant's birth position was always adjacent to the parent-hence, dispersion was minimal. In the current experiment, an offspring could potentially be placed some distance away from the parent; that is, dispersion could be greater. An offspring's birth position depended on the dispersion rate of that experimental condition: Here, distance (cell i , parent cell) is the distance between the grid cell under consideration and the parent cell; disp rate is the dispersion rate and was varied between 0 and 1 at 0.1 intervals across eleven experimental conditions.
In our simulations we found that dispersion rate had a roughly negative linear relationship to the patchiness measure. For instance, at a dispersion rate of 1, new offspring would occupy random positions in the grid, leading to patchiness of ~0 in the grid. On the other hand, a dispersion rate of 0 resembled our previous simulations wherein offspring always occupied adjacent cells and it represents the highest patchiness condition for this experiment. Thus, dispersion rate serves as a useful means of manipulating patchiness. (Directly manipulating patchiness by preallocating grid cells to resources would end up artificially restricting population sizes of the grid, hence altering population dynamics.) Furthermore, using intermediate values of dispersion in our simulations resembles real-world dispersal (Portnoy & Willson, 1993), allowing for possible comparison with field studies.
However, a drawback of the current patchiness manipulation is that we cannot produce a full upper range of patchiness values-the maximum patchiness value we could artificially generate was ~0.4 using a dispersion rate of 0. This arises primarily because the nearest neighbor metric restricts the upper range of values depending on the plant density. Refer to Figure 2 for visuals of the grid at varied values of patchiness.

Results and Discussion
Overall, the range of patchiness values we could produce (between 0 and 0.4) proved to be sufficient to observe its influence on the evolved cognition parameters of animals.
As in our previous experiments, five simulations were run for each of the 11 patchiness conditions. The distributions of evolved cognition parameters in the last 50 steps of all simulations across conditions are shown in Figure 5. For each condition, the x-axis indicates the mean patchiness value of the Figure 5: Distribution of cognition parameters in the last 50 steps across various patchiness conditions. Animals agents in the first two patchiness conditions went extinct (marked by the cross). The x-axis labels the average patchiness values along with the corresponding fixed dispersion rates (in brackets, bottom row) for the different conditions. (See Figure 2 for examples of corresponding patchiness levels.) With increases in patchiness, perceptual strength increases but decision determinacy decreases. Simple regression indicated significant influence of patchiness on both cognition parameters at p<.001 (results were significant with and without inclusion of the extinction conditions in the analyses).
last 50 steps averaged across all five simulations and the fixed dispersion rate (in brackets) that was used to achieve that patchiness value.
As seen in Figure 5A, greater values of perceptual strength evolved in higher patchiness conditions. This is perhaps because greater perceptual strength allows an agent to discriminate locations of patches, which might often be at a distance. However, in less patchy environments, food is randomly scattered around the agent and perceptual distance provides no discriminatory advantage. Instead, it is more advantageous for the animal to prioritize immediate food, as enabled by a lower perceptual strength in our simulations.
In contrast, there is a downward trend of decision determinacy with increasing patchiness ( Figure 5B). This might be because in patchy environments, where food locations across the grid are autocorrelated, some stochasticity is not harmful-if an agent has already found some food (in a patch), it is likely to find more food nearby regardless of the direction it moves in. In fact, extreme determinacy in patchy environments might be harmful as it would tend to draw animals to the same high-valued patches, leading to potentially lethal competition for resources. On the other hand, when plants are randomly scattered across the grid, animals need to be extremely deterministic in selecting and moving to the specific neighboring cells that hold plants.
Interestingly, PS and patchiness had an inverse relationship in Experiment 2 (increases in PS produced reductions in patchiness), but they have a direct relationship in Experiment 3 (increases in patchiness produced increases in PS). In a similar fashion, DD also displayed opposing trends across the two simulations-DD and patchiness had a direct relationship in Experiment 2 (increases in DD produced increases in patchiness), but they have an inverse relationship in Experiment 3 (increases in patchiness produced reductions in DD). These opposing patterns perhaps lead cognition and patchiness parameters to regulate each other in Experiment 1, where both variables are left unrestricted. For instance, as DD increases, patchiness increases; however, increases in patchiness produce reductions in DD (through starvation of high-DD agents), which in turn produces reductions in patchiness. This process could go on, preventing either parameter from reaching catastrophic extremes.
Animal agents in the lowest two patchiness conditions went extinct at around 500 steps in all five simulations (as depicted by the crosses in Figure 5). Further, population levels of agents (not depicted here) were stable at higher levels with increases in patchiness. This is in tune with ecological studies that found greater stability of population levels of predators and prey in patchy environments than in randomly dispersed environments (Huffaker, 1958;Monro, 1967). These studies argue that in patchy environments, small patches of prey obtain temporary refuge while predators exploit larger patches, allowing them to increase in size. These cycles of refuge and predation increase overall stability of prey populations, and of predators in turn. However, in random distributions, predation is more continuous, leading to massive declines in prey populations, followed by extinction of predators. Given the importance of dispersal rates in maintaining patch dynamics and stability of populations in our simulations, future work can use genetic algorithms to allow populations to evolve optimal dispersal rates.

General Discussion and Future Directions
Our three experiments explored the mutual interaction between cognition of animal agents (parametrized as perceptual strength and decision determinacy) and patchiness of plants. Experiment 1 showed that when both were left unrestricted, patchiness emerged alongside the evolution of cognition, suggesting a mutual interaction between them. In Experiment 2, we explored the unidirectional influence of cognition on patchiness, and found that increases in PS produced decreases in patchiness while increases in DD produced increases in patchiness. Next, in Experiment 3, we conversely looked at the influence of patchiness on cognition: greater patchiness evolved higher PS and lower DD. Thus together, Experiments 2 and 3 verified our expectation that cognition of animal agents influences the distribution of plants in the environment and in turn evolves in response to the distributional structure of the environment.
Further, we also found that patchiness and cognition potentially regulate each other through their pattern of interaction. For instance, as patchiness of plants increases, perceptual strength of animals also increases (because identifying distant patches is useful); increases in PS reduces patchiness of plants (because distant viewing allows for more uniform grazing of food); this reduction of patchiness then leads to reduction in PS, and the pattern continues. A similar pattern holds for decision determinacy, and PS and DD also both influence each other through their effects on patchiness. Figure 6 provides a quick summary of these causal interactions suggested by Experiments 2 and 3. This pattern of interactions is probably responsible for the oscillatory movements of parameters in Experiment 1 (see Figure 3). It also possibly regulated the evolved cognition parameters from escalating to values that would produce extinction (see Figure 4)-hence creating a self-regulating system.
Interactions in our study are examples of niche construction-ecological processes wherein organisms alter the selective environment of future generations, leaving behind an ecological inheritance in addition to a biological one (Laland, Odling-Smee, & Feldman, 1999). There has been considerable research on niche construction within the artificial Exp 2 life field, from Harvey's (2004) Daisyworld model where differentially reproducing organisms regulated climatic conditions to remain within habitable ranges, to Chiba et al.'s (2016) simulation of the evolution of building physical structures that last across generations. Our study provides an intermediate example of self-regulating effects of niche construction-here, plants and animals impact each other's locations (hence creating the environment for subsequent generations), and through their mutual influence, patchiness and cognition parameters are maintained within specific ranges.
Across our simulations, population sizes of animal and plant agents showed Lotka-Volterra style population dynamics (Lotka, 1920)-see Supplemental Materials. This provides a strong parallel to real world predator-prey systems, as have been found in other artificial life simulations (Yang et al., 2018). In our simulations where agents went extinct, the Lotka-Volterra dynamics were extremely chaotic, leading ultimately to population crashes.
A limitation of our study is the instantiation of cognition as a simple two-parameter probabilistic model. It provides us the benefit of interpretability through a reduced representation of common real-world foraging search. However, real animals have evolved a wide variety of cognitive search strategies that are not accounted for by our model. Future work can explore other cognitive models of search (e.g., memory-based area restricted search- Hills, 2006) or use neural networks that are less presumptive of the cognitive model.
The current work also focused on prey (plants) that were immobile. If modeled prey were capable of movement (like fish, deer), active aggregation behaviors such as schooling and flocking could arise. Previous research has shown that flocking can emerge in simple predator-prey systems with limited sensation-action abilities (Sunehag et al., 2019). Our research makes a useful contribution in demonstrating how aggregation can emerge in prey without active aggregating behavior on their part, simply through the impact of evolved search patterns of predators.