Code associated with the paper at https://arxiv.org/abs/2005.05154. Runs with vanilla Java.
The purpose behind this code is to simulate the behavior of functional and causal decision theory in a few game-theoretical evolutionary environments. For any particular game, we will start off with a large population of agents (say 10,000). We may initially evenly split this population between the agents we are using, although we can experiment with the initial conditions to see what happens. We randomly pair agents from this population to face-off in the game for a number of rounds (say 100). We track the utilities they earn during this time.
To repopulate, we set a certain birth/death rate (say 1%). We then randomly select 1% of agents to copy/reproduce, weighted by their earned utility. We randomly select 1% of the agents to kill off, inversely weighted by their earned utility. We thereby randomly eliminate low-utility agents and spread high-utility agents. We also have a smaller mutation rate (say 0.1%). We uniformly randomly select 0.1% of the agents in the population and set their type to a uniformly random type. We can repeat this for many generations, dependent on the game. The specific parameters in each problem are chosen to be just large enough to settle on a clear winner. We track how the populations rates change over time given different initial conditions, testing the behavior of the agents in the game.