Created
October 19, 2019 22:04
-
-
Save cawka/a72f97bf98c49e3935a7738d8ff3406c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rto = 3000 | |
sample=0 | |
x = [400.0, 200.0, 200.0, 200.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0] | |
srtt = 0 | |
for i in x: | |
if srtt == 0: | |
srtt = i | |
devRtt = srtt / 2.0 | |
else: | |
srtt = 7/8 * srtt + 1/8 * i | |
sample = abs(srtt - i) | |
devRtt = 3/4 * devRtt + 1/4 * sample | |
rto = srtt + 4 * devRtt | |
print(f"rtt_i={i},srtt={srtt}, devRtt={devRtt}, sample={sample}") | |
print(f"rto={rto}") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment