步骤1:我已经使用Erlang C公式计算了一个设定间隔的容量要求(参考:https://www.callcentrehelper.com/erlang-c-formula-example-121281.htm#:~:text=到%20work%20out%20the%20traffic,10%20Call%20Hours%20%3D%2010%20Erlangs。(
输入:
Interval = 60 mins
#Interactions = 171 calls
AHT = 200 seconds
Required SLA = 80%
Target Answer Time = 120 seconds
输出:
Required Capacity
代码:
def power_fact(self, u, m):
pow_fact = pow(u, m) / factorial(m)
return pow_fact
def traffic_intensity(self, call, time_interval, avg_handling_time):
if (call == 0) or (avg_handling_time == 0) or (time_interval == 0):
traffic_inten = 0
else:
traffic_inten = (call / time_interval) * avg_handling_time
return traffic_inten
def erlang_c(self, call, time_interval, avg_handling_time, agent_count):
traffic_intensity_u = self.traffic_intensity(
call, time_interval, avg_handling_time)
power_factor = self.power_fact(traffic_intensity_u, agent_count)
X = power_factor
if (traffic_intensity_u == 0):
p = 0
Y = 0
erlang = 0
else:
if (agent_count == 0):
p = 0
else:
p = traffic_intensity_u / agent_count # Agent Occupancy
#print('Agent Occupancy: {}'.format(p))
Y = 0
for k in range(0, agent_count):
Y += self.power_fact(traffic_intensity_u, k)
erlang = X / (X + (1-p) * Y)
return erlang
def ser_lev_agr(self, agent_count, call, time_interval, avg_handling_time, target_answer_time):
traffic_intensity_u = self.traffic_intensity(
call, time_interval, avg_handling_time)
erlang = self.erlang_c(call, time_interval,
avg_handling_time, agent_count)
exponential = exp(- (agent_count - traffic_intensity_u)
* (target_answer_time / avg_handling_time))
service_level = 1 - (erlang * exponential)
return service_level
def agents_needed(self, call, time_interval, avg_handling_time, target_SLA, target_answer_time):
level = 0
agent_count = 0
while level < target_SLA:
level = self.ser_lev_agr(
agent_count, call, time_interval, avg_handling_time, target_answer_time)
agent_count += 1
return agent_count
步骤2:我现在需要计算可以处理的交互次数,最好使用类似的技术,给定可用容量,同时考虑所需的SLA。
输入:
Interval = 60 mins
Available Capacity = 10 Hours
AHT = 200 seconds
Required SLA = 80%
Target Answer Time = 120 seconds
输出:
#Interactions
有什么关于我该怎么做的想法吗?
对于第一部分:
你可以使用pyworkforce,这样你就不必从头开始编码了,你提供的数据非常直接,下面是代码:
from pyworkforce.queuing import ErlangC
erlang = ErlangC(transactions=171, interval=60, asa=120/60, aht=200/60)
requirements = erlang.required_positions(service_level=0.8)
print(requirements)
输出:
{'raw_positions': 12,
'positions': 12,
'service_level': 0.9218549443574886,
'occupancy': 0.7916666666666666,
'waiting_probability': 0.3502218417740034}
请注意,您可以指定其他参数,如收缩率和最大占用率
第二部分:
第二部分基本相同,因为您正在约束SLA
你可以在固定资源(容量(的情况下绘制事务数量与服务级别的关系图,并选择你想要的截止点,例如,定义不同事务范围的网格,在这个例子中,我将尝试5个不同的选项,而所有其他参数只保留1个选项,一次尝试所有不同的选项,您需要使用pyworkforce:中的MultiErlangC类
from pyworkforce.queuing import MultiErlangC
param_grid = {"transactions": [160, 165, 171, 175, 180], "aht": [200/60], "interval": [60], "asa": [120 / 60]}
erlang = MultiErlangC(param_grid=param_grid, n_jobs=-1)
print(erlang.param_list)
现在,您定义固定容量并将其传递给service_level方法,如下所示:
service_level_scenarios = {"positions": [12]}
requirements = erlang.service_level(arguments_grid=service_level_scenarios)
# 1 service level result per combination in the erlang.param_list and service_level_scenarios
print(requirements)
输出是针对5个不同事务选项中的每一个实现的服务级别。如果你需要一套大的交易选项,你可以让网格更大
[0.9614481621520431, 0.9465713516901587, 0.9218549443574886, 0.8999506444946539, 0.8646468679398583]
因此,根据这个结果和事务的输入,您可以选择截止服务级别,并查看哪个事务选项导致该服务级别。
您可以看到,第三个服务级别(0.9218(是171个事务中的一个,它与第一部分中发现的一致,这就是为什么我说,如果您将SLA作为约束,而不是将其视为当前容量的结果,那么它几乎是一样的