<jupyter_start><jupyter_text>Spatial Tournament Examples : Circle TopologyIn this notebook we will be performing a circle tournament. Ten random playersare selected by the list of strategies in Axelrod. Afterwards these players are allocatedinto a circle network where each player competes with their two neughboors. Then we plot the results.<jupyter_code># Python 3 
%matplotlib inline

import matplotlib.pyplot as plt
import random

# package for creation and visuliazation of networks
import networkx as nx 

import axelrod as axl
strategies = [s() for s in axl.ordinary_strategies]
players = random.sample(strategies, 10)
G = nx.cycle_graph(len(players))
pos = nx.circular_layout(G)
# for the nodes 
nx.draw_networkx_nodes(G,pos,
                       node_color='r',
                       node_size=100
                       )
# for the edges
nx.draw_networkx_edges(G,pos,
                       width=5, alpha = 0.5)
# using labels
labels={}
for i in range(len(players)):
    labels[i]= '%s' % (players[i])

nx.draw_networkx_labels(G,pos,labels,font_size=10)
plt.show()
edges = G.edges()
tournament = axl.Tournament(players, edges=G.edges(), repetitions=1)
results = tournament.play(processes=1)
results.ranked_names
plot = axl.Plot(results)
plot.boxplot();<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09259259259259259, 'fraction_numerical': 0.010030864197530864, 'mean_word_length': 3.9693486590038316, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '106153', 'license': 'MIT', 'n_tokens_mistral': 430, 'n_tokens_neox': 410, 'n_words': 121, 'path': 'Spatia-Circle-Structured-Example.ipynb', 'repo_name': 'Axelrod-Python/Axelrod-notebooks', 'size': '1296'}