Skip to content

Commit d496a78

Browse files
committed
Improve docstring for Player.reset
1 parent 20b4a8c commit d496a78

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

axelrod/player.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,16 @@ def clone(self):
241241
return new_player
242242

243243
def reset(self):
244-
"""
245-
Resets history.
246-
When creating strategies that create new attributes then this method
247-
should be re-written (in the inherited class) and should not only reset
248-
history but also rest all other attributes.
244+
"""Resets a player to its initial state
245+
246+
This method is called at the beginning of each match (between a pair
247+
of players) to reset a player's state to its initial starting point.
248+
It ensures that no 'memory' of previous matches is carried forward.
249+
250+
The default method resets a player's history, cooperations, defections
251+
and state_distribution. Players which have further attributes need to
252+
override this method and ensure those additional attributes are also
253+
reset.
249254
"""
250255
self.history = []
251256
self.cooperations = 0

0 commit comments

Comments
 (0)