Alexander Lane | 1bc9b47 | 2018-05-16 15:07:16 -0500 | [diff] [blame] | 1 | from ndn.experiments.experiment import Experiment |
| 2 | |
| 3 | class ArgumentsExperiment(Experiment): |
| 4 | def __init__(self, args): |
| 5 | Experiment.__init__(self, args) |
| 6 | self.ds = self.arguments.ds |
| 7 | self.logging = self.arguments.logging |
| 8 | |
| 9 | def setup(self): |
| 10 | pass |
| 11 | |
| 12 | def run(self): |
| 13 | print("Argument ds: {}".format(self.ds)) |
| 14 | print("Argument logging: {}".format(self.logging)) |
| 15 | |
| 16 | @staticmethod |
| 17 | def parseArguments(parser): |
| 18 | parser.add_argument("--ds", dest="ds", default="1000", |
| 19 | help="[Arguments Experiment] Number of data streams") |
| 20 | parser.add_argument("--logging", dest="logging", action="store_true", |
| 21 | help="[Arguments Experiment] Enable logging") |
| 22 | |
| 23 | Experiment.register("args-exp", ArgumentsExperiment) |