Skip to content

Commit 5d83b63

Browse files
committed
Changing name to MetaMixer.
1 parent f3d1712 commit 5d83b63

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

axelrod/strategies/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
MetaPlayer, MetaMajority, MetaMinority, MetaWinner, MetaHunter,
1010
MetaMajorityMemoryOne, MetaWinnerMemoryOne, MetaMajorityFiniteMemory,
1111
MetaWinnerFiniteMemory, MetaMajorityLongMemory, MetaWinnerLongMemory,
12-
MetaMutater
12+
MetaMixer
1313
)
1414

1515
strategies.extend((MetaHunter, MetaMajority, MetaMinority, MetaWinner,
1616
MetaMajorityMemoryOne, MetaWinnerMemoryOne,
1717
MetaMajorityFiniteMemory, MetaWinnerFiniteMemory,
18-
MetaMajorityLongMemory, MetaWinnerLongMemory, MetaMutater))
18+
MetaMajorityLongMemory, MetaWinnerLongMemory, MetaMixer))
1919

2020
# Distinguished strategy collections in addition to
2121
# `strategies` from _strategies.py

axelrod/strategies/meta.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,13 @@ def __init__(self):
269269
self.init_args = ()
270270

271271

272-
class MetaMutater(MetaPlayer):
273-
"""A player who randomly switch between a team of players.
272+
class MetaMixer(MetaPlayer):
273+
"""A player who randomly switches between a team of players.
274274
If no distribution is passed then the player will uniformly choose between
275275
sub players.
276276
277+
In essence this is creating a Mixed strategy.
278+
277279
Parameters
278280
----------
279281
team : list of strategy classes, optional
@@ -284,7 +286,7 @@ class MetaMutater(MetaPlayer):
284286
If none is passed will select uniformly.
285287
"""
286288

287-
name = "Meta Mutater"
289+
name = "Meta Mixer"
288290

289291
def __init__(self, team=None, distribution=None):
290292

@@ -298,7 +300,7 @@ def __init__(self, team=None, distribution=None):
298300

299301
self.distribution = distribution
300302

301-
super(MetaMutater, self).__init__()
303+
super(MetaMixer, self).__init__()
302304
self.init_args = (team, distribution)
303305

304306
def meta_strategy(self, results, opponent):

axelrod/tests/unit/test_meta.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -286,10 +286,10 @@ def test_strategy(self):
286286
self.first_play_test(C)
287287

288288

289-
class TestMetaMutater(TestMetaPlayer):
289+
class TestMetaMixer(TestMetaPlayer):
290290

291-
name = "Meta Mutater"
292-
player = axelrod.MetaMutater
291+
name = "Meta Mixer"
292+
player = axelrod.MetaMixer
293293
expected_classifier = {
294294
'memory_depth': float('inf'), # Long memory
295295
'stochastic': True,
@@ -303,7 +303,7 @@ def test_strategy(self):
303303
team = [axelrod.TitForTat, axelrod.Cooperator, axelrod.Grudger]
304304
distribution = [.2, .5, .3]
305305

306-
P1 = axelrod.MetaMutater(team, distribution)
306+
P1 = axelrod.MetaMixer(team, distribution)
307307
P2 = axelrod.Cooperator()
308308

309309
for k in range(100):
@@ -312,14 +312,14 @@ def test_strategy(self):
312312
team.append(axelrod.Defector)
313313
distribution = [.2, .5, .3, 0] # If add a defector but does not occur
314314

315-
P1 = axelrod.MetaMutater(team, distribution)
315+
P1 = axelrod.MetaMixer(team, distribution)
316316

317317
for k in range(100):
318318
self.assertEqual(P1.strategy(P2), C)
319319

320320
distribution = [0, 0, 0, 1] # If defector is only one that is played
321321

322-
P1 = axelrod.MetaMutater(team, distribution)
322+
P1 = axelrod.MetaMixer(team, distribution)
323323

324324
for k in range(100):
325325
self.assertEqual(P1.strategy(P2), D)
@@ -328,7 +328,7 @@ def test_raise_error_in_distribution(self):
328328
team = [axelrod.TitForTat, axelrod.Cooperator, axelrod.Grudger]
329329
distribution = [.2, .5, .5] # Not a valid probability distribution
330330

331-
P1 = axelrod.MetaMutater(team, distribution)
331+
P1 = axelrod.MetaMixer(team, distribution)
332332
P2 = axelrod.Cooperator()
333333

334334
self.assertRaises(ValueError, P1.strategy, P2)

0 commit comments

Comments
 (0)