Skip to content

Commit 354df19

Browse files
committed
Adjust test for length.
1 parent 603c0fb commit 354df19

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

docs/tutorials/further_topics/spatial_tournaments.rst

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,11 @@ It is also possible to create a probabilistic ending spatial tournament with the
7676
>>> prob_end_spatial_tournament = axl.ProbEndSpatialTournament(players, edges=edges, prob_end=.1, repetitions=1)
7777
>>> prob_end_results = prob_end_spatial_tournament.play(keep_interactions=True)
7878

79-
We see that the match lengths are no longer all equal (we are here printing the
80-
length of the interactions)::
79+
We see that the match lengths are no longer all equal::
8180

8281
>>> axl.seed(0)
83-
>>> for index_pair, interaction in prob_end_results.interactions.items():
84-
... player1 = spatial_tournament.players[index_pair[0]]
85-
... player2 = spatial_tournament.players[index_pair[1]]
86-
... rep_length = [len(rep) for rep in interaction]
87-
... print('%s vs %s: %s' % (player1, player2, rep_length))
88-
Defector vs Tit For Tat: [43]
89-
Cooperator vs Grudger: [7]
90-
Defector vs Grudger: [5]
91-
Cooperator vs Tit For Tat: [1]
82+
>>> lengths = []
83+
>>> for interaction in prob_end_results.interactions.values():
84+
... lengths.append(len(interaction[0]))
85+
>>> min(lengths) != max(lengths)
86+
True

0 commit comments

Comments
 (0)