diff options
author | Sander Vrijders <sander.vrijders@ugent.be> | 2018-03-27 16:40:59 +0200 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@ugent.be> | 2018-03-28 16:41:40 +0200 |
commit | e694075c7fdcc9c4579d55b792da7a1391401b35 (patch) | |
tree | cc75c83e5ef17133c2f9e754be3eb0ebee4d6984 /rumba/storyboard.py | |
parent | a1bddf0ab2cd7bee30b1f0dc1575c0b8c532e157 (diff) | |
download | rumba-e694075c7fdcc9c4579d55b792da7a1391401b35.tar.gz rumba-e694075c7fdcc9c4579d55b792da7a1391401b35.zip |
testbeds, prototypes, model: Add docstrings
This adds docstrings for methods of in the testbeds, prototypes and
certain things in the model.
Diffstat (limited to 'rumba/storyboard.py')
-rw-r--r-- | rumba/storyboard.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/rumba/storyboard.py b/rumba/storyboard.py index ba6883d..2de21ff 100644 --- a/rumba/storyboard.py +++ b/rumba/storyboard.py @@ -48,13 +48,13 @@ except ImportError: logger = log.get_logger(__name__) try: - from numpy.random import poisson - from numpy.random import exponential + from numpy.random import poisson as _poisson + from numpy.random import exponential as _exponential logger.debug("Using numpy for faster and better random variables.") except ImportError: - from rumba.recpoisson import poisson + from rumba.recpoisson import poisson as _poisson - def exponential(mean_duration): + def _exponential(mean_duration): return random.expovariate(1.0 / mean_duration) logger.debug("Falling back to simple implementations.") @@ -249,12 +249,12 @@ class Server(SBEntity): interval seconds. Hence, the average size should be interval * arrival_rate. """ - number = poisson(self.arrival_rate * interval) + number = _poisson(self.arrival_rate * interval) number = int(min(number, self.max_clients)) return [self._make_process_arguments() for _ in range(number)] def get_duration(self): - return exponential(self.actual_parameter) + self.min_duration + return _exponential(self.actual_parameter) + self.min_duration def _make_process_arguments(self, duration=None, node=None, proc_id=None, client=None): |