Skip to content
Andrew F edited this page Jan 11, 2022 · 11 revisions

Let's break down a test and list the possibilities,

def test_single_simulation(self):#Runs the program and outputs time plot
    s = GameDynamicsWrapper(Costly_Signaling, WrightFisher, game_kwargs=dict(a=2))
    s.simulate(num_gens=50)

First choose a name for the test (test_single_simulation) This name can be any valid python string and will have no effect on the simulation

  • Generate the game wrapper s = GameDynamicsWrapper(...) if you wish to keep parameters constant. Otherwise you can use VariedGame if you would like to run multiple simulations varying parameters across them
  • First argument is the game to run
  • Second argument is the dynamics process (WrightFisher, Moran, and replicator dynamics are available)
  • 'game_kwargs' is an optional dictionary argument which changes parameters of the game (otherwise their default values chosen in the game will be used)
  • 'dynamics_kwargs' is an optional dictionary argument which changes dynamics parameters (see link for options)

Finally choose which simulation(s) the test should run (multiple instances of this line will run multiple simulations).

s.simulate(...)

If using GameDynamicsWrapper either simulate or simulate_many can be used

If using VariedGame vary_param varies one parameter and vary_2params varies two parameters

Clone this wiki locally