#
# Author: Alina Quereilhac <alina.quereilhac@inria.fr>
+from __future__ import print_function
+
from nepi.execution.ec import ExperimentController
from nepi.execution.runner import ExperimentRunner
from nepi.util.netgraph import NetGraph, TopologyType
### Compute metric: Avg number of Interests seen per content name
### normalized by the number of nodes in the shortest path
- content_name_count = len(content_names.values())
+ content_name_count = len(content_names)
nodes_in_shortest_path = len(shortest_path) - 1
metric = interest_count / (float(content_name_count) * float(nodes_in_shortest_path))
# TODO: DUMP RESULTS TO FILE
# TODO: DUMP GRAPH DELAYS!
- f = open("/tmp/metric", "a+")
- f.write("%.2f\n" % metric)
- f.close()
- print " METRIC", metric
+ with open("/tmp/metric", "a+") as f:
+ f.write("%.2f\n" % metric)
+ print(" METRIC", metric)
return metric
add_node_callback = add_dce_node,
add_edge_callback = add_dce_edge)
- print "Results stored at", ec.exp_dir
+ print("Results stored at", ec.exp_dir)
#### Retrieve the consumer to wait for ot to finish
ccncat = ec.filter_resources("linux::ns3::dce::CCNCat")