diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..1ec30b3
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..7753484
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/swdata.iml b/.idea/swdata.iml
new file mode 100644
index 0000000..e98082a
--- /dev/null
+++ b/.idea/swdata.iml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 0000000..4f5074b
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,236 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1542406343161
+
+
+ 1542406343161
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/draw_network.py b/draw_network.py
new file mode 100644
index 0000000..c20148f
--- /dev/null
+++ b/draw_network.py
@@ -0,0 +1,67 @@
+import networkx as nx
+from matplotlib import pyplot as plt
+from island.match import Match
+from island.matches import Matches
+
+
+class Draw:
+ def __init__(self, show):
+ self.matches = Matches.from_profile_expr(lambda r: True)
+ self.show = show
+
+ def generate_graph(self, match):
+ g = nx.empty_graph()
+ for r in match.query('player', 'join').raw_data:
+ g.add_node(r['pid'])
+ for r in match.query('action', 'done').raw_data:
+ if r['a'] > r['b']:
+ f, t = r['b'], r['a']
+ else:
+ f, t = r['a'], r['b']
+ if g.has_edge(f, t):
+ g.edges[f, t]['weight'] += 1
+ else:
+ g.add_edge(f, t, weight=1, t=1)
+
+ for r in match.query('neighbor', 'create').raw_data:
+ if r['a'] > r['b']:
+ f, t = r['b'], r['a']
+ else:
+ f, t = r['a'], r['b']
+ if g.has_edge(f, t):
+ g.edges[f, t]['t'] |= 2
+ else:
+ g.add_edge(f, t, weight=1, t=2)
+ return g
+
+ def draw_graph(self, g, m):
+ social_edges = []
+ game_edges = []
+ weight = []
+ for e in g.edges():
+ if g[e[0]][e[1]]['t'] & 1 == 1:
+ game_edges.append(e)
+ weight.append(g[e[0]][e[1]]['weight'])
+ else:
+ social_edges.append(e)
+
+ pos = nx.spring_layout(g, scale=0.3)
+ nx.draw_networkx_edges(g, edgelist=social_edges, pos=pos, edge_color='gray', alpha=0.8, style='dashed')
+ nx.draw_networkx_edges(g, edgelist=game_edges, pos=pos, width=weight, alpha=0.8, edge_color='#d63031')
+ nx.draw_networkx_nodes(g, pos=pos, node_color='#0984e3', node_size=300)
+
+ if self.show:
+ plt.show()
+ else:
+ plt.savefig("graph/%s-cluster.eps"%m.name)
+
+
+ def draw_a_graph(self, name):
+ for m in self.matches.data:
+ if m.name == name:
+ g = self.generate_graph(m)
+ self.draw_graph(g, m)
+
+if __name__ == '__main__':
+ d = Draw(True)
+ d.draw_a_graph('G398')
\ No newline at end of file