blob: 159e2a7bb0023ab7c9f53362574a356b181b0fa1 [file] [log] [blame]
Ashlesh Gawande501d4d62017-10-25 13:12:11 -05001from ndn.experiments.experiment import Experiment
2
3class AbitraryArgumentsExperiment(Experiment):
4 def __init__(self, args):
5 Experiment.__init__(self, args)
6 if "ds" in self.arbArgs:
7 self.ds = int(self.arbArgs["ds"])
8 else:
9 self.ds = 1000
10
11 if "logging" in self.arbArgs:
12 self.logging = self.arbArgs["logging"]
13 if self.logging == "true":
14 self.logging = True
15 else:
16 self.logging = False
17 else:
18 self.logging = False
19
20 def setup(self):
21 pass
22
23 def run(self):
24 print("Argument ds: {}".format(self.ds))
25 print("Argument logging: {}".format(self.logging))
26
27 @staticmethod
28 def arguments():
29 ''' This will be printed in sudo minindn --list-experiments'''
30 return "--ds <num-data-streams> --logging <true/false>"
31
32Experiment.register("arbitrary-arguments", AbitraryArgumentsExperiment)