Paper deep dive
Boids of a Feather Flock Together - Evolving Prey Behaviours Under Different Predator Attack Strategies
Augusta van Haren, Hanna Hoogen, Luca Pattavina
Intelligence
Status: not_run | Model: - | Prompt: - | Confidence: 0%
Entities (0)
Relation Signals (0)
No relation signals yet.
Cypher Suggestions (0)
No Cypher suggestions yet.
Abstract
Abstract:Flocking and schooling are thought to have evolved partly as defences against predation, but how prey should balance social and escape tendencies may depend on the predator's hunting strategy. We extend the predator-prey boids model of Ojo et al. (2023), itself based on Reynolds' boids, by combining six prey movement tendencies (alignment, cohesion, separation, dodge, repel and wiggle) into a single weighted acceleration update, and by reformulating wiggle as a sinusoidal manoeuvre. We then use an evolutionary strategy to optimise the six behaviour coefficients for collective prey survival against four predator hunting strategies: attack-centroid, attack-nearest, attack-random and attack-peripheral. Across five independent trials per strategy, coefficients converged within trials and mean fitness remained stable or increased, although trials often settled in different local optima. Prey survival was highest under attack-centroid and lowest under attack-nearest, in line with our hypotheses. Against attack-centroid, prey evolved individualistic predator avoidance with high escape coefficients, whereas against the other three strategies they largely kept their flock formation. Across all strategies, evolution favoured a low repel coefficient and relatively high dodge and wiggle coefficients. Our results suggest that optimal anti-predator behaviour depends on the interplay between escape tendencies and the predator's hunting strategy.
Tags
Links
- Source: https://arxiv.org/abs/2609.37885v1
- Canonical: https://arxiv.org/abs/2609.37885v1
Trouble viewing inline? Open PDF directly →
Full Text
67,577 characters extracted from source content.
Expand or collapse full text
Boids of a Feather Flock Together — Evolving Prey Behaviours Under Different Predator Attack Strategies Augusta van Haren Affiliation: Radboud University Hanna Hoogen Affiliation: Radboud University Luca Pattavina Affiliation: Radboud University September 29, 2026 All authors contributed equally. Abstract Flocking and schooling are thought to have evolved partly as defences against predation, but how prey should balance social and escape tendencies may depend on the predator’s hunting strategy. We extend the predator–prey boids model of Ojo et al. (2023), itself based on Reynolds’ boids, by combining six prey movement tendencies (alignment, cohesion, separation, dodge, repel and wiggle) into a single weighted acceleration update, and by reformulating wiggle as a sinusoidal manoeuvre. We then use an evolutionary strategy to optimise the six behaviour coefficients for collective prey survival against four predator hunting strategies: attack-centroid, attack-nearest, attack-random and attack-peripheral. Across five independent trials per strategy, coefficients converged within trials and mean fitness remained stable or increased, although trials often settled in different local optima. Prey survival was highest under attack-centroid and lowest under attack-nearest, in line with our hypotheses. Against attack-centroid, prey evolved individualistic predator avoidance with high escape coefficients, whereas against the other three strategies they largely kept their flock formation. Across all strategies, evolution favoured a low repel coefficient and relatively high dodge and wiggle coefficients. Our results suggest that optimal anti-predator behaviour depends on the interplay between escape tendencies and the predator’s hunting strategy. 1 Introduction Among many lifeforms, complex collective behaviour can emerge from simple social interactions, as seen in flocks of birds, schools of fish, and insect colonies. In a group, individuals influence one another and adapt their behaviour relying only on local neighbourhood information. However, such behaviour does not take place in isolation from the environment; together they form a complex, dynamical system. For example, individuals of different species or groups can interact and form predator and prey relationships. Both predators and prey have to evolve dynamic, adaptive behaviours to survive. Collective behaviours, such as schooling and flocking, may have evolved to decrease predation losses by confusing the predator or collectively organising information within a group of agents with limited information (Kunz et al., 2006). These collective behaviours can be governed by simple local rules. A classic example is the boids model by Reynolds (1987). This model simulates realistic flocking, which can be used to learn about flock behaviour in different scenarios through artificial boid simulations. One such scenario is the presence of a predator, where the trade-off between behavioural tendencies becomes crucial for survival (Palmer and Packer, 2021; Lee et al., 2006). In this work, we evolve optimal prey escape behaviour based on local rules, under different predator attack strategies. To evolve the optimal behaviours, we again look at nature – algorithms inspired by evolution are useful for solving optimisation problems without relying on gradients (Beyer and Schwefel, 2002; Slowik and Kwasnicka, 2020). Here, we use an evolutionary strategy (ES) to optimise continuous behaviour coefficients. 1.1 Research Question The aim of this work is to implement an extended version of Ojo et al.’s predator-prey model (2023), which is based on Reynolds’s boids model (1987). We enhance this previous work by combining six prey behaviour tendencies (alignment, cohesion, separation, dodge, repel, wiggle) into one behaviour vector that governs the boids’ acceleration. Further, we apply an ES to find the optimal coefficients for the behaviour tendencies for four different predator attack strategies. Moreover, we make small improvements to the behaviour implementations. With this setup, we then aim to answer the following research question: What movement behaviour (in terms of relative contributions of alignment, cohesion, separation, dodge, repel and wiggle tendencies) do prey evolve to, in order to maximise the collective survival of their population under different predator hunting strategies? We hypothesise that specific combinations of prey behaviour coefficients are optimal under different predator strategies, leading to distinct flocking and escape dynamics. Further, we expect the prey to achieve the highest survival rate under the “attack-centroid” predator strategy, as the centroid does not necessarily correspond to a specific boid, making the strategy inefficient (Demšar and Lebar Bajec, 2014). Moreover, we hypothesise that prey achieve the lowest survival rate under the “attack-nearest” strategy, as this strategy is simple but effective (von Moll et al., 2016). 1.2 Related Work Reynolds’s (1987) boids model provides the fundamental structure for simulating flocking behaviour and agent-movement, as governed by three principles: alignment, cohesion, and separation. We further build on the extension of the Reynolds’ boids model of Ojo et al. (2023), who implemented two classes of boids: predator and prey. Ojo et al. (2023) further provide four predator attack strategies (attack-centroid, attack-nearest, attack-random, attack-peripheral) and three escape behaviours (dodge, repel, wiggle), which govern the prey’s behaviour together with the classic boid principles. While relying heavily on the simulation implementation by Ojo et al. (2023), we make several key improvements. Most crucially, Ojo et al. (2023) analyse the prey’s flocking behaviour together with one of the prey escape tendencies in isolation. Instead, we combine all three behaviours together with the flocking principles into one acceleration update vector – allowing the prey to make use of all escape tendencies simultaneously, and learn the most effective behaviour for a given predator’s hunting strategy. Furthermore, in analogy with Reynolds’s (1987) boids model, we treat this prey’s acceleration update vector as a weighted sum of all of its components – whereas Ojo et al.’s (2023) implementation did not assign distinct weights for every movement tendency. Moreover, we further improve their wiggle behaviour, which we describe in more detail in Section 2.1, and performed sensitivity analyses on key simulation parameters. Other studies, similar to Ojo et al. (2023) investigated predator and prey strategies, like (Demšar and Lebar Bajec, 2014) who explored the effect of different predator strategies (attack-centroid, attack-nearest, attack-peripheral) on social and individualistic prey and found flocking to be the optimal anti-predatory behaviour – they further characterised the escape patterns exhibited by the prey, similar to Lee et al. (2006). The models described so far, relied on pre-specified behaviours and strategies with fixed parameters. We instead aim to learn prey behaviours using an ES (Beyer and Schwefel, 2002; Slowik and Kwasnicka, 2020). Previous studies similarly attempted to learn predator or prey behaviours; for example, Alaliyat et al. (2022) used a genetic algorithm (GA) to evolve the boids coefficients to achieve realistic flocking behaviour. Similarly, Hahn et al. (2019) used reinforcement learning in a predator-prey simulation to learn the prey’s strategy, which resulted in flocking behaviour similar to the boids model to confuse the predator. Furthermore, Kunz et al. (2006) used an evolutionary algorithm to evolve prey behaviour while varying predator parameters. Oboshi et al. (2002) used a GA to evolve prey evasion behaviour for one attack strategy (attack-nearest) in a simulation setup similar to ours. However, all of these studies operated on a more basic level than ours, by focusing on learning general collective behaviours like flocking and swarming – instead of specific escape strategies to avoid a predator. Few studies tried to evolve more sophisticated behaviours in a predator-prey scenario; von Moll et al. (2016) focused on evolving predator strategies in a scenario with two predators by using a GA. Similarly to our work, they evolved coefficients for a fixed set of atomic behaviours (pursue, converge, diverge, drive, flank) – however, targeting predators rather than prey. Moreover, Chen et al. (2006) use a GA to evolve coefficients in a linear combination of behaviours, consisting of the classic boid principles, as well as obstacle avoidance, following feed, and avoiding a predator. However, they only implement a direction-based escape behaviour (corresponding to “dodge”) and do not present any proper results. To summarise, our work extends the existing literature by using an evolutionary strategy (ES) to perform continuous optimisation on the coefficients for a combination of prey behaviours to avoid predation under different predator attack strategies. 2 Methods All analyses were performed using Python 3.11.9 on Windows. The code, result files, and sample simulation videos are available under https://github.com/ivychad/NC-Project-Code-Boids. We provide an in-depth explanation for the choice of all fixed parameters in Appendix A. 2.1 Boids Model To study our research question, we adapted the flocking model of Ojo et al. (2024). This implementation is an extension of Reynolds’s boids model (1987) – which dictates that the movement dynamics of each boid are based on three rules: alignment, cohesion, and separation. Ojo et al. (2024) extend this model by defining two types of boids, predator and prey B∈Bpred,BpreyB∈\B^pred,B^prey\, that each have distinct rules which govern their movement behaviour. Furthermore, they add realism to various aspects of the original model. We have refined their approach by combining the six movement tendencies into one acceleration update vector, by enhancing realism of the wiggle tendency, and by evolving the optimal coefficients for the relative contribution of each of those tendencies using an ES. The implementation equips every boid B with a position (B)∈ℝ2p(B) ^2 and velocity (B)∈ℝ2v(B) ^2. In each iteration of the simulation, the imposed acceleration (B)∈ℝ2a(B) ^2 on the boid determines its dynamics of motion: (B) (B) ←(B)+(B)⋅dt \ ←\ v(B)+a(B)· dt (B) (B) ←(B)+(B)⋅dt+12(B)⋅dt2 \ ←\ p(B)+v(B)· dt+ 12\ a(B)· dt^2 In the traditional boids model, updates in the boid’s acceleration and velocity are effectively unbounded. As this is physically unrealistic, Ojo et al.’s (2024) implementation limits the direction as well as magnitude of acceleration. This implies that if the angle between the boid’s current velocity v(B)v(B) and the imposed acceleration a(B)a(B) exceeds the maximum rotation angle (|∠(^(B),^(B))|>θmaxpred,prey| ( a(B), v(B) )|> _max^pred,prey), the updated acceleration vector is limited to ^(B)=R(±θmaxpred,prey)^(B) a(B)=R(± _max^pred,prey)\ v(B) in the given direction (R is the rotation matrix), and rescaled to ‖(B)‖=apred,prey||a(B)||=a^pred,prey (Ojo et al., 2023). Together, this limits the turn speed of the boid. Moreover, the magnitude of velocity of the boid is bounded to ‖(B)‖=vpred,prey||v(B)||=v^pred,prey. All bounds are specific to the prey or predator dynamics, and manually adjusted to model realistic behaviour, see Appendix A. Lastly, all boids are assigned a (predator- and prey-specific) perception radius rPpred,preyr_P^pred,prey, separation radius rSpred,preyr_S^pred,prey, and a perception angle fovpred,preyfov^pred,prey. For each movement tendency, these parameters determine which other boids BiB_i are ‘seen’, and considered a ‘neighbour’ of B. In the traditional boids model, this only depends on Euclidean distance dist(B,Bi)=||(B),(Bi)||2<rP,Spred,prey2 dist(B,B_i)=||p(B),p(B_i)||_2<r_P,S^pred,prey^2), as if both predators and preys had a field of view of 360°. However, to enhance realism, Ojo et al. (2024) also requires neighbours to be within B’s visual field (inFov(B,Bi)=trueinFov(B,B_i)=true). This condition entails that BiB_i is within B’s field of view (delimited by fovpred,preyfov^pred,prey). In addition, BiB_i should not be occluded by another boid (occluded(B,Bi)=falseoccluded(B,B_i)=false). In this definition, neighbour BiB_i occludes BjB_j if they are separated by less than 2°2 in B’s visual field, and BiB_i is closer than BjB_j. This results in excluding BjB_j to be a neighbour of B (Ojo et al., 2023). 2.1.1 Predator For a predator boid B:=BpredB:=B^pred with corresponding predator parameters, its acceleration (B)a(B) is governed by either one of the following hunting strategies (Ojo et al., 2024; Ojo et al., 2023). These strategies are in line with the attack strategies proposed by Demšar and Lebar Bajec (2014): ^(B)∈^(B),^(B),^(B),^(B). a(B)∈\ a_attc(B), a_attn(B), a_attr(B), a_attp(B)\. Its acceleration and velocity are limited as described above. The hunting strategies each characterise a specific movement behaviour: • Attack-centroid: B targets the average position of all its neighbouring prey boids BipreyB^prey_i ^(B)=∑i=1NB((Biprey)−(B))NB a_attc(B)\ =\ _i=1^N_B(p(B^prey_i)-p(B))N_B where each of the NBN_B neighbouring prey boids BipreyB^prey_i satisfy dist(B,Biprey)<rPpred2∧inFov(B,Biprey)=true∧occluded(B,Biprey)=falsedist(B,B^prey_i)<r_P^pred^2\ \ \ \ inFov(B,B^prey_i)=true\ \ \ \ occluded(B,B^prey_i)=false • Attack-nearest: B targets the position of the nearest neighbouring prey boid BtpreyB^prey_t ^(B)=(Btprey)−(B) a_attn(B)\ =\ p(B^prey_t)-p(B) where Btprey=argminBipreydist(B,Biprey)B^prey_t= _B^prey_idist(B,B_i^prey ) is closest to B out of the set of NBN_B neighbouring prey boids of which each BipreyB_i^prey satisfies dist(B,Biprey)<rPpred2∧inFov(B,Biprey)=true∧occluded(B,Biprey)=falsedist(B,B^prey_i)<r_P^pred^2\ \ \ \ inFov(B,B^prey_i)=true\ \ \ \ occluded(B,B^prey_i)=false • Attack-random: B targets the position of a random neighbouring prey boid BtpreyB^prey_t ^(B)=(Btprey)−(B) a_attr(B)\ =\ p(B^prey_t)-p(B) where Btprey∼B1prey,…,BNBpreyB^prey_t \B_1^prey,…,B_N_B^prey\ is chosen randomly from the set of NBN_B neighbouring prey boids of which each BipreyB^prey_i satisfies dist(B,Biprey)<rPpred2∧inFov(B,Biprey)=true∧occluded(B,Biprey)=falsedist(B,B^prey_i)<r_P^pred^2\ \ \ \ inFov(B,B^prey_i)=true\ \ \ \ occluded(B,B^prey_i)=false • Attack-peripheral: B targets the position of the most peripheral prey boid BtpreyB^prey_t ^(B)=(Btprey)−(B) a_attp(B)\ =\ p(B^prey_t)-p(B) where Btprey=argmaxBiprey(∑j=1NB(Bjprey)NB−(Biprey))B^prey_t= _B^prey_i ( _j=1^N_Bp(B^prey_j)N_B-p(B_i^prey) ) is most isolated from the centroid of the NBN_B neighbouring prey boids of which each BipreyB_i^prey satisfies dist(B,Biprey)<rPpred2∧inFov(B,Biprey)=true∧occluded(B,Biprey)=falsedist(B,B^prey_i)<r_P^pred^2\ \ \ \ inFov(B,B^prey_i)=true\ \ \ \ occluded(B,B^prey_i)=false 2.1.2 Prey For a prey boid B:=BpreyB:=B^prey with corresponding prey parameters, its acceleration (B)a(B) constitutes a superposition of multiple movement tendencies. As an extension upon Ojo et al. (2024)’s implementation, we combine all movement tendencies as a weighted sum into an acceleration update vector. Each tendency’s sub-acceleration ^□ a_ is weighed by a corresponding coefficient c□c_ , hereby contributing to the (normalised) direction of acceleration: ^(B)=norm(cali⋅^ali(B)+coh⋅^coh(B)+csep⋅^sep(B)+CLOSE a(B)\ =\ norm (c_ali· a_ali(B)+c_coh· a_coh(B)+c_sep· a_sep(B)\ + OPENcdod⋅^dod(B)+crep⋅^rep(B)+cwig⋅^wig(B)) \ \ \ c_dod· a_dod(B)+c_rep· a_rep(B)+c_wig· a_wig(B) ) Its acceleration and velocity are limited as described above. The first three movement tendencies give rise to the boids flocking behaviour (Ojo et al., 2023; Ojo et al., 2024; Reynolds, 1987): • Alignment: B matches the average direction and speed of all its neighbouring boids BipreyB^prey_i (consistent direction flocking) ^(B)=norm(∑i=1NB(Biprey)NB−(B)) a_ali(B)\ =\ norm ( _i=1^N_Bv(B^prey_i)N_B-v(B) ) where each of the NBN_B neighbouring prey boids BipreyB^prey_i satisfy dist(B,Biprey)<rPprey2∧inFov(B,Biprey)=true∧occluded(B,Biprey)=falsedist(B,B^prey_i)<r_P^prey^2\ \ \ \ inFov(B,B^prey_i)=true\ \ \ \ occluded(B,B^prey_i)=false • Cohesion: B matches the average position of all its neighbouring prey boids BipreyB^prey_i (localised flocking) ^(B)=norm(∑i=1NB((Biprey)−(B))NB) a_coh(B)\ =\ norm ( _i=1^N_B(p(B^prey_i)-p(B))N_B ) where each of the NBN_B neighbouring prey boids BipreyB^prey_i satisfy dist(B,Biprey)<rPprey2∧inFov(B,Biprey)=true∧occluded(B,Biprey)=falsedist(B,B^prey_i)<r_P^prey^2\ \ \ \ inFov(B,B^prey_i)=true\ \ \ \ occluded(B,B^prey_i)=false • Separation: B repels the positions of all its neighbouring prey boids BipreyB^prey_i (preventing collisions) ^(B)=norm(∑i=1NB((B)−(Biprey))) a_sep(B)\ =\ norm ( _i=1^N_B(p(B)-p(B^prey_i)) ) where each of the NBN_B neighbouring prey boids BipreyB^prey_i satisfy dist(B,Biprey)<rSprey2∧inFov(B,Biprey)=true∧occluded(B,Biprey)=falsedist(B,B^prey_i)<r_S^prey^2\ \ \ \ inFov(B,B^prey_i)=true\ \ \ \ occluded(B,B^prey_i)=false The remaining tendencies characterise escape manoeuvres to flee from the predator. We implemented three distinct escape behaviours (Ojo et al., 2023; Ojo et al., 2024), as first introduced in the empirically-based Homing Pigeons Escape (HoPE) (Papadopoulou et al., 2022): • Dodge: B dodges approaching predator boids BipredB^pred_i, by turning perpendicularly in the opposite direction (direction-based escaping) ^(B)=norm(∑i=1MBR(+90°)^(B)if ∠(^(B),^(Bipred))≤0°R(−90°)^(B)if ∠(^(B),^(Bipred))>0°) a_dod(B)\ =\ norm ( _i=1^M_B \ array[]lR(+90 )\ v(B)&if ( v(B), v(B^pred_i) )≤ 0 \\ R(-90 )\ v(B)&if ( v(B), v(B^pred_i) )>0 array . ) where each of the MBM_B neighbouring predator boids BipredB^pred_i satisfy dist(B,Bipred)<rPprey2∧inFov(B,Bipred)=true∧occluded(B,Bipred)=falsedist(B,B^pred_i)<r_P^prey^2\ \ \ \ inFov(B,B^pred_i)=true\ \ \ \ occluded(B,B^pred_i)=false • Repel: B repels the positions of all approaching predator boids BipredB^pred_i (position-based escaping) ^(B)=norm(∑i=1MB((B)−(Bipred))) a_rep(B)\ =\ norm ( _i=1^M_B(p(B)-p(B^pred_i)) ) where each of the MBM_B neighbouring predator boids BipredB^pred_i satisfy dist(B,Bipred)<rPprey2∧inFov(B,Bipred)=true∧occluded(B,Bipred)=falsedist(B,B^pred_i)<r_P^prey^2\ \ \ \ inFov(B,B^pred_i)=true\ \ \ \ occluded(B,B^pred_i)=false • Wiggle: B wiggles by some wiggle angle θwig _wig and frequency fwigf_wig if a predator is near (shake-off escaping) ^(B)=R(θwig,fwig)^(B)if MB>0^(B)if MB=0 a_wig(B)\ = casesR( _wig,f_wig)\ v(B)&if $M_B>0$\\ v(B)&if $M_B=0$\\ cases where each of the MBM_B neighbouring predator boids BipredB^pred_i satisfy dist(B,Bipred)<rPprey2∧inFov(B,Bipred)=true∧occluded(B,Bipred)=falsedist(B,B^pred_i)<r_P^prey^2\ \ \ \ inFov(B,B^pred_i)=true\ \ \ \ occluded(B,B^pred_i)=false We enhanced (Ojo et al., 2024)’s wiggle behaviour implementation by redefining the wiggle in terms of a sine wave with specific angle and frequency, to resemble more naturalistic behaviour. 2.1.3 Simulation To analyse the emerging movement behaviour of the boids, a field of Sx×SyS_x× S_y is initialised with M predators and N prey. Governed by their predator- and prey-specific parameters and coefficients, movement behaviour will naturally emerge. When a predator ‘catches’ a prey (dist(Bipred,Bjprey)≤(rSpred)2dist(B_i^pred,B_j^prey)≤(r_S^pred)^2), this prey is removed from the field. 2.2 Evolutionary Strategy (ES) To study the research question at hand, we constructed an Evolutionary Strategy (ES) (Beyer and Schwefel, 2002; Slowik and Kwasnicka, 2020) around the aforementioned simulation. This ES consists of gN_g generations, of which each generation runs sN_s simulations – defining the population size. Each simulation then denotes one individual of the population, and each simulation is run for a simulation time of T steps – having a fixed number of predators (M) and prey (N), a fixed set of predator and prey parameters, and a fixed predator hunting strategy ^(B)∈^(B),^(B),^(B),^(B) a(B)∈ \ a_attc(B), a_attn(B), a_attr(B), a_attp(B) \. Crucially, the prey coefficients are variable across simulations, and thereby characterise the movement dynamics of a unique simulation. Therefore, we define the ‘gene’ of a simulation s as their prey coefficients, gene(s):=⟨calis,cohs,cseps,cdods,creps,cwigs⟩gene(s):= c_ali_s,c_coh_s,c_sep_s,c_dod_s,c_rep_s,c_wig_s . 2.2.1 Fitness The fitness of a simulation s, denoted f(s)f(s), is defined from the prey’s perspective, and reflects the number of surviving prey N≤N_T≤ N at the end of simulation (after T time-steps): f(s)=Nf(s)=N_T 2.2.2 Generation Updating Given a generation gtg_t of sN_s simulations (individuals), the two fittest simulations are automatically carried over to the next generation gt+1g_t+1 – ensuring that the most successful combination of coefficients are not lost (elitism, where elite size μe=2 _e=2). To create the remaining s−2N_s-2 individuals, repeatedly two ‘parents’ are selected by means of fitness-proportional parent selection, i.e., sampled where simulation s has a probability to be selected of: p(s)=f(s)∑i=1sf(si)p(s)= f(s) _i=1^N_sf(s_i) Given two sampled parents si,sjs_i,s_j of generation gtg_t, two children si′,sj′s _i ,s _j are created to populate generation gt+1g_t+1. We employ crossover to explore the parameter space, where a random crossover point c defines how the parents’ genes are recombined: gene(si′) gene(s _i ) =gene(si)[:c]+gene(sj)[c:] =gene(s_i)_[:c]+gene(s_j)_[c:] gene(sj′) gene(s _j ) =gene(sj)[:c]+gene(si)[c:] =gene(s_j)_[:c]+gene(s_i)_[c:] Furthermore, mutation adds a small random value ϵ□∈[−0.1,0.1] _ ∈[-0.1,0.1] to each prey coefficient c□∈gene(si′),gene(sj′)c_ ∈ gene(s _i ),gene(s _j ), by mutation rate μ: c□←c□+ϵ□with probability μc□with probability 1−μc_ ← casesc_ + _ &with probability μ\\ c_ &with probability 1-μ cases The resulting prey coefficients are clipped to 0≤c□≤10≤ c_ ≤ 1 to keep them within the allowed range. This reproduction process is repeated for s−22 N_s-22 times per generation update – hereby ensuring that the next generation again counts sN_s individuals. 2.3 Experimental Design To answer our research question, we regarded the predator’s hunting strategy ^(B) a(B) as the independent variable, and the distribution of prey coefficients in gene(s):=⟨calis,cohs,cseps,cdods,creps,cwigs⟩gene(s):= c_ali_s,c_coh_s,c_sep_s,c_dod_s,c_rep_s,c_wig_s over generations as the dependent variables of interest – characterising the evolution of the prey’s movement behaviour. For each hunting strategy ^(B)∈^(B),^(B),^(B),^(B) a(B)∈ \ a_attc(B), a_attn(B), a_attr(B), a_attp(B) \, we ran the ES for g=30N_g=30 generations, keeping all other parameters except the prey coefficients fixed according to Table 1. For the first generation g1g_1, we initialised all s=30N_s=30 simulations individually with random prey coefficients, i.e., gene(s)∼(0,1)6gene(s) (0,1)^6. This generation was then evolved over g=30N_g=30 generations, while recording all simulations’ prey coefficients gene(s):=⟨cali,coh,csep,cdod,crep,cwig⟩gene(s):= c_ali,c_coh,c_sep,c_dod,c_rep,c_wig , as well as their fitnesses f(s)f(s). These coefficients were then aggregated to assess their distributions over generations – hereby assessing the prey’s evolutionary response to distinct hunting strategies. Over generations, we expected the prey coefficients to converge to their optimal values, and as a result, the mean simulation fitness (collective survival rate) to rise. To account for stochasticity (while bearing our computational limitations in mind), for each predator hunting strategy we repeated this ES trial five times. The optimal parameter settings for the main experiments (see Table 1) were largely found by trial-and-error, as motivated in Appendix A. We scrutinised rPpreyr_P^prey, fovpreyfov^prey, sN_s and μ into more detail, as these parameters showed to have most impact in the stability of the ES. In tuning these parameters, our goal was to identify configurations that led to both an increase in collective fitness over generations and stable convergence of the prey coefficients. As we note that simulation results may heavily depend on these fixed parameter settings, the impact of varying these parameters was systematically assessed through the sensitivity analyses (see Appendix B). 3 Results By conducting the experiments described in subsection 2.3, we recorded the dynamics of the prey coefficients – gene(s):=⟨cali,coh,csep,cdod,crep,cwig⟩gene(s):= c_ali,c_coh,c_sep,c_dod,c_rep,c_wig – along with the fitnesses f(s)f(s) of each simulation run (i.e., ES individual) over 30 generations – yielding 31 values (initialisation included). For each predator hunting strategy, this procedure was repeated in five independent ES trials to reduce the impact of stochasticity. The resulting dynamics were aggregated to assess the prey’s evolutionary response to different hunting strategies. (a) Attack-centroid hunting strategy, ^(B)=^(B) a(B)= a_attc(B) (b) Attack-nearest hunting strategy, ^(B)=^(B) a(B)= a_attn(B) (c) Attack-random hunting strategy, ^(B)=^(B) a(B)= a_attr(B) (d) attack-peripheral hunting strategy, ^(B)=^(B) a(B)= a_attp(B) Figure 1: Evolution of the distribution of fitnesses f(s)f(s) over generations, for five different ES trials (corresponding to five different colours), per predator hunting strategy. Each dot corresponds to an individual simulation, where overlapping simulations result in darker-shaded dots. The line represents the population’s mean fitness. Note that for every ES trial, the mean fitness remains stable or rises over generations. Generally speaking, the mean population fitness remained relatively stable (see Figure 1(a)), or showed a very slight (see Figure 1(c) and 1(d)) to more pronounced (see Figure 1(b)) increase. As no ES trial showed a downwards nor heavily fluctuating trend of mean fitness, this confirms the desired functioning of the ES. In other words, the prey managed to learn to improve their set of prey coefficients gene(s)gene(s) over generations, leading to movement behaviour that enhanced their collective survival rate – within the fitness limitations set by the predator’s hunting strategy ^(B)∈^(B),^(B),^(B),^(B) a(B)∈ \ a_attc(B), a_attn(B), a_attr(B), a_attp(B) \, which we discuss in detail below. Furthermore, we note that per hunting strategy, the mean fitness trends of the five ES trials agree – indicating that the observed collective fitness improvements are dependent on, and characteristic to, the employed hunting strategy. In the remainder of this section, we present the results relating to each individual hunting strategy in more detail. Apart from reflecting upon the strategy-specific fitness trends, we will also assess the trends per prey coefficient – which are visualised in Figure 2, 3, 4 and 5. For these, in general, we noted that within each ES trial, the distributions of prey coefficients converge over generations. This convergence can be attributed to the ES progressing towards a local optimum. As each ES trial shows convergent behaviour of the coefficients, we therefore conclude that the coefficients’ landscape allows sufficient opportunities for fitness improvement. However, this coefficients’ landscape seems to contain multiple local optima – as demonstrated by some ES trials that tend to bifurcate as they unfold – resulting in the ES converging to two distinct values. This points at the coefficients’ convergence being inter-dependent. Regarding the prey coefficients’ agreement between ES trials of the same hunting strategy, on the other hand, convergence patterns do not always agree. Here we observe that, depending on the hunting strategy, some prey coefficients show convergence of ES trials towards the same local optima – indicating that the coefficients’ landscape is sufficiently steep to globally converge, and suggesting that the coefficient is rather crucial for the collective survival rate of the prey. For other coefficients, however, different ES converge towards different local optima – exhibiting more variability and a sparser distribution, and possibly indicating a less pronounced or more context-dependent influence on prey survival. The collected results for each hunting strategy will be assessed into more detail in the following subsections, while a comparative and comprehensive analysis, along with our interpretation for our findings, is provided in the discussion section 4. 3.1 Attack-Centroid Hunting Strategy (^(B)=^(B) a(B)= a_attc(B)) Figure 2: From left to right, top to bottom: evolution of prey coefficients gene(s):=⟨cali,coh,csep,cdod,crep,cwig⟩gene(s):= c_ali,c_coh,c_sep,c_dod,c_rep,c_wig under the attack-centroid hunting strategy, ^(B)=^(B) a(B)= a_attc(B), for five different ES trials – corresponding to five different colours. Each dot (●) corresponds to an individual simulation, where overlapping simulations result in darker-shaded dots. The vertical bars indicate the population’s error margin (mean ± std) at the last generation of each ES, whereas the stars (★ ) indicate the coefficient’s value of the fittest individual of the last generation. With predators attacking the centroid of the prey flock (^(B)=^(B) a(B)= a_attc(B)), we can observe from Figure 1(a) how the initial generations’ fitnesses already start at near-maximal fitnesses – which is sustained as each ES unfolds. In other words, the predator’s attack-centroid strategy results in little prey to be caught, with little dependence on the prey’s movement dynamics. Figure 2 shows that coefficients tend to converge within their ES run – reflected by their decreased standard deviation at the last generation. Furthermore, the coefficient distributions are generally centred around the coefficient’s value of the fittest individual – indicating that fitness improvements were the driving force behind the convergence of the ES. It should be noted, however, that convergence does not always agree between ES trials. Whereas we see that the escape tendencies, i.e., dodge (cdodc_dod), repel (crepc_rep) and wiggle (cwigc_wig), all tend to converge towards higher values in [0.4,1.0][0.4,1.0] – an effect which is most pronounced for the repel coefficient, as indicated by the highest agreement of error bars between ES trials. For the flocking tendencies, i.e., alignment (calic_ali), cohesion (cohc_coh) and separation (csepc_sep), however, the ES shows little agreement of convergence between ES trials – indicated by the lack of overlap of error margins at the last generation. Taken together, these findings suggest that individual fitness improvements are mostly realised by avoiding the predator, as opposed to changing the flock’s global dynamics; this is also evident from simulation runs using the evolved coefficients for the five ES runs. Visual inspection of the fittest simulation of each ES trial revealed that for the attack-centroid strategy the prey mainly stays around the edges of the toroidal environment, while the predator moves around the centre of the environment which coincides with the centroid of the flock (given the toroidal environment). Prey consistently react to the predator by changing their direction while generally keeping the flock formation (albeit considerably less than for all other attack strategies). 3.2 Attack-Nearest Hunting Strategy (^(B)=^(B) a(B)= a_attn(B)) Figure 3: From left to right, top to bottom: evolution of prey coefficients gene(s):=⟨cali,coh,csep,cdod,crep,cwig⟩gene(s):= c_ali,c_coh,c_sep,c_dod,c_rep,c_wig under the attack-nearest hunting strategy, ^(B)=^(B) a(B)= a_attn(B), for five different ES trials – corresponding to five different colours. Each dot (●) corresponds to an individual simulation, where overlapping simulations result in darker-shaded dots. The vertical bars indicate the population’s error margin (mean ± std) at the last generation of each ES, whereas the stars (★ ) indicate the coefficient’s value of the fittest individual of the last generation. When the predator attacks the nearest prey in the flock (^(B)=^(B) a(B)= a_attn(B)), we can observe from Figure 1(b) how the escape for the prey is generally more difficult than in the previous attack-centroid scenario. Indeed, the initial fitness in the first generations is relatively low – showing a survival rate lower than 50% – and, despite steadily increasing in the next ES generations, it plateaus after about 10 generations, reaching an upper bound of 60 (i.e. 60% survival rate). Figure 3 shows how the prey coefficients evolved over generations. We observe moderate to strong convergence within ES trials for most coefficients – except wiggle, as indicated by the exceptionally wide error bars. Fitness again appears to be the driving force behind strong ES convergence – as converging ES oftentimes also include the fittest individual in their error margin (which is not the case for wiggle). Between ES trials, on the other hand, we only see consistent convergence across ES trials for alignment, separation, dodge, and repel. Especially the agreement for repel is striking, as ES strongly converge both within as well as between trials. Notably, repel converges to a particularly low coefficient value of [0.0,0.2][0.0,0.2] – suggesting that this is a crucial requirement for prey survival under the attack-nearest strategy. Cohesion and wiggle exhibited more variability and sparser distributions at the final generation – indicating a less pronounced or more context-dependent influence on prey survival. When visually inspecting the fittest simulation of each ES trial, we observe that for three out of five ES trials, the evolved behaviour was to stay in perfect starting formation – cruising straight ahead, without reacting to the predator, resulting in equidistant prey which were being eaten one-by-one until the end of the simulation. 3.3 Attack-Random Hunting Strategy (^(B)=^(B) a(B)= a_attr(B)) Figure 4: From left to right, top to bottom: evolution of prey coefficients gene(s):=⟨cali,coh,csep,cdod,crep,cwig⟩gene(s):= c_ali,c_coh,c_sep,c_dod,c_rep,c_wig under the attack-random hunting strategy, ^(B)=^(B) a(B)= a_attr(B), for five different ES trials – corresponding to five different colours. Each dot (●) corresponds to an individual simulation, where overlapping simulations result in darker-shaded dots. The vertical bars indicate the population’s error margin (mean ± std) at the last generation of each ES, whereas the stars (★ ) indicate the coefficient’s value of the fittest individual of the last generation. For the attack-random hunting strategy ^(B)=^(B) a(B)= a_attr(B), the fitness improvement is less pronounced than for the aforementioned attack-nearest strategy (see Figure 1) – showing a near-negligible fitness improvement. Figure 4 demonstrates how the prey coefficients evolved over generations. We observe moderate convergence within ES trials for all coefficients – as confirmed by their medium-sized error margins. We furthermore see that between ES, the coefficients only converge towards similar value ranges for the escape tendencies – i.e., dodge, repel and wiggle. It is worth noting that repel again shows preference for lower values in [0.0,0.4][0.0,0.4], whereas the other two tend to be in the medium-to-high range (dodge in [0.6,1.0][0.6,1.0] and [0.4,0.9][0.4,0.9]). For the flocking tendencies, i.e., alignment, cohesion and separation, there is higher variability and no clear agreement across ES trials. Visual inspection of the fittest simulation of each ES trial again shows a similar behaviour as for attack-nearest – with prey mostly staying in their initial formation. However, behaviour is more variable across prey, and a higher tendency for predator avoidance can be observed. 3.4 Attack-Peripheral Hunting Strategy (^(B)=^(B) a(B)= a_attp(B)) Figure 5: From left to right, top to bottom: evolution of prey coefficients gene(s):=⟨cali,coh,csep,cdod,crep,cwig⟩gene(s):= c_ali,c_coh,c_sep,c_dod,c_rep,c_wig under the attack-peripheral hunting strategy, ^(B)=^(B) a(B)= a_attp(B), for five different ES trials – corresponding to five different colours. Each dot (●) corresponds to an individual simulation, where overlapping simulations result in darker-shaded dots. The vertical bars indicate the population’s error margin (mean ± std) at the last generation of each ES, whereas the stars (★ ) indicate the coefficient’s value of the fittest individual of the last generation. The fitness distribution for the attack-peripheral hunting strategy (^(B)=^(B) a(B)= a_attp(B)) shows a comparative spread, where the fitness distribution ranges from 52 to 91 (i.e. 9 to 48 preys killed in the simulation’s runtime). Despite this variability, a slight fitness improvement is achieved as the ES trials evolve. Figure 5 shows how the coefficients evolved over generations. We again observe moderate to strong within-ES convergences for all coefficients – where alignment and cohesion show the most narrow error margins. Regarding the between-ES agreement of the converged-to values, however, we observe a large variability across ES for most coefficients – as only repel shows particular preference for low ([0.0,0.4][0.0,0.4]) values, and wiggle for higher ([0.5,1.0][0.5,1.0]) values. The remaining coefficients all vary considerably in their convergences across ES runs. When visually assessing the ES trial’s fittest simulations, we see a very similar behaviour to the attack-random results – with prey generally keeping their formation, but being less constrained than for the attack-nearest simulations. Further, we can clearly observe wiggling behaviour, which was not the case for any of the other attack strategy results. 4 Discussion We investigated which relative contributions of six prey behaviours – alignment (calic_ali), cohesion (cohc_coh), separation (csepc_sep), dodge (cdodc_dod), repel (crepc_rep), and wiggle (cwigc_wig) – prey boids converge to, for a given predator strategy, using an ES. We found that the ES was successful in maximising fitness, and converging on specific coefficients, typically driven by local improvements in the fitness landscape. The behaviours that evolved for the different predator attack strategies are largely similar, except for the attack-centroid strategy – which favours more individualistic predator-escaping behaviour – as compared to the other three strategies – which favour flocking tendencies more. Still, as Section 3 demonstrated, each strategy favoured a different combination of coefficients and differed in terms of convergence within and between ES trials. Only the ES runs for the attack-nearest strategy showed a clear improvement in fitness. For all other strategies, no relevant improvements in fitness could be observed. This can be explained by the properties of the different attack strategies. The attack-nearest strategy resulted in the lowest survival rate of the prey, which is in line with our hypothesis, and furthermore agrees with previous research that found this strategy to be the most efficient (Ojo et al., 2023; von Moll et al., 2016). The optimal prey survival behaviour under this hunting strategy is to “do nothing” – that is, to stay in the initial starting formation, which perfectly equispaces the prey – preventing the predator from eating more than one prey at a time (which is a possible scenario in our simulations). Since the simulation is run for a fixed time and the predator is faster than the prey, prey essentially “wait-out” the end of the simulation. This generates a very reliable fitness. Reacting to the predator using the escape tendencies can result in higher fitness, but not reliably so – as by chance in some simulations, multiple clustered prey could be eaten by the predator in one go. In a sense, this shows how environmental context influences optimal behaviour (Palmer and Packer, 2021). Similarly, the evolved behaviours for the other attack strategies can be understood. The attack-centroid strategy resulted in the highest survival rate for the prey – again aligning with our hypothesis and previous work (Demšar and Lebar Bajec, 2014). This can be easily explained by considering that the flock’s centroid typically does not coincide with an individual prey – resulting in the predator aiming to catch ‘empty space’. As a consequence, there is less pressure for the prey to flock, as long as they avoid the predator – as indicated by the relatively high escape coefficients. Since many possible combinations of escape behaviours can be successful for this strategy, the random initialization and all consecutive generations achieve a very high average fitness, that can hardly be improved upon due to the stochasticity inherent in both the boid’s model and ES. The attack-random and attack-peripheral strategies place somewhere in between attack-nearest and attack-centroid – both in terms of highest achievable fitness for the prey, as well as the evolved behaviours. Both strategies are more efficient than attack-centroid, since they target and hunt actual, individual prey, but fall short of attack-nearest – which targets the closest prey, as observed by Ojo et al. (2023). This is reflected in the ES achieving maximal fitness values between the two extreme strategies. Both attack-random and attack-peripheral are rather unpredictable. For the prey, the evolved behaviour consists of generally staying in flock formation, which aligns with the findings of (Kunz et al., 2006). They turn away from the predator if it is spotted, however, they avoid sharp escape manoeuvres that break flock formation. This exploits the inefficient hunting of the predator – which regularly chooses prey that are further away – leading to long travel times during which prey are only caught by chance. Altogether, in terms of evolved coefficients over all hunting strategies, we can highlight a general tendency towards a relatively low repel coefficient across the ES trials – while other coefficients did not present the same consistency. Other, more subtle patterns are a relatively high dodge and wiggle coefficient – which are deemed beneficial to avoid predators’ attacks. This contrasts with the findings from Ojo et al. (2023), who found position-based escape (repel) to perform better than direction-based escape (dodge). This deviation could potentially be attributed to the interaction between coefficients in our research, while Ojo et al. (2023) only investigated behaviours in isolation. No clear pattern can be identified for the boids coefficients, as multiple coefficient combinations result in the observed flocking behaviour. 4.1 Limitations & Future Work Our study has several limitations, which also pave the way for promising directions for future work. We highlight the following: • Environment Setting: The simulation run in our experiment assumed a 2D toroidal environment with limited size. In future research, the environment could be expanded, in terms of both size and dimensions, potentially removing the toroidal boundaries to better approximate open or higher-dimensional spaces. Furthermore, the addition of obstacles or other environmental features may vary the behaviour of the flock, thus possibly leading to interesting findings. • Initialisation and stochasticity: In order to account for stochasticity and isolate the effects of the behavioural coefficients, every simulation has been run starting from the exact same initial position and direction of the boids. However, to enhance the realism of those simulations and introduce stochasticity, different initial setups could be explored. • Computational Cost: Despite the extensive use of parallelisation in the experiment implementation, the demanding computational cost of the simulations prohibited long ES runs, and constrained our research to test ES for only g=30N_g=30 generations (whereas most of the other studies run their GA for 100 or more (Olsen et al., 2018; Kunz et al., 2006)). With more computational resources, a more extensive study would be recommended to effectively assess the convergence of the ES. • Parameters: Given the broad parameter space, there is significant potential for further exploration. While this study fixed most parameters to maintain a realistic simulation consistent with the chosen hunting strategy, future research could examine a wider array of strategies and parameter settings, and/or combine hunting strategies, such as first attacking the centre of a flock and following up with attacking nearest prey (Demšar and Lebar Bajec, 2014). Also, introducing predator collaboration in the hunting tactic by means of increasing the number of predators, could lead to interesting prey dynamics. 5 Conclusion We investigated to what movement behaviour the prey evolve to, in terms of relative contributions of alignment, cohesion, separation, dodge, repel and wiggle tendencies, to maximise their collective survival – under different predator hunting strategies. From the prey perspective, we conclude that flocking (relating to the coefficients of alignment, cohesion and separation) is usually beneficial, whereas the optimality of escaping (relating to the coefficients of dodge, repel and wiggle) slightly varies according to the hunting strategy adopted by the predator. From the perspective of the predators, we can conclude that attacking the centroid of the prey flock, or attacking a randomly-selected prey, is not an effective hunting strategy, while attacking the nearest prey is reliably most successful. This research serves to improve our understanding of the complex interactions between prey and predator behaviours. We encourage future research to gain deeper insights into the dynamics that were presented here. References Alaliyat et al. (2022) S. Alaliyat, M. Obeidat, I. Aljarah, A. M. Al-Zoubi, and H. Faris Optimization of boids swarm model based on genetic algorithm and particle swarm optimization algorithm: a comparative study. Swarm and Evolutionary Computation 68, p. 100982. External Links: Document Cited by: §1.2. Beyer and Schwefel (2002) H. Beyer and H. Schwefel Evolution strategies–a comprehensive introduction. Natural computing 1, p. 3–52. Cited by: §1.2, §1, §2.2. Chen et al. (2006) Y. Chen, K. Kobayashi, X. Huang, and Z. Nakao Genetic algorithms for optimization of boids model. In International Conference on Knowledge-Based and Intelligent Information and Engineering Systems, p. 55–62. Cited by: §1.2. Demšar and Lebar Bajec (2014) J. Demšar and I. Lebar Bajec Simulated predator attacks on flocks: a comparison of tactics. Artificial Life 20 (3), p. 343–359 (en). Cited by: §1.1, §1.2, §2.1.1, 4th item, §4. Hahn et al. (2019) C. Hahn, T. Phan, T. Gabor, L. Belzner, and C. Linnhoff-Popien Emergent escape-based flocking behavior using Multi-Agent reinforcement learning. In The 2019 Conference on Artificial LifeThe 2019 Conference on Artificial Life, Cambridge, MA. Cited by: §1.2. Kunz et al. (2006) H. Kunz, T. Züblin, and C. Hemelrijk On prey grouping and predator confusion in artificial fish schools. MIT Press. Cited by: Appendix A, §1.2, §1, 3rd item, §4. Lee et al. (2006) S. Lee, H. Pak, and T. Chon Dynamics of prey-flock escaping behavior in response to predator’s attack. Journal of theoretical biology 240 (2), p. 250–259. Cited by: §1.2, §1. Oboshi et al. (2002) T. Oboshi, Y. Kuroe, and A. Uozumi Evolving schooling behaviors to escape from predator. In Proceedings of the 2002 Congress on Evolutionary Computation, Vol. 2, p. 1410–1415. External Links: Document Cited by: §1.2. Ojo et al. (2023) M. Ojo, M. Krajnc, M. Adžaga, and J. Kuhar Predator-prey simulation using boids model. FRIteza, p. 1–4 (en). Cited by: §1.1, §1.2, §1.2, §2.1.1, §2.1.2, §2.1.2, §2.1, §2.1, §4, §4, §4, Abstract. Ojo et al. (2024) M. Ojo, M. Krajnc, and M. Adžaga Collective-behavior-groupb public. Note: https://github.com/MOj0/Collective-Behavior-GroupBAccessed: 2025-06-23 Cited by: §2.1.1, §2.1.2, §2.1.2, §2.1.2, §2.1.2, §2.1, §2.1, §2.1. Olsen et al. (2018) M. M. Olsen, J. Laspesa, and T. Taylor-D’Ambrosio On genetic algorithm effectiveness for finding behaviors in agent-based predator prey models. In Proceedings of the 50th Computer Simulation Conference, p. 1–12. Cited by: 3rd item. Palmer and Packer (2021) M. S. Palmer and C. Packer Reactive anti-predator behavioral strategy shaped by predator characteristics. PloS one 16 (8), p. e0256147. Cited by: §1, §4. Papadopoulou et al. (2022) M. Papadopoulou, H. Hildenbrandt, D. W. E. Sankey, S. J. Portugal, and C. K. Hemelrijk Self-organization of collective escape in pigeon flocks. PLoS Comput. Biol. 18 (1), p. e1009772 (en). Cited by: §2.1.2. Reynolds (1987) C. W. Reynolds Flocks, herds and schools: a distributed behavioral model. ACM SIGGRAPH Computer Graphics 21 (4), p. 25–34. External Links: Document Cited by: §1.1, §1.2, §1, §2.1.2, §2.1. Slowik and Kwasnicka (2020) A. Slowik and H. Kwasnicka Evolutionary algorithms and their applications to engineering problems. Neural Computing and Applications 32, p. 12363–12379. Cited by: §1.2, §1, §2.2. von Moll et al. (2016) P. von Moll, M. Riedmiller, and T. Röfer Evolutionary design of cooperative predation strategies. Artificial Life and Robotics 21, p. 127–137. External Links: Document Cited by: §1.1, §1.2, §4. Appendix A Fixed Parameter Settings We selected the parameter settings in Table 1 to be fixed during our main experiments. Parameter Explanation Value Boids Model Sx×SyS_x× S_y field size (px) 1920×10801920× 1080 Predator Prey M,NM,N number of boids 1 100 rPpred,preyr_P^pred,prey perception radius (px) 3000 300, 750, 1500, 3000 rSpred,preyr_S^pred,prey separation radius (px) 100 50 fovpred,preyfov^pred,prey field of view, per eye (° ) 1202 1202 602 602, 1202 1202, 2402 2402, 3602 3602 θmaxpred,preyθ^pred,prey_max maximum rotation angle (° ) 90 90 apred,preya^pred,prey acceleration (px/step2) 5000 2500 vpred,preyv^pred,prey velocity (px/step) 500 200 θwig _wig wiggle angle (° ) 30 fwigf_wig wiggle frequency (rad/step) 14 Evolutionary Strategy (ES) fps simulation rate (fps) 100 T duration of a simulation (steps) 2000 T duration of a simulation (s) 20 sN_s number of simulations per generation, population size 30, 50 gN_g number of generations 30 μe _e elite size 2 μ mutation rate 0.05, 0.3, 0.7 Table 1: Fixed parameter settings relating to the Boids Model and the evolutionary strategy (ES) that were used for running the main experiments. The settings were tweaked such, that they produced naturalistic predator and prey motion dynamics, and furthermore allowed ES convergence over generations. The parameter values in light grey correspond to the settings examined in the sensitivity analyses (see Appendix B), but not selected for running the main experiments. Figure 6: Initial layout of the predator (red) and prey (white) that was fixed for every simulation. Relating to the Boids Model, Sx×SyS_x× S_y ensured sufficient space for the boids to move around, without overcrowding the field. We chose to include one single predator (M=1M=1) to better isolate and examine the effects of its hunting strategy on the prey, and to avoid confounding prey behaviour with responses to multiple approaching predators. The choice for N=100N=100 prey was in line with related literature (Kunz et al., 2006), being an intuitive number to work with, and practical for fitness quantification. The parameters relating to the boids’ motion dynamics, rPpred,preyr_P^pred,prey, rSpred,preyr_S^pred,prey, fovpred,preyfov^pred,prey, θmaxpred,prey _max^pred,prey, apred,prey,vpred,preya^pred,prey,v^pred,prey and wiggle parameters θwig,fwig _wig,f_wig were tuned such, to produce naturalistic predator and prey motion dynamics. The specific settings of rPpreyr_P^prey and fovpreyfov^prey were further motivated by promoting the stability of ES convergence (see Appendix B). Furthermore, for every simulation, we fixed the initial layout of the predator (in red) and prey (in white) to be as displayed in Figure 6. Taking the predator’s field of view (fovpredfov^pred) and the toroidal boundary conditions of the field into account, we opted for this layout to ensure that the predator has sufficient candidate prey within sight, such that its hunting strategy directly reflects in its movement behaviour. Furthermore, the evenly-spaced prey grid allows sufficient freedom for flocking behaviour to emerge. Taken together, this layout ensures that most is made out of every simulation, within duration T. It is worth noting that, although the initial conditions of each simulation are deterministic, their unfolding is inherently stochastic. For ES, we fixed fps and T (in steps11 1 T was fixed in terms of steps, not seconds, as the simulation duration in terms of steps is not subject to computational power.) such, that any change in the simulation’s prey coefficients gene(s)gene(s) were allowed enough time to have a noticeable impact on the simulation’s fitness. Within T, this required a considerable amount of prey to be killed when displaying unsuccessful flocking behaviour, and conversely, sufficient chances to escape from the predator when employing successful flocking behaviour. Bearing computational time in mind, we set sN_s and gN_g such, that the ES showed to converge (see Appendix B). Relating to the generational updating, μe _e and μ were set such, to result in a balance between exploration and exploitation (see Appendix B). Appendix B Sensitivity Analyses To scrutinise the impact of varying the prey perception radius rPpreyr_P^prey, field of view fovpreyfov^prey, number of simulations per generation sN_s and mutation rate μ on the stability of ES convergence, we performed sensitivity analyses on the aforementioned parameters. The experiments were conducted under the predator’s attack-nearest hunting strategy (^(B)=^(B) a(B)= a_attn(B)), for g=20N_g=20 generations, keeping all other parameters fixed to the settings in Table 1. For each parameter, the setting that yielded the best results was selected to be held fixed in the main experiments. Favourable parameter settings are characterised by the population’s ability to ‘learn’ how to survive. In other words, we sought parameter settings that resulted in a rise of the simulations’ mean fitness over generations – corresponding to stable convergence of the simulations’ prey coefficients towards the fittest simulation’s value. B.1 Perception Radius (rPpreyr_P^prey) As Figure 7 illustrates, varying the prey’s perception radius across rPprey∈300,750,1500,3000r_P^prey∈\300,750,1500,3000\ only partly affected the stability of ES convergence within g=20N_g=20. We noted that for rPprey=300r_P^prey=300, the distributions of prey coefficients remained rather broadly distributed (or bifurcated) as generations evolved – reflecting a prey coefficient landscape having multiple local optima. This reflected itself as a jumpy behaviour of the fittest simulation’s prey coefficients, and furthermore the inability of the population to steadily converge towards optimal prey coefficients. Together, this seemed to impede the collective fitness to ‘learn’ to climb towards higher fitnesses. For rPprey∈750,1500,3000r_P^prey∈\750,1500,3000\, on the other hand, we see a slight learning effect, as the simulations’ mean fitness rises as generations unfold. Furthermore, prey coefficient convergence is seemingly more stable. Based on these results, there was no clear preference for either one of rPprey∈750,1500,3000r_P^prey∈\750,1500,3000\, therefore we selected rPprey=750r_P^prey=750 for the main experiments – having the least computational load, given that higher rPpreyr_P^prey imply more neighbours per prey. (a) Evolution of the simulations’ prey coefficients across generations, under varying rPpreyr_P^prey. The fittest simulation is marked as a dashed line. rPprey=300r_P^prey=300 rPprey=750r_P^prey=750 rPprey=1500r_P^prey=1500 rPprey=3000r_P^prey=3000 (b) Evolution of the simulations’ fitness across generations, under varying rPpreyr_P^prey. The mean fitness is marked as a solid line. Figure 7: Comparison of ES convergence in terms of the simulations’ prey coefficients and fitnesses, when varying the prey’s perception radius rPprey∈300,750,1500,3000r_P^prey∈\300,750,1500,3000\. The sensitivity analyses were run for g=20N_g=20 generations. Other parameter settings were fixed to the settings in Table 1. B.2 Field of View (fovpreyfov^prey) As Figure 8 illustrates, varying the prey’s field of view across fovprey∈602,1202,2402,3602fov^prey∈\ 602, 1202, 2402, 3602\ had a minor impact on the stability of the prey coefficients’ convergence within g=20N_g=20. In the fovprey∈3602fov^prey∈\ 3602 case, we observed little-to-no rise in the simulations’ mean fitness, although this was not directly reflected in the prey coefficients’ convergence – that were seemingly equally stable across all four fovpreyfov^prey scenarios. For the main experiments, we opted for fovprey=2402fov^prey= 2402 to mimic nature – in which prey typically have larger fields of view than the predator (fovpred=1202fov^pred= 1202). Furthermore, this parameter setting resulted in a clear rise of the simulations’ mean fitness across generations. (a) Evolution of the simulations’ prey coefficients across generations, under varying fovpreyfov^prey. The fittest simulation is marked as a dashed line. fovprey=602fov^prey= 602 fovprey=1202fov^prey= 1202 fovprey=2402fov^prey= 2402 fovprey=3602fov^prey= 3602 (b) Evolution of the simulations’ fitness across generations, under varying fovpreyfov^prey. The mean fitness is marked as a solid line. Figure 8: Comparison of ES convergence in terms of the simulations’ prey coefficients and fitnesses, when varying the prey’s field of view (per eye) fovprey∈602,1202,2402,3602fov^prey∈\ 602, 1202, 2402, 3602\. The sensitivity analyses were run for g=20N_g=20 generations. Other parameter settings were fixed to the settings in Table 1. B.3 Number of simulations per generation (sN_s) Looking at Figure 9, varying the number of simulations per generation s∈30,50N_s∈\30,50\ showed most favourable ES dynamics for s=30N_s=30. Here, the prey coefficients showed to converge more stably to the values of the fittest simulation – whereas for s=50N_s=50 the distribution of the prey coefficients’ values remained broad or strongly bifurcated over generations. Consequently, more simulations with suboptimal fitnesses remained within the population, whereas for s=30N_s=30 they had almost all reached the fitness ceiling. For these reasons, we selected g=30N_g=30 for our main experiments. (a) Evolution of the simulations’ prey coefficients across generations, under varying sN_s. The fittest simulation is marked as a dashed line. s=30N_s=30 s=50N_s=50 (b) Evolution of the simulations’ fitness across generations, under varying sN_s. The mean fitness is marked as a solid line. Figure 9: Comparison of ES convergence in terms of the simulations’ prey coefficients and fitnesses, when varying the number of simulations per generation (population size) s∈30,50N_s∈\30,50\. The sensitivity analyses were run for g=20N_g=20 generations. Other parameter settings were fixed to the settings in Table 1. B.4 Mutation rate (μ) Looking at Figure 10, varying the mutation rate μ∈0.05,0.3,0.7μ∈\0.05,0.3,0.7\ showed stronger exploitation effects μ=0.05μ=0.05 – as in this scenario, generational variations through mutation were limited, we observe that the prey coefficients’ distributions show little-to-no changes over generations – as variations are almost entirely dependent on crossover with just a 5% chance of mutation. This impedes exploration of the prey coefficients’ landscape towards configurations that result in higher fitnesses. For μ=0.7μ=0.7, we observed the contrary. Due to the 70% chance of gene mutation, the prey coefficients struggle to converge, as their distributions remain broad over generations. Here in particular, the overemphasis on exploration withholds the mean fitness generation to steadily rise. Best prey coefficients’ convergence and population fitnesses were achieved by balancing exploration and exploitation, as was the case for μ=0.3μ=0.3. Therefore, this setting was selected for the main experiments. (a) Evolution of the simulations’ prey coefficients across generations, under varying μ. The fittest simulation is marked as a dashed line. μ=0.05μ=0.05 μ=0.3μ=0.3 μ=0.7μ=0.7 (b) Evolution of the simulations’ fitness across generations, under varying μ. The mean fitness is marked as a solid line. Figure 10: Comparison of ES convergence in terms of the simulations’ prey coefficients and fitnesses, when varying the mutation rate μ∈0.05,0.3,0.7μ∈\0.05,0.3,0.7\. The sensitivity analyses were run for g=20N_g=20 generations. Other parameter settings were fixed to the settings in Table 1.