This is the code used for the simulation model described in the Currie et al. (2021) article "The Cultural Evolution & Ecology of Institutions" published in Philosophical Transactions of the Royal Society B: Biological Sciences.European Research Council (ERC)Arts and Humanities Research Council (AHRC)Economic and Social Research Council (ESRC