Arbitrary arguments
refs: #4360
Change-Id: I1c746c3349a72d1e262b75d4a864f096a2dfc018
diff --git a/ndn/experiments/arbitrary_arguments_experiment.py b/ndn/experiments/arbitrary_arguments_experiment.py
new file mode 100644
index 0000000..159e2a7
--- /dev/null
+++ b/ndn/experiments/arbitrary_arguments_experiment.py
@@ -0,0 +1,32 @@
+from ndn.experiments.experiment import Experiment
+
+class AbitraryArgumentsExperiment(Experiment):
+ def __init__(self, args):
+ Experiment.__init__(self, args)
+ if "ds" in self.arbArgs:
+ self.ds = int(self.arbArgs["ds"])
+ else:
+ self.ds = 1000
+
+ if "logging" in self.arbArgs:
+ self.logging = self.arbArgs["logging"]
+ if self.logging == "true":
+ self.logging = True
+ else:
+ self.logging = False
+ else:
+ self.logging = False
+
+ def setup(self):
+ pass
+
+ def run(self):
+ print("Argument ds: {}".format(self.ds))
+ print("Argument logging: {}".format(self.logging))
+
+ @staticmethod
+ def arguments():
+ ''' This will be printed in sudo minindn --list-experiments'''
+ return "--ds <num-data-streams> --logging <true/false>"
+
+Experiment.register("arbitrary-arguments", AbitraryArgumentsExperiment)
\ No newline at end of file