Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions axelrod/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,16 @@ def clone(self):
return new_player

def reset(self):
"""
Resets history.
When creating strategies that create new attributes then this method
should be re-written (in the inherited class) and should not only reset
history but also rest all other attributes.
"""Resets a player to its initial state

This method is called at the beginning of each match (between a pair
of players) to reset a player's state to its initial starting point.
It ensures that no 'memory' of previous matches is carried forward.

The default method resets a player's history, cooperations, defections
and state_distribution. Players which have further attributes need to
override this method and ensure those additional attributes are also
reset.
"""
self.history = []
self.cooperations = 0
Expand Down