Math::Telephony::ErlangC - Perl extension for Erlang C calculations
use Math::Telephony::ErlangC; # Evaluate probability that a service request will have to wait $wprob = wait_probability($traffic, $servers); # Probability that the wait time will be less than a fixed maximum # $mst is the mean service time $mwprob = maxtime_probability($traffic, $servers, $mst, $maxtime); # Average time waiting in queue # $mst is the mean service time $awtime = average_wait_time($traffic, $servers, $mst);
This mosule contains various functions to deal with Erlang C calculations.
The Erlang C model allows dimensioning the number of servers in a M/M/S/inf/inf model (Kendall notation):
The input process is Markovian (Poisson in this case)
The serving process is Markovian (ditto)
There are S servers
The wait line is infinite (pure wait, no loss, no renounce)
The input population is infinite
None by default. Following functions can be imported at once via the ":all" keyword.
Some concepts are common to the the following functions:
traffic is the offered traffic expressed in Erlang. When an input parameter, this value must be defined and greater or equal to 0. As per definition, this value is given by the product of the service request arrival and the average service time (see below for this).
servers is the number of servers in the queue. When an input parameter, this must be a defined value, greater or equal to 0.
wait probability is the probability that a given service request will be put inside the wait queue, which happens when all servers are busy.
(average) service time is the (average) time that each server needs to complete a service request; it's referred to as $mst most of the time below.
Evaluate the probability that a call will have to wait in the queue because all servers are busy.
Evaluate the needed number of servers to handle $traffic Erlangs with a wait probability not greater than $wait_probability.
Evaluate the maximum traffic that can be handled with $servers without having a wait probability for any request that is beyond the given value. The calculation is performed until the iteration process shows variations below $prec, which is optional and defaults to $Math::Telephony::ErlangB::default_precision.
Evaluate the probability that any given service request will be handled within the given maximum time.
Evaluate the needed number of servers given the $traffic in erlang, $maxtime_probability, i.e. the probability that any given request will be served in no more than $maxtime seconds, and $mst, which represents the mean service time for any given request.
Evaluate the maximum traffic that can be handled with $servers, with $maxtime_probability that the any given request will be handled within $maxtime. Parameter $mst represents the average time needed to serve a request.
You can optionally specify a $prec precision for calculations, otherwise the precision will default to $Math::Telephony::ErlangB::precision.
Evaluate the mean service time required when other parameters are fixed.
Evaluate the maximum time required to process a request with a probability of $maxt_prob.
Evaluate the average waiting time, i.e. average time spent inside the queue by the generic request.
Evaluate the needed number of servers to serve the given $traffic with an average wait time in queue not exceeding $average_wait_time for each request. $mst is the mean service time.
Evaluate the maximum traffic that can be handled with $servers, where the average wait time does not exceed $average_wait_time. $mst is the mean service time.
Evaluate the mean service time for $servers being offered $traffic, assuming that the average wait time in queue is $awt.
Evaluate the mean service time for $servers loaded with requests wich occur with $frequency, assuming that the average wait time in queue is $awt.
Solve equations to find needed servers. You can pass various input parameters:
{traffic => ..., wait_probability => ...}
{traffic => ..., avg_service_time => ..., avg_wait_time => ...}
{traffic => ..., avg_service_time => ..., max_wait_time => ..., maxtime_probability => ...}
You can google for plenty of information about Erlang C.
Flavio Poletti <flavio@polettix.it>
Copyright (C) 2005 by Flavio Poletti
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.
To install Math::Telephony::ErlangC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Math::Telephony::ErlangC
CPAN shell
perl -MCPAN -e shell install Math::Telephony::ErlangC
For more information on module installation, please visit the detailed CPAN module installation guide.