<commit_before>---
author: <NAME>, <EMAIL>
layout: post
description: ErlangR set of functions discription
---
# ErlangR

### Set of functions to calculate call center agents and trunks requirements using ErlangB and ErlangC functions in R

####ErlangB 
Calculates the probability that trunks will be blocked
arrival_rate - number of calls per hour
av_call_duration_sec - duration of calls in seconds
n_trunks - number of trunks
    
####Trunks 
 Calculates nesessary number of trunks
    
arrival_rate - number of calls per hour
av_call_duration_sec - duration of calls in seconds
    
 
####ErlangC function calculates the probability of queue with initial parameters
    
arrival_rate - number of calls per interval
av_call_duration_sec - average duration of calls in seconds
n_agents - number of agents

####ASA 
Calculates Average Speed of Answer in seconds
    
arrival_rate - number of calls per interval
av_call_duration_sec - average duration of calls in seconds
n_agents - number of agents
    
####SL
Calculates average speed of answer in seconds
    
arrival_rate - number of calls per interval
av_call_duration_sec - average duration of calls in seconds
n_agents - number of agents

####Agents
Calculates nesessary number of agents to fit the service level requirements
    
arrival_rate - number of calls per interval
av_call_duration_sec - average duration of calls in seconds
wrap_up_time_sec - time in seconds nesessary to wrap up the call
max_waiting_time_sec - maximum allowed time to wait in queue, seconds
sl_target - target service level (% of calls that should be answered within max_waiting_time_sec time)
    

####Agents_to_schedule
Calculates minimum number of agents nesessary to meet the service level requirements
    
arrival_rate - number of calls per interval
av_call_duration_sec - average duration of calls in seconds
wrap_up_time_sec - time in seconds nesessary to wrap up the call
max_waiting_time_sec - maximum allowed time to wait in queue, seconds
sl_target - target service level (% of calls that should be answered within max_waiting_time_sec time)
average break per agent per hour in minutes
    

####Usage examples
ErlangB(arrival_rate = 120,av_call_duration_sec = 30,n_trunks = 4)

Trunks(arrival_rate = 120,av_call_duration_sec = 30,max_block_rate = 0.02)

ErlangC(arrival_rate=720, av_call_duration_sec=240, n_agents=55)

ASA(arrival_rate=720, av_call_duration_sec=300, n_agents=67)
<commit_msg>3rd commit<commit_after>---
author: <NAME>, <EMAIL>
description: ErlangR set of functions discription
---
# ErlangR

### Set of functions to calculate call center agents and trunks requirements using ErlangB and ErlangC functions in R

####ErlangB 
Calculates the probability that trunks will be blocked
arrival_rate: number of calls per hour
av_call_duration_sec: duration of calls in seconds
n_trunks: number of trunks
    
####Trunks 
Calculates nesessary number of trunks

arrival_rate: number of calls per hour
av_call_duration_sec: duration of calls in seconds
    
 
####ErlangC function calculates the probability of queue with initial parameters
    
arrival_rate: number of calls per interval
av_call_duration_sec: average duration of calls in seconds
n_agents: number of agents

####ASA 
Calculates Average Speed of Answer in seconds
    
arrival_rate: number of calls per interval
av_call_duration_sec: average duration of calls in seconds
n_agents: number of agents
    
####SL
Calculates average speed of answer in seconds
    
arrival_rate: number of calls per interval
av_call_duration_sec: average duration of calls in seconds
n_agents: number of agents

####Agents
Calculates nesessary number of agents to fit the service level requirements
    
arrival_rate: number of calls per interval
av_call_duration_sec: average duration of calls in seconds
wrap_up_time_sec: time in seconds nesessary to wrap up the call
max_waiting_time_sec: maximum allowed time to wait in queue, seconds
sl_target: target service level (% of calls that should be answered within max_waiting_time_sec time)
    

####Agents_to_schedule
Calculates minimum number of agents nesessary to meet the service level requirements
    
arrival_rate: number of calls per interval
av_call_duration_sec: average duration of calls in seconds
wrap_up_time_sec: time in seconds nesessary to wrap up the call
max_waiting_time_sec: maximum allowed time to wait in queue, seconds
sl_target: target service level (% of calls that should be answered within max_waiting_time_sec time)
break_time_min_per_hour: average break per agent per hour in minutes
    

####Usage examples
ErlangB(arrival_rate = 120,av_call_duration_sec = 30,n_trunks = 4)

Trunks(arrival_rate = 120,av_call_duration_sec = 30,max_block_rate = 0.02)

ErlangC(arrival_rate=720, av_call_duration_sec=240, n_agents=55)

ASA(arrival_rate=720, av_call_duration_sec=300, n_agents=67)

{'fraction_non_alphanumeric': 0.046875, 'fraction_numerical': 0.012541118421052632, 'mean_word_length': 5.08125, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3329656', 'n_tokens_mistral': 1501, 'n_tokens_neox': 1410, 'n_words': 580}