diff options
Diffstat (limited to 'rumba/model.py')
-rw-r--r-- | rumba/model.py | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/rumba/model.py b/rumba/model.py index 25a1356..99bf5ed 100644 --- a/rumba/model.py +++ b/rumba/model.py @@ -37,8 +37,13 @@ class Testbed: self.exp_name = exp_name @abc.abstractmethod - def create_experiment(self, experiment): - raise Exception('create_experiment() not implemented') + def swap_in(self, experiment): + raise Exception('swap_in() not implemented') + + @abc.abstractmethod + def swap_out(self, experiment): + print("swap_out(): nothing to do") + # Base class for DIFs # @@ -605,10 +610,17 @@ class Experiment: self.compute_enrollments() self.compute_ipcps() - # Realize the experiment, using a testbed-specific setup - def swap_in(self): - self.testbed.create_experiment(self) - @abc.abstractmethod + def run_prototype(self): + raise Exception('run_prototype() method not implemented') + def run(self): - raise Exception('run() method not implemented') + # Realize the experiment testbed (testbed-specific) + self.testbed.swap_in(self) + + # Run the experiment using the prototype (prototype-specific) + self.run_prototype() + + # Undo the testbed (testbed-specific) + self.testbed.swap_out(self) + |