-1

第 1 步:我使用 Erlang C 公式计算了设定间隔的容量要求(参考:https ://www.callcentrehelper.com/erlang-c-formula-example-121281.htm#:~:text=To% 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

关于我如何能够做到这一点的任何想法?

4

1 回答 1

0

对于第一部分:

您可以使用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}

请注意,您可以指定其他参数,例如 shrinkage 和 max_occupancy

对于第二部分:

第二部分几乎相同,因为您要限制 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 作为约束而不是查看几乎相同由于你目前的能力

于 2021-04-11T20:14:05.523 回答