aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/DropRateSearch.py
diff options
context:
space:
mode:
authorPeter Mikus <pmikus@cisco.com>2016-05-13 09:57:03 +0200
committerPeter Mikus <pmikus@cisco.com>2016-05-26 15:13:04 +0200
commitf94e16167519c74707ec8b606da3f7b97c749c66 (patch)
tree91ac71037bce4bd1e0ce9a52e67802e2c0f808a7 /resources/libraries/python/DropRateSearch.py
parent52913516a16429a0ec6573260cf946223c84f34d (diff)
Find PDR using binary search
- JIRA: CSIT-72 - modify libraries for PDR search evaluation - write robot framework keywords for PDR search - write Performance Test Cases using PDR Change-Id: Id06a2a7f78fe8626c221afe4178c5c30cc599762 Signed-off-by: Peter Mikus <pmikus@cisco.com>
Diffstat (limited to 'resources/libraries/python/DropRateSearch.py')
-rw-r--r--resources/libraries/python/DropRateSearch.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/resources/libraries/python/DropRateSearch.py b/resources/libraries/python/DropRateSearch.py
index 8f8e371add..1f8e5618fe 100644
--- a/resources/libraries/python/DropRateSearch.py
+++ b/resources/libraries/python/DropRateSearch.py
@@ -135,6 +135,49 @@ class DropRateSearch(object):
self._rate_max = float(max_rate)
self._rate_min = float(min_rate)
+ def set_loss_acceptance(self, loss_acceptance):
+ """Set loss acceptance treshold for PDR search.
+
+ :param loss_acceptance: Loss acceptance treshold for PDR search.
+ :type loss_acceptance: str
+ :return: nothing
+ """
+ if float(loss_acceptance) < 0:
+ raise ValueError("Loss acceptance must be higher or equal 0")
+ else:
+ self._loss_acceptance = float(loss_acceptance)
+
+ def get_loss_acceptance(self):
+ """Return configured loss acceptance treshold.
+
+ :return: Loss acceptance treshold.
+ :rtype: float
+ """
+ return self._loss_acceptance
+
+ def set_loss_acceptance_type_percentage(self):
+ """Set loss acceptance treshold type to percentage.
+
+ :return: nothing
+ """
+ self._loss_acceptance_type = LossAcceptanceType.PERCENTAGE
+
+ def set_loss_acceptance_type_frames(self):
+ """Set loss acceptance treshold type to frames.
+
+ :return: nothing
+ """
+ self._loss_acceptance_type = LossAcceptanceType.FRAMES
+
+ def loss_acceptance_type_is_percentage(self):
+ """Return true if loss acceptance treshold type is percentage,
+ false otherwise.
+
+ :return: True if loss acceptance treshold type is percentage.
+ :rtype: boolean
+ """
+ return self._loss_acceptance_type == LossAcceptanceType.PERCENTAGE
+
def set_search_linear_step(self, step_rate):
"""Set step size for linear search.