summaryrefslogtreecommitdiffstats
path: root/experiments/build_network.py
diff options
context:
space:
mode:
Diffstat (limited to 'experiments/build_network.py')
-rw-r--r--experiments/build_network.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/experiments/build_network.py b/experiments/build_network.py
index 6cb994c..0e912b0 100644
--- a/experiments/build_network.py
+++ b/experiments/build_network.py
@@ -14,12 +14,12 @@ def build_network(filename):
from_, to = int(float(row["from"])), int(float(row["to"]))
dist = int(row["dist"])
w1, w2, w3 = float(row["w1"]), float(row["w2"]), float(row["w3"])
- if int(float(row["dist"])) > 1:
- continue
+ # if int(float(row["dist"])) > 1:
+ # continue
# 'to' is a victim
if row["t2"] != "NA":
dt = int(row["t2"]) - int(row["t1"])
- parent = (dist, dt, w1, w2, w3)
+ parent = (from_, dist, dt, w1, w2, w3)
if to not in victims:
age += int(row["t2"]) - int(row["spawn2"])
victims[to] = []
@@ -29,8 +29,8 @@ def build_network(filename):
victims[from_] = []
# 'to' is not a victim
else:
- dt = 3012 - int(row["t1"])
- parent = (dist, dt, w1, w2, w3)
+ dt = 1000 - int(row["t1"])
+ parent = (from_, dist, dt, w1, w2, w3)
if to not in non_victims:
# age += 3012 - int(row["spawn2"])
non_victims[to] = []
@@ -39,13 +39,14 @@ def build_network(filename):
age += int(row["t1"]) - int(row["spawn1"])
victims[from_] = []
root_victims = {}
- # print victims.keys()
+ print sorted(victims.keys())
+ # print victims
for victim in victims.keys():
if not victims[victim]:
del victims[victim]
root_victims[victim] = []
- # print root_victims.keys()
- # print len(root_victims), len(victims), len(non_victims)
+ print sorted(root_victims.keys())
+ print len(root_victims), len(victims), len(non_victims)
return root_victims, victims, non_victims, age