From 8ec78b075be192cac3cf31ec009eee8446e4d078 Mon Sep 17 00:00:00 2001 From: Quentin De Coninck Date: Thu, 28 Sep 2017 09:55:29 +0200 Subject: [PATCH] adding type cast to be sure... --- src/mpLinkCharacteristics.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mpLinkCharacteristics.py b/src/mpLinkCharacteristics.py index 7ab63aa..e5cd68d 100644 --- a/src/mpLinkCharacteristics.py +++ b/src/mpLinkCharacteristics.py @@ -15,12 +15,12 @@ class MpLinkCharacteristics: def extractQueuingDelay(queueSize, bandwidth, delay, mtu=1500): rtt = 2 * float(delay) - bdp_queue_size = int(rtt * float(bandwidth) * 1024 * 1024 / (mtu * 8 * 1000)) + bdp_queue_size = int((float(rtt) * float(bandwidth) * 1024 * 1024) / (int(mtu) * 8 * 1000)) if int(queueSize) <= bdp_queue_size: return 0 queuingQueueSize = int(queueSize) - bdp_queue_size - queuingDelay = (queuingQueueSize * mtu * 8 * 1000) / (float(bandwidth) * 1024 * 1024) + queuingDelay = (queuingQueueSize * int(mtu) * 8 * 1000) / (float(bandwidth) * 1024 * 1024) return int(queuingDelay) def __init__(self, id, delay, queueSize, bandwidth, loss, back_up=False):