From 963cade82a071c2bc8471e44fd30c2f573c8a536 Mon Sep 17 00:00:00 2001 From: Ben Green Date: Tue, 9 Jun 2015 17:18:25 -0400 Subject: fixed issue where non_vics only showing last parent rather than all --- experiments/build_network.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'experiments/build_network.py') diff --git a/experiments/build_network.py b/experiments/build_network.py index aae90db..8eb17ec 100644 --- a/experiments/build_network.py +++ b/experiments/build_network.py @@ -12,11 +12,13 @@ def build_network(filename): reader = DictReader(fh) for row in reader: from_, to = int(float(row["from"])), int(float(row["to"])) + dist = int(row["dist"]) if int(float(row["dist"])) > 2: continue + # 'to' is a victim if row["t2"] != "NA": dt = int(row["t2"]) - int(row["t1"]) - parent = (int(row["dist"]), dt) + parent = (dist, dt) if to not in victims: age += int(row["t2"]) victims[to] = [] @@ -24,10 +26,11 @@ def build_network(filename): if from_ not in victims: age += int(row["t1"]) victims[from_] = [] + # 'to' is not a victim else: - from_, to = int(float(row["from"])), int(float(row["to"])) - parent = (int(row["dist"]), 3012 - int(row["t1"])) - if to not in victims: + dt = 3012 - int(row["t1"]) + parent = (dist, dt) + if to not in non_victims: age += 3012 non_victims[to] = [] non_victims[to].append(parent) -- cgit v1.2.3-70-g09d2