1- # -*- coding: utf-8 -*-
21from collections import Counter
32import itertools
43import random
54import unittest
65
6+ from hypothesis import given , example , settings
7+
78import axelrod
89from axelrod import MoranProcess
910from axelrod .moran import fitness_proportionate_selection
10-
11- from hypothesis import given , example , settings
12-
1311from axelrod .tests .property import strategy_lists
1412
1513
@@ -21,17 +19,6 @@ def test_fps(self):
2119 self .assertEqual (fitness_proportionate_selection ([1 , 1 , 1 ]), 0 )
2220 self .assertEqual (fitness_proportionate_selection ([1 , 1 , 1 ]), 2 )
2321
24- def test_stochastic (self ):
25- p1 , p2 = axelrod .Cooperator (), axelrod .Cooperator ()
26- mp = MoranProcess ((p1 , p2 ))
27- self .assertFalse (mp ._stochastic )
28- p1 , p2 = axelrod .Cooperator (), axelrod .Cooperator ()
29- mp = MoranProcess ((p1 , p2 ), noise = 0.05 )
30- self .assertTrue (mp ._stochastic )
31- p1 , p2 = axelrod .Cooperator (), axelrod .Random ()
32- mp = MoranProcess ((p1 , p2 ))
33- self .assertTrue (mp ._stochastic )
34-
3522 def test_exit_condition (self ):
3623 p1 , p2 = axelrod .Cooperator (), axelrod .Cooperator ()
3724 mp = MoranProcess ((p1 , p2 ))
@@ -62,7 +49,6 @@ def test_two_players_with_mutation(self):
6249 p1 , p2 = axelrod .Cooperator (), axelrod .Defector ()
6350 random .seed (5 )
6451 mp = MoranProcess ((p1 , p2 ), mutation_rate = 0.2 )
65- self .assertEqual (mp ._stochastic , True )
6652 self .assertDictEqual (mp .mutation_targets , {str (p1 ): [p2 ], str (p2 ): [p1 ]})
6753 # Test that mutation causes the population to alternate between fixations
6854 counters = [
@@ -99,7 +85,6 @@ def test_three_players_with_mutation(self):
9985 p3 = axelrod .Defector ()
10086 players = [p1 , p2 , p3 ]
10187 mp = MoranProcess (players , mutation_rate = 0.2 )
102- self .assertEqual (mp ._stochastic , True )
10388 self .assertDictEqual (mp .mutation_targets , {str (p1 ): [p3 , p2 ], str (p2 ): [p1 , p3 ], str (p3 ): [p1 , p2 ]})
10489 # Test that mutation causes the population to alternate between fixations
10590 counters = [
0 commit comments