This simulation tries to aid our understanding of how non-lethal agonistic behaviour evolves among males competing for mates.

What do King cobras and black mambas have in common?

The inspiration for this simulation came first from a National Geographic video that showed two male King Cobras performing an elaborate wrestling match to pin each other down, yet they made no attempt to bite one another. Male black mambas have a similar ritual when competing for mates.

The second inspiration was from watching male wildebeests competing for female mates in a South African game park. Despite witnessing several fights, none of them resulted in any harm to the protagonists.

Why should such non-lethal behaviour evolve? It isn't obvious that extremely homicidal agonistic behaviour when competing for mates should be an evolutionary disadvantage. On the contrary, permanently eliminating competitors might on the face of it even seem advantageous.

Yet, by tinkering with the various parameters in this agent-based simulation, you can see that there are many situations where there is selective pressure against lethal behaviour. There are also scenarios in which non-lethal individuals often don't become dominant within the population, and the population goes extinct. Yet there are other scenarios where the proportion of homicidal males is unaffected, or where they are reduced to a stable minority.

How the simulation works

When the Simulate button is clicked, the simulation executes as follows

  1. A population of individuals, or agents, is initialised. The male-female split is about 50-50. All individuals (male and female) have a set of genes which indicate how lethal they are.
  2. The simulation then consists of multiple iterations, where each iteration could be thought of as a mating season. On every iteration, all the males and females are randomly shuffled.
  3. At the beginning of each iteration, some individuals will die. The number of mating seasons that individuals live is determined by an option that you can change.
  4. In each iteration, males are paired to fight with each other. The male that wins the fight will kill the losing male with probability proportional to the number of its lethal genes that are switched on.
  5. Also, there is a revenge factor (which you can switch off). This is the probability that a homicidal male will also be mortally wounded by its adversary. I introduced this because of the possibility that a murderous individual might be injured by a dying angry opponent. E.g. if a black mamba decides to bite his adversary, this would signal the probability that the adversary bites back before dying. Whether or not this is a realistic parameter, I have no idea. The higher it is though, the greater the probability that non-lethal behaviour evolves, or if it doesn't that the population goes extinct. Setting the revenge factor to zero is however more interesting, because even here non-lethal behaviour evolves in many scenarios.
  6. A winning --and surviving-- male mates with one other female in that iteration (or mating season), if the monogamous option is chosen. If the polygamous option is chosen, the number of mates the male has is equal to the proportion of females to males in the population, but at least one. Each female only mates once in a mating season.
  7. The females then give birth. The number of babies per female can also be changed by a user-specified option.
  8. A newly born individual's genes are a random combination of the male and female parents. The more peaceful the parents, the more peaceful the child is likely to be.

There are two sets of output from the simulation: a graph and a table. The graph shows the change in population (red) after each iteration, or mating season, and the change in the number of peaceful individuals (yellow). A peaceful individual is defined as one who has fewer lethal genes than the proportion specified by the Proportion homicidal parameter (under Advanced parameters).

The second set of outputs is a table, which produces interesting demographics for every iteration.

Play around with the advanced parameters to see the way lethal versus non-lethal agonistic behaviour is affected.

One interesting observation is that the same set of parameters can lead to wildly different outcomes on repeated runs of the simulation. Even in this very simple model, there is much unpredictability.

Parameters

Population
Initial number of individuals (or agents) in the simulation
Mating seasons
Number of iterations to run the simulation. Each iteration corresponds to a mating season in which males compete with each other, and the winners mate with females, producing offspring.
Update delay
Minimum time delay of user interface updates between each iteration. Default is 100 milliseconds. Set to 0 if you want a minimal delay between iterations.

Advanced parameters

Maximum population
The simulation stops if the population exceeds this value. If this is set too high, the simulation can become very slow if the population explodes.
Number of genes
Number of genes that every individual has that determine how lethal males are if they win a fight. Genes are either on or off. The likelihood of a winning male killing a losing male is proportional to the number of his genes that are switched on divided by his total number of genes.
Proportional homicidal
This is the proportion of genes that are likely to be switched on, i.e. to make the agent more likely to be homicidal. For each gene of a newly born agent, a random number is generated from 0 to 1. If it is less than the value of this parameter, it is set to zero (non-homicidal), else one. To simply model the effects of the birth rate and death rate from old age, set this parameter to zero.
Revenge factor
The revenge factor tries to model the risk of a homicidal male who wins a fight being killed by the losing adversary. The thinking behind it is that a male who is homicidal is more likely to be mortally wounded by his adversary. By default it is set to zero. Setting it 0.2, or even 0.1, confers a great selection advantage to being non-homicidal.
Discrete Weibull
This distribution is a stochastic, more sophisticated, way of modelling the number of seasons an agent lives than the Fixed number of mating seasons parameter. The p parameter is the probability the individual will die before any mating season. The Β parameter determines the shape of the distribution. The higher the value of Β the narrower the distribution.
Fixed number of mating seasons
If this parameter is selected every agent lives through exactly the specified number of mating seasons, unless he is killed by another male.
Binomial distribution
This is a stochastic, more sophisticated, way of modelling the number children that a pair of mating agents will have, than the Fixed number of children parameter. Set n to the maximum number of children that can be produced in a single mating, and p to the probability that any single child will be born live. The average number of live children that will be born is p * n.
Fixed number of children
If this parameter is selected, a pair of mating agents will produce exactly the specified number of children.
Mating strategy
If monogamous is selected (the default) then each male that wins a fight will mate with exactly one female. If polygamous is selected then each male that wins a fight will mate with a number of females proportional to the ratio of females to males.
Random number generation
By default the simulation uses the Javascript random number generator. If you need a replicable high-quality, generator select the Mersenne Twister option, which also allows you to change the generator's seed.

Some preliminary results

I have not methodically analysed the results. In the experiments described here the update delay was set to zero.

  • With the default parameters widely different outcomes occur on different runs. Nevertheless, on balance there appears to be selective pressure against being homicidal.
  • The revenge factor selects against being homicidal. Even setting it to 0.1 (i.e. 10%) with all other parameters left at their defaults drives down the proportion of homicidal genes, usually very quickly, in most runs.
  • Tinkering with other parameters can result in vastly different results. For example, switching the mating strategy to polygamous does not appear to cause any selective pressure against being homicidal. Though it's unclear to me how realistic the polygamous strategy is.

Finally, a word of caution. This simulation tool is a highly simplified account of reality. All it can hope to achieve is to inspire some thinking about the evolution of non-lethal agonistic behaviour. Be weary about drawing firm conclusions from it.

Simulation parameters

This is the size of the initial population in the simulation.
Recommended range: 20 to 1000 (integer)

This is the number of iterations the simulation will run for. Each iteration corresponds to a mating season in which the male individuals in the simulation will compete against each other for female mates.
Recommended range: 5 to 100 (integer)

After each mating season (or iteration) the screen is updated. This is the delay between screen updates. It is in milliseconds (1000ms = 1 second). For no delay, set to zero.
Recommended range: 0 to 1000 (integer)

Advanced parameters

Homicidal mating genes

This is the number of genes determining homicidal behaviour that each individual has. When two males are paired to fight for mates, the probability that the winner will kill the loser is proportional to the number of his homicidal mating genes that are switched on. In this simulation all genes are boolean, i.e. either on or off, and all individuals have the same number of genes.
For example, let's say individuals have ten genes. If a male individual X has six genes switched on, then if he wins a fight, there is a six out of ten (or 60%) chance that he will kill his adversary.
Let's say all individuals have one gene, then each male individual either has a zero or 100% chance of killing his adversary if he wins a fight.
Recommended range: 1 to 10 (integer)

This is the proportion of genes in the population that are switched on to being homicidal. When two males are paired to fight for mates, the probability that the winner will kill the loser is proportional to the number of his homicidal mating genes that are switched on to.
Recommended range: 0 to 1 (real)

When a male kills another male, there is a probability, specified by this option, that before dying the losing male will inflict mortal wounds on the winner. If this event occurs, the winning male does not get to reproduce and dies. If set to 0.1 or above this dramatically increases the chances of non-homicidal males becoming dominant in the population. If set to zero, results can be very interesting and unpredictable because in some simulations non-homicidal males still become dominant, while in others the population goes extinct because of the high homicide rate. And yet in others still, even with a large proportion of homicidal males, the population explodes.
Recommended range: 0 to 1 (real)

Mating seasons before dying of old age


   Average # seasons:

These parameters determine how long individuals live (before they die of old age).
The Fixed option is the simplest. If this is selected every individual lives for at most the specified number of mating seasons.
Recommended range for Fixed seasons 1 to 6 (integer)
The Discrete Weibull option is a more realistic stochastic model of how long animals live.
The p parameter is the probability of the individual having zero mating seasons. The Β parameter gives the distribution its shape. A high value of Β gives a very narrow distribution. E.g. if p is 0.3, the probability of not living to compete in any mating season is 0.3, and if Β is 1, the average number of mating seasons that each individual will live through (excluding the possibility of being killed in a fight) is 2.3. If p is 0.1 and Β is 1, the average number of mating seasons is just shy of 9. If p is 0,3 and Β is 0.5, the average number of seasons is 5.1.
Recommended range: There are many reasonable combinations of p and Β. E.g. 0.3 and 1, but try to select the two parameters so that the average number of seasons is between 1 and 10.

Number of children per mating

Specifies the number of children born when two individuals mate.
The simpler Fixed option specifies a precise number of individuals born after every mating.
Recommended range: 1 to 5 (integer).
The Binomial Distribution option is arguably more realistic. n is the maximum number of children from a single mating, and p is the probability of any particular child being born.
Recommended range: n: 1 to 5 (integer), p 0 to 1 (real).

If this is set to monogamous, the male winner of a fight only mates with one female in that mating seasons. If this is set to polygamous, the number of females the winning male mates with is equal to approximately the ratio of females to males.

Simulation details

The maximum size of the population at which the simulation will halt. Setting this too large slows down the simulation, and can cause your browser to become unresponsive.
Recommended range: 1000-30000 (integer)

Random number generation

By default the simulation uses the Javascript random number generator. If you need a replicable high-quality, but possibly slower, generator, select the Mersenne Twister option, which also allows you to change the generator's seed.

Graph showing change in population Total population Peaceful - fewer homicidal genes than user specified proportion
Mating season