Skip to content

Commit 11373a9

Browse files
authored
Merge pull request #1399 from Axelrod-Python/marcharper-patch-3
Add a thesis to citations
2 parents 00e1832 + a72e44b commit 11373a9

File tree

7 files changed

+16
-13
lines changed

7 files changed

+16
-13
lines changed

axelrod/compute_finite_state_machine_memory.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ def get_accessible_transitions(
113113
if trans.state in accessible_states:
114114
accessible_transitions[
115115
(trans.state, trans.last_opponent_action)
116-
] = (trans.next_state, trans.next_action)
116+
] = (
117+
trans.next_state,
118+
trans.next_action,
119+
)
117120

118121
return accessible_transitions
119122

axelrod/fingerprint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def _create_points(step: float, progress_bar: bool = True) -> List[Point]:
4242
num = int((1 / step) // 1) + 1
4343

4444
if progress_bar:
45-
p_bar = tqdm.tqdm(total=num ** 2, desc="Generating points")
45+
p_bar = tqdm.tqdm(total=num**2, desc="Generating points")
4646

4747
points = []
4848
for x in np.linspace(0, 1, num):

axelrod/random_.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def randint(self, *args, **kwargs):
2929
return self._random.randint(*args, **kwargs)
3030

3131
def random_seed_int(self) -> int:
32-
return self.randint(low=0, high=2 ** 32 - 1, dtype="uint64")
32+
return self.randint(low=0, high=2**32 - 1, dtype="uint64")
3333

3434
def choice(self, *args, **kwargs):
3535
return self._random.choice(*args, **kwargs)
@@ -132,7 +132,7 @@ def _fill_ints(self):
132132
# Generate more random values. Store as a list since generators
133133
# cannot be pickled.
134134
self._ints = self._random_generator.randint(
135-
low=0, high=2 ** 32 - 1, size=self._batch_size, dtype="uint64"
135+
low=0, high=2**32 - 1, size=self._batch_size, dtype="uint64"
136136
)
137137
self._index = 0
138138

axelrod/strategies/hmm.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ def _normalize_parameters(
327327
emission_probabilities = list(map(float, emission_probabilities))
328328
num_states = len(emission_probabilities)
329329
if mutation_probability is None:
330-
mutation_probability = 10 / (num_states ** 2)
330+
mutation_probability = 10 / (num_states**2)
331331
else:
332332
mutation_probability = mutation_probability
333333
return (
@@ -432,7 +432,7 @@ class with self.num_states.
432432
entry is the initial_action.
433433
"""
434434

435-
assert len(vector) == 2 * self.num_states ** 2 + self.num_states + 1
435+
assert len(vector) == 2 * self.num_states**2 + self.num_states + 1
436436

437437
def deserialize(vector):
438438
matrix = []
@@ -442,9 +442,9 @@ def deserialize(vector):
442442
matrix.append(row)
443443
return matrix
444444

445-
break_tc = self.num_states ** 2
446-
break_td = 2 * self.num_states ** 2
447-
break_ep = 2 * self.num_states ** 2 + self.num_states
445+
break_tc = self.num_states**2
446+
break_td = 2 * self.num_states**2
447+
break_ep = 2 * self.num_states**2 + self.num_states
448448
initial_state = 0
449449
self.hmm = SimpleHMM(
450450
deserialize(vector[0:break_tc]),
@@ -457,7 +457,7 @@ def deserialize(vector):
457457

458458
def create_vector_bounds(self):
459459
"""Creates the bounds for the decision variables."""
460-
vec_len = 2 * self.num_states ** 2 + self.num_states + 1
460+
vec_len = 2 * self.num_states**2 + self.num_states + 1
461461
lb = [0.0] * vec_len
462462
ub = [1.0] * vec_len
463463
return lb, ub

axelrod/tests/strategies/test_hmm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def test_vector_to_instance(self):
266266

267267
def test_create_vector_bounds(self):
268268
num_states = 4
269-
size = 2 * num_states ** 2 + num_states + 1
269+
size = 2 * num_states**2 + num_states + 1
270270

271271
player = self.player_class(num_states=num_states, seed=1)
272272
lb, ub = player.create_vector_bounds()

axelrod/tests/strategies/test_player.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def test_clone(self):
138138
player2 = player1.clone()
139139
turns = 50
140140
for op in [axl.Cooperator(), axl.Defector(), axl.TitForTat()]:
141-
seed = random.randint(0, 10 ** 6)
141+
seed = random.randint(0, 10**6)
142142
for p in [player1, player2]:
143143
m = axl.Match((p, op), turns=turns, reset=True, seed=seed)
144144
m.play()

citations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Citations
22

33
### 2021
4-
54
* Glynatsi, Nikoleta E., and Vincent A. Knight. "A bibliometric study of research topics, collaboration, and centrality in the iterated prisoner’s dilemma." Humanities and Social Sciences Communications 8.1 (2021): 1-12. [Nature.com](https://www.nature.com/articles/s41599-021-00718-9) [ArXiv](https://arxiv.org/abs/1911.06128)
65
* Glynatsi, Nikoleta E., and Vincent A. Knight. "Game Theory and Python: An educational tutorial to game theory and repeated games using Python." Journal of Open Source Education, 4(39), 78. [jose.theoj.org](https://doi.org/10.21105/jose.00078)
76

@@ -47,6 +46,7 @@
4746

4847
### Disserations
4948

49+
* Dollbo, Anna. MIXED MEMORY Q-LEARNER: An adaptive reinforcement learning algorithm for the Iterated Prisoner’s Dilemma. [BS thesis](https://gupea.ub.gu.se/handle/2077/69664). 2021.
5050
* Glynatsi, Nikoleta. "Understanding responses to environments for the Prisoner's Dilemma: A meta analysis, multidimensional optimisation and machine learning approach". PhD Thesis, Cardiff University. (2020) [Available Online](http://orca.cf.ac.uk/135221/).
5151
* Santana, Jonas Cardoso Carvalho. "Aprendizado de máquina e o dilema dos prisioneiros". (2020)
5252
* Black, Ben. "An Empirical Evaluation of the Ohtsuki-Nowak Approximation." [Master's Thesis](https://www.lancaster.ac.uk/~blackb/documents/MScDiss.pdf). (2018).

0 commit comments

Comments
 (0)