Axelrod-Python/Axelrod

Retains history classifier

marcharper opened this issue · 2 comments

In the course of #1288 I added a test for Match reproducibility given a random seed. The strategy Darwin fails this test because it retains history at the class level. While this is an exception now, it's easy to imagine future games or variations that would intentionally retain history (in a way that's not considered cheating). So perhaps it makes sense to have a classifier field for "retains_history".

This is the (failing) test:

    def test_reproducibility_of_play(self):
        player = self.player()
        player_clone = player.clone()
        coplayer = axl.Random(0.5)
        coplayer_clone = coplayer.clone()
        m1 = axl.Match((player, coplayer), turns=10, seed=10)
        m2 = axl.Match((player_clone, coplayer_clone), turns=10, seed=10)
        m1.play()
        m2.play()
        self.assertEqual(m1.result, m2.result)`

I realize now this test is quite similar to the existing test_clone which excludes Darwin and Human, nevertheless perhaps the classifier still makes sense.

So perhaps it makes sense to have a classifier field for "retains_history".

Sounds good to me 👍