公式分为web浏览,游戏,voip,办公等类型
import os
import math
import time
def getsoe(apptype,minv,maxv,aver,loss):
if minv == '0':
minv='1'
if maxv == '0':
maxv='1'
if aver == '0':
aver='1'
drop = float(loss)/10
jitter = math.sqrt(((float(maxv)-float(aver))*(float(maxv)-float(aver))+(float(minv)-float(aver))*(float(minv)-float(aver)))/2)
delay = float(aver)
#print("drop jitter delay ",drop,jitter,delay)
if apptype == 'web' or apptype == 'office' or apptype == 'sns':
a=5.008
b=-0.0045
c=0.03
soe = a*math.exp(b*delay)+c
if apptype == 'video':
#enhence effect