Aquí dejo una página con una explicación muy buena sobre los
Erlangs, y unas rutinas en Python que escribí una tarde para calcular probabilidades de espera, número de agentes, nieveles de servicio u temas relacionados con los Erlang. No soy para nada experto en el tema, simplemente necesitaba validar unos números y las calculadoras que encontraba no me servían (o yo no supe usarlas) / Here's a link to a very good explanation about the
Erlangs,
and a few Python routines I put together one evening to compute traffic intensity, agent occupancy, probability of waiting, average speed of answer (ASA), service level, agents needed and other Erlang-C related stuff. I'm not an expert on this at all, just needed to validate some data and the calculators I came across didn't suit me (or I just didn't know how to use them)
from math import pow,factorial,log,exp
def PowerFact(b,e):
## Returns b^e / e! used everywhere else in the model
return pow(b,e)/factorial(e)
def erlangC(m,u):
## Returns the probability a call waits.
## m is the agent count
## u is the traffic intensity
suma=0
for k in range(0,m):
suma+=PowerFact(u,k)
erlang=PowerFact(u,m)/((PowerFact(u,m))+(1-p)*suma)
return erlang
def SLA(m,u,T,target):
## Returns the average speed of answer
## m is the agent count
## u is the traffic intensity
## T is the average call time
## target is the target answer time
return (1 - erlangC(m, u) * exp(-(m-u)*(target/T)))
def ASA(m,u,T):
## Returns the average speed of answer (ASA)
## m is the agent counts.
## u is the traffic intensity
## T is the average call time
return erlangC(m, u)*(T/(m-u))
def agentsNeeded(u,T,targetSLA,target):
## Returns the number of agents needed to reach given SLA
## u is the traffic intensity
## T is the average call time
## target is the target answer time
## targetSLA % calls answered under target time
level=0
m=1
while level
< targetSLA:
level=SLA(m,u,T,target)
m+=1
return m-1
################
calls=360. # number of calls in a given time interval
interval=1800. # the time interval, in secs (1800 s == 30 minutes)
landa=calls/interval
T=240. # average call duration, in secs
m=55 # number of agents
u=landa*T # traffic intensity
p=u/m # agent occupancy
print landa,'calls/interval'
print u,'traffic intensity'
print m,'agents'
print p,'agent occupancy'
print erlangC(m,u)*100,'% probability of waiting, ErlangC'
print ASA(m,u,T),'secs, average speed of answer (ASA)'
target=15
print SLA(m,u,T,target)*100,'% probability call is answered in less than',target,'secs'
nivel=0.7
print agentsNeeded(u,T,nivel,target),'agents needed to reach',nivel*100,'% calls answered in <',target,'secs'
################
print "-"*10
calls=300. # number of calls in a given time interval
interval=900. # the time interval, in secs (here 15 minutes)
landa=calls/interval
T=180. # average call duration, in secs
m=65 # number of agents
u=landa*T # traffic intensity
p=u/m # agent occupancy
print landa,'calls/interval'
print u,'traffic intensity'
print m,'agents'
print p,'agent occupancy'
print erlangC(m,u)*100,'% probability of waiting, ErlangC'
print ASA(m,u,T),'secs, average speed of answer (ASA)'
target=45
print SLA(m,u,T,target)*100,'% probability call is answered in less than',target,'secs'
nivel=0.95
print agentsNeeded(u,T,nivel,target),'agents needed to reach',nivel*100,'% calls answered in <',target,'secs'
################
print "-"*10
calls=650. # number of calls in a given time interval
interval=3600. # the time interval, in secs (here 1h)
landa=calls/interval
T=150. # average call duration, in secs
m=34 # number of agents
u=landa*T # traffic intensity
p=u/m # agent occupancy
print landa,'calls/interval'
print u,'traffic intensity'
print m,'agents'
print p,'agent occupancy'
print erlangC(m,u)*100,'% probability of waiting, ErlangC'
print ASA(m,u,T),'secs, average speed of answer (ASA)'
target=30
print SLA(m,u,T,target)*100,'% probability call is answered in less than',target,'secs'
nivel=0.5
print agentsNeeded(u,T,nivel,target),'agents needed to reach',nivel*100,'% calls answered in <',target,'secs'
################
print "-"*16
calls=20. # number of calls in a given time interval
interval=3600. # the time interval, in secs (1800 s == 30 minutes)
landa=calls/interval
T=1800. # average call duration, in secs
m=11 # number of agents
u=landa*T # traffic intensity
p=u/m # agent occupancy
print landa,'calls/interval'
print u,'traffic intensity'
print m,'agents'
print p,'agent occupancy'
print erlangC(m,u)*100,'% probability of waiting, ErlangC'
print ASA(m,u,T),'secs, average speed of answer (ASA)'
target=3600
print SLA(m,u,T,target)*100,'% probability call is answered in less than',target,'secs'
nivel=0.8
print agentsNeeded(u,T,nivel,target),'agents needed to reach',nivel*100,'% calls answered in <',target,'secs'
################
print "-"*16
calls=4280. # number of calls in a given time interval
interval=168. # the time interval, in hours (7dx24h = 168)
landa=calls/interval
T=1./6 # average call duration, in hours
m=6 # number of agents
u=landa*T # traffic intensity
p=u/m # agent occupancy
print landa,'calls/interval'
print u,'traffic intensity'
print m,'agents'
print p,'agent occupancy'
print erlangC(m,u)*100,'% probability of waiting, ErlangC'
print ASA(m,u,T),'hrs, average speed of answer (ASA)'
target=0.5
print SLA(m,u,T,target)*100,'% probability call is answered in less than',target,'hrs'
nivel=0.87
print agentsNeeded(u,T,nivel,target),'agents needed to reach',nivel*100,'% calls answered in <',target,'hrs'
################
print "-"*16
calls=1282. # number of calls in a given time interval
interval=60. # the time interval, in hours (5dx12h = 60)
landa=calls/interval
T=0.75 # average call duration, in hours
m=18 # number of agents
u=landa*T # traffic intensity
p=u/m # agent occupancy
print landa,'calls/interval'
print u,'traffic intensity'
print m,'agents'
print p,'agent occupancy'
print erlangC(m,u)*100,'% probability of waiting, ErlangC'
print ASA(m,u,T),'hrs, average speed of answer (ASA)'
target=1
print SLA(m,u,T,target)*100,'% probability call is answered in less than',target,'hrs'
nivel=0.89
print agentsNeeded(u,T,nivel,target),'agents needed to reach',nivel*100,'% calls answered in <',target,'hrs'
SALIDA
0.2 calls/interval
48.0 traffic intensity
55 agents
0.872727272727 agent occupancy
23.8700936378 % probability of waiting, ErlangC
8.18403210439 secs, average speed of answer (ASA)
84.5883092171 % probability call is answered in less than 15 secs
52 agents needed to reach 70.0 % calls answered in < 15 secs
----------
0.333333333333 calls/interval
60.0 traffic intensity
65 agents
0.923076923077 agent occupancy
42.0072292571 % probability of waiting, ErlangC
15.1226025326 secs, average speed of answer (ASA)
87.964727315 % probability call is answered in less than 45 secs
68 agents needed to reach 95.0 % calls answered in < 45 secs
----------
0.180555555556 calls/interval
27.0833333333 traffic intensity
34 agents
0.796568627451 agent occupancy
14.3013055995 % probability of waiting, ErlangC
3.10148796134 secs, average speed of answer (ASA)
96.4140712702 % probability call is answered in less than 30 secs
27 agents needed to reach 50.0 % calls answered in < 30 secs
----------------
0.00555555555556 calls/interval
10.0 traffic intensity
11 agents
0.909090909091 agent occupancy
68.2118204689 % probability of waiting, ErlangC
1227.81276844 secs, average speed of answer (ASA)
90.7685339568 % probability call is answered in less than 3600 secs
11 agents needed to reach 80.0 % calls answered in < 3600 secs
----------------
25.4761904762 calls/interval
4.24603174603 traffic intensity
6 agents
0.707671957672 agent occupancy
34.8436314992 % probability of waiting, ErlangC
0.0331093330988 hrs, average speed of answer (ASA)
99.8193211949 % probability call is answered in less than 0.5 hrs
5 agents needed to reach 87.0 % calls answered in < 0.5 hrs
----------------
21.3666666667 calls/interval
16.025 traffic intensity
18 agents
0.890277777778 agent occupancy
53.5967359233 % probability of waiting, ErlangC
0.20353190857 hrs, average speed of answer (ASA)
96.1496854898 % probability call is answered in less than 1 hrs
18 agents needed to reach 89.0 % calls answered in < 1 hrs