Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision 923e104aa634230547ba464c6bc8fee07f662ffa authored by Rene Niehus on 03 March 2020, 02:26:02 UTC, committed by GitHub on 03 March 2020, 02:26:02 UTC
Update invasion_analysis.m
1 parent 0cee31f
  • Files
  • Changes
  • c60dd23
  • /
  • README.md
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
revision badge
swh:1:rev:923e104aa634230547ba464c6bc8fee07f662ffa
directory badge
swh:1:dir:c60dd23f7004bca655d5420d5ac0c7fc4b795c93
content badge
swh:1:cnt:8a3b43c5fa96904eef5ae22394c47f82f7d742b6

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
README.md
This folder contains MATLAB and R code to reproduce results from Niehus et al. "The Evolution of Strategy in Bacterial Warfare".

In particular, the file invasion_analysis.m implements an invasion analysis according to classic game theory (see for example McElreath, R. & Boyd, R. Mathematical Models of Social Evolution. Mathematical Models of Social Evolution (2013)). It assumes a monomorphic metapopulation where repeatedly rare mutants appear, and for each mutant it is tested whether it can or cannot invade. This pairwise invasibility algorithm is efficient in finding the optimal constitutive strategy. It follows the pseudocode shown in Supplementary Methods and Results of Niehus et al.

The function mass_battle.m implements the co-evolutionary tournament described in Niehus et al. (see Methods) and that leads to Figure 4. It allows for a polymorphic metapopulation where all three sensing strategies meet and compete in 1-on-1 competitions. Mutation, migration and selection at the meta-population level is at work to establish the long-term winner of this evolutionary race. Note that this script can run up to hours, and that the control parameters can be tuned to improve convergence speed.

The R file vis_mass_batt_fig4c.R loads the results of mass_battle.m and plots them just like in Figure 4 c, allowing to inspect convergence and dominating strategies.
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API