summaryrefslogtreecommitdiffstats
path: root/sources
diff options
context:
space:
mode:
Diffstat (limited to 'sources')
-rw-r--r--sources/thibaut/pacemaker.ml4
-rw-r--r--sources/thibaut/plot.py22
2 files changed, 21 insertions, 5 deletions
diff --git a/sources/thibaut/pacemaker.ml b/sources/thibaut/pacemaker.ml
index f634fa8..12d3597 100644
--- a/sources/thibaut/pacemaker.ml
+++ b/sources/thibaut/pacemaker.ml
@@ -116,8 +116,8 @@ let process_message oc current_round peer m =
peer.nproofs <- peer.nproofs + 1
end;
SlotArray.iter (send_message message) peer.slots;
- peer.history <- RoundMap.add m.round
- (seed, branch2) peer.history;
+ (*peer.history <- RoundMap.add m.round
+ (seed, branch2) peer.history;*)
with
| Not_found -> ()
with
diff --git a/sources/thibaut/plot.py b/sources/thibaut/plot.py
index aefa5ab..a4c847b 100644
--- a/sources/thibaut/plot.py
+++ b/sources/thibaut/plot.py
@@ -1,15 +1,31 @@
+# -*- coding: utf-8 -*-
+from matplotlib import rc
import numpy as np
import matplotlib.pyplot as plt
import sys
import os
import math
-
+#rc('text', usetex=True)
+rc('font', family='serif')
dirname = sys.argv[1]
+a = np.array([1, 20, 176, 1493, 11135, 35572, 6279, 106.])
+b = np.array([1, 20, 176, 1278, 3312, 325, 2.])
+c = np.array([1, 20, 152, 338, 23., 0])
+plt.plot(a/sum(a),"k--",label="$10^5$ pairs")
+plt.plot(b/sum(b),"k:", label="$10^4$ pairs")
+plt.plot(c/sum(c),"k-", label="$10^3$ pairs")
+plt.ylabel("Pourcentage de pairs")
+plt.xlabel(u'Distance à la racine')
+plt.legend(loc=2)
+plt.savefig("mesh.eps",transparent=False)
+plt.show()
+
"""rounds = os.path.join(dirname, "rounds.data")
a = np.loadtxt(rounds, unpack=True, usecols=(1,))
plt.plot(a)
-plt.savefig(os.path.join(dirname, "rounds.png"))"""
+plt.savefig(os.path.join(dirname, "rounds.png"))
+
plt.cla()
sessions = os.path.join(dirname, "sessions.data")
@@ -30,6 +46,6 @@ a,b = np.loadtxt(simul_sessions, unpack=True, usecols=(1,2))
plt.plot(a)
plt.plot(b*10)
plt.show()
-#for i in xrange(len(duration)):
+#for i in xrange(len(duration)):"""