Skip to content

Commit f8391f6

Browse files
authored
Normalize -> Normalise (#1452)
1 parent 42ecb93 commit f8391f6

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

axelrod/interaction_utils.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def compute_state_distribution(interactions):
117117

118118
def compute_normalised_state_distribution(interactions):
119119
"""
120-
Returns the normalized count of each state for a set of interactions.
120+
Returns the normalised count of each state for a set of interactions.
121121
122122
Parameters
123123
----------
@@ -127,8 +127,8 @@ def compute_normalised_state_distribution(interactions):
127127
128128
Returns
129129
----------
130-
normalized_count : Counter Object
131-
Dictionary where the keys are the states and the values are a normalized
130+
normalised_count : Counter Object
131+
Dictionary where the keys are the states and the values are a normalised
132132
count of the number of times that state occurs.
133133
"""
134134
if not interactions:
@@ -137,10 +137,10 @@ def compute_normalised_state_distribution(interactions):
137137
interactions_count = Counter(interactions)
138138
total = sum(interactions_count.values(), 0)
139139

140-
normalized_count = Counter(
140+
normalised_count = Counter(
141141
{key: value / total for key, value in interactions_count.items()}
142142
)
143-
return normalized_count
143+
return normalised_count
144144

145145

146146
def compute_state_to_action_distribution(interactions):
@@ -213,14 +213,14 @@ def compute_normalised_state_to_action_distribution(interactions):
213213
-------
214214
normalised_state_to_C_distributions : List of Counter Object
215215
List of Counter objects where the keys are the states and actions and
216-
the values the normalized counts. The first/second Counter corresponds
216+
the values the normalised counts. The first/second Counter corresponds
217217
to the first/second player.
218218
"""
219219
if not interactions:
220220
return None
221221

222222
distribution = compute_state_to_action_distribution(interactions)
223-
normalized_distribution = []
223+
normalised_distribution = []
224224
for player in range(2):
225225
counter = {}
226226
for state in [(C, C), (C, D), (D, C), (D, D)]:
@@ -232,8 +232,8 @@ def compute_normalised_state_to_action_distribution(interactions):
232232
counter[(state, C)] = C_count / (C_count + D_count)
233233
if D_count > 0:
234234
counter[(state, D)] = D_count / (C_count + D_count)
235-
normalized_distribution.append(Counter(counter))
236-
return normalized_distribution
235+
normalised_distribution.append(Counter(counter))
236+
return normalised_distribution
237237

238238

239239
def sparkline(actions, c_symbol="█", d_symbol=" "):

0 commit comments

Comments
 (0)