From acc777f02b93244d4d85446e890e94dbff2d6ada Mon Sep 17 00:00:00 2001 From: michele papalini Date: Wed, 5 Feb 2020 17:19:15 +0100 Subject: [HICN-503] correctly compute drop probability in RAAQM Signed-off-by: michele papalini Change-Id: I1b74a88c4d46aae178599f43ac6f223b29d4dfc5 --- libtransport/src/hicn/transport/protocols/raaqm.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libtransport') diff --git a/libtransport/src/hicn/transport/protocols/raaqm.cc b/libtransport/src/hicn/transport/protocols/raaqm.cc index 21a59bc9a..a57eb7cd9 100644 --- a/libtransport/src/hicn/transport/protocols/raaqm.cc +++ b/libtransport/src/hicn/transport/protocols/raaqm.cc @@ -567,7 +567,8 @@ void RaaqmTransportProtocol::RAAQM() { // Change drop probability according to RTT statistics cur_path_->updateDropProb(); - if (std::rand() % 10000 <= cur_path_->getDropProb() * 10000) { + double coin = ((double) rand() / (RAND_MAX)); + if (coin <= cur_path_->getDropProb()) { decreaseWindow(); } } -- cgit 1.2.3-korg