@@ -51,6 +51,15 @@ def __init__(self, memory_depth: int = float('inf'), soft: bool = True) -> None:
5151 self .memory = self .classifier ['memory_depth' ]
5252 else :
5353 self .memory = 0
54+ self .name = (
55+ 'Go By Majority' + (self .memory > 0 ) * (": %i" % self .memory ))
56+ if self .soft :
57+ self .name = "Soft " + self .name
58+ else :
59+ self .name = "Hard " + self .name
60+
61+ def __repr__ (self ):
62+ return self .name
5463
5564 def strategy (self , opponent : Player ) -> Action :
5665 """This is affected by the history of the opponent.
@@ -77,7 +86,7 @@ class GoByMajority40(GoByMajority):
7786 """
7887 GoByMajority player with a memory of 40.
7988 """
80- name = 'Soft Go By Majority 40'
89+ name = 'Go By Majority 40'
8190 classifier = copy .copy (GoByMajority .classifier )
8291 classifier ['memory_depth' ] = 40
8392
@@ -89,7 +98,7 @@ class GoByMajority20(GoByMajority):
8998 """
9099 GoByMajority player with a memory of 20.
91100 """
92- name = 'Soft Go By Majority 20'
101+ name = 'Go By Majority 20'
93102 classifier = copy .copy (GoByMajority .classifier )
94103 classifier ['memory_depth' ] = 20
95104
@@ -101,7 +110,7 @@ class GoByMajority10(GoByMajority):
101110 """
102111 GoByMajority player with a memory of 10.
103112 """
104- name = 'Soft Go By Majority 10'
113+ name = 'Go By Majority 10'
105114 classifier = copy .copy (GoByMajority .classifier )
106115 classifier ['memory_depth' ] = 10
107116
@@ -113,7 +122,7 @@ class GoByMajority5(GoByMajority):
113122 """
114123 GoByMajority player with a memory of 5.
115124 """
116- name = 'Soft Go By Majority 5'
125+ name = 'Go By Majority 5'
117126 classifier = copy .copy (GoByMajority .classifier )
118127 classifier ['memory_depth' ] = 5
119128
0 commit comments