Skip to content
Andrew F edited this page Aug 6, 2015 · 10 revisions

We break down each line below:

from wrapper import GameDynamicsWrapper, VariedGame

from dynamics.wright_fisher import WrightFisher 

from games.humbly_signaling import Costly_Signaling

import unittest

class TestCase(unittest.TestCase):
    def setUp(self):
        import logging
        logging.basicConfig(filename='debug.log', level=logging.DEBUG) 

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

if __name__ == '__main__':
    unittest.main()

First determine which dynamic processes are necessary and import them in place of:

from dynamics.wright_fisher import WrightFisher 

The game you would like to test:

from games.humbly_signaling import Costly_Signaling

Any tests you would like to run:

def test_single_simulation(self):#Runs the program and outputs time plot
    s = GameDynamicsWrapper(Costly_Signaling, WrightFisher)
    s.simulate(num_gens=50, graph=dict(NAME=True))
Clone this wiki locally