aboutsummaryrefslogtreecommitdiff
path: root/rumba/model.py
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2017-04-20 17:12:34 +0200
committerSander Vrijders <sander.vrijders@ugent.be>2017-04-21 11:28:35 +0200
commit009c8ff7570105a79278559202fdd46616b83a92 (patch)
tree06fc2bafc26683c82795db750187ff7cefdcc43e /rumba/model.py
parent06b3694633bd8315d55b5d75a2ca6c20afc54651 (diff)
downloadrumba-009c8ff7570105a79278559202fdd46616b83a92.tar.gz
rumba-009c8ff7570105a79278559202fdd46616b83a92.zip
model: Split experiment run()
This splits experiment.run() into 4 different operations: swap_in, install_prototype, bootstrap_prototype and swap_out.
Diffstat (limited to 'rumba/model.py')
-rw-r--r--rumba/model.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/rumba/model.py b/rumba/model.py
index 0d93fcd..d219edb 100644
--- a/rumba/model.py
+++ b/rumba/model.py
@@ -529,16 +529,17 @@ class Experiment:
self.compute_ipcps()
@abc.abstractmethod
- def run_prototype(self):
+ def install_prototype(self):
raise Exception('run_prototype() method not implemented')
- def run(self):
- try:
- # Realize the experiment testbed (testbed-specific)
- self.testbed.swap_in(self)
+ @abc.abstractmethod
+ def bootstrap_prototype(self):
+ raise Exception('run_prototype() method not implemented')
+
+ def swap_in(self):
+ # Realize the experiment testbed (testbed-specific)
+ self.testbed.swap_in(self)
- # Run the experiment using the prototype (prototype-specific)
- self.run_prototype()
- finally:
- # No matter what happens, undo the testbed (testbed-specific)
- self.testbed.swap_out(self)
+ def swap_out(self):
+ # Undo the testbed (testbed-specific)
+ self.testbed.swap_out(self)