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.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/experiments/build_network.py b/experiments/build_network.py
index 23b958f..17c8bb5 100644
--- a/experiments/build_network.py
+++ b/experiments/build_network.py
@@ -11,15 +11,17 @@ def build_network(filename):
with open(filename) as fh:
reader = DictReader(fh)
for row in reader:
- print age
from_, to = int(float(row["from"])), int(float(row["to"]))
dist = int(row["dist"])
+ w1 = int(row["w1"])
+ w2 = int(row["w2"]) if dist>1 else float(row["w2"])
+ w3 = int(row["w3"]) if dist>2 else float(row["w3"])
if int(float(row["dist"])) > 2:
continue
# 'to' is a victim
if row["t2"] != "NA":
dt = int(row["t2"]) - int(row["t1"])
- parent = (dist, dt)
+ parent = (dist, dt, w1, w2, w3)
if to not in victims:
age += int(row["t2"]) - int(row["spawn2"])
victims[to] = []
@@ -30,7 +32,7 @@ def build_network(filename):
# 'to' is not a victim
else:
dt = 3012 - int(row["t1"])
- parent = (dist, dt)
+ parent = (dist, dt, w1, w2, w3)
if to not in non_victims:
age += 3012 - int(row["spawn2"])
non_victims[to] = []
@@ -43,7 +45,6 @@ def build_network(filename):
if not victims[victim]:
del victims[victim]
root_victims[victim] = []
- print age
return root_victims, victims, non_victims, age