diff options
Diffstat (limited to 'experiments/build_network.py')
| -rw-r--r-- | experiments/build_network.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/experiments/build_network.py b/experiments/build_network.py index 0756ded..0e912b0 100644 --- a/experiments/build_network.py +++ b/experiments/build_network.py @@ -19,7 +19,7 @@ def build_network(filename): # '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,10 +39,13 @@ def build_network(filename): age += int(row["t1"]) - int(row["spawn1"]) victims[from_] = [] root_victims = {} + print sorted(victims.keys()) + # print victims for victim in victims.keys(): if not victims[victim]: del victims[victim] root_victims[victim] = [] + print sorted(root_victims.keys()) print len(root_victims), len(victims), len(non_victims) return root_victims, victims, non_victims, age |
