blob: 6baacd5d5719f8598e4a05665fd65a93a06f752e [file] [log] [blame]
Ashlesh Gawande27b5e1b2018-08-06 17:47:15 -05001# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2#
3# Copyright (C) 2015-2018, The University of Memphis,
4# Arizona Board of Regents,
5# Regents of the University of California.
6#
7# This file is part of Mini-NDN.
8# See AUTHORS.md for a complete list of Mini-NDN authors and contributors.
9#
10# Mini-NDN is free software: you can redistribute it and/or modify
11# it under the terms of the GNU General Public License as published by
12# the Free Software Foundation, either version 3 of the License, or
13# (at your option) any later version.
14#
15# Mini-NDN is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU General Public License for more details.
19#
20# You should have received a copy of the GNU General Public License
21# along with Mini-NDN, e.g., in COPYING.md file.
22# If not, see <http://www.gnu.org/licenses/>.
23
Alexander Lane1bc9b472018-05-16 15:07:16 -050024from ndn.experiments.experiment import Experiment
25
26class ArgumentsExperiment(Experiment):
27 def __init__(self, args):
28 Experiment.__init__(self, args)
Ashlesh Gawande27b5e1b2018-08-06 17:47:15 -050029 self.ds = self.options.arguments.ds
30 self.logging = self.options.arguments.logging
31
32 def start(self):
33 pass
Alexander Lane1bc9b472018-05-16 15:07:16 -050034
35 def setup(self):
36 pass
37
38 def run(self):
39 print("Argument ds: {}".format(self.ds))
40 print("Argument logging: {}".format(self.logging))
41
42 @staticmethod
43 def parseArguments(parser):
44 parser.add_argument("--ds", dest="ds", default="1000",
45 help="[Arguments Experiment] Number of data streams")
46 parser.add_argument("--logging", dest="logging", action="store_true",
47 help="[Arguments Experiment] Enable logging")
48
49Experiment.register("args-exp", ArgumentsExperiment)