# Erlang Cheatsheet

These notes taken from http://www.erlang.com/whatis.html, http://en.wikipedia.org/wiki/Erlang_(unit), and other sources....

## Erlang

• the continuous use of one voice path
• total traffic volume of one our (e.g. # of erlangs)

### simplified Erlang/busy hour traffic example

• 24 calls / hour (during busy hour)
• avg call duration 5 minutes (during busy hour)
```minutes of traffic = # of calls x duration
= 24 x 5
= 120 minutes
hours of traf / hr = 120 / 60
= 2
traffic figure     = 2 erlangs
```

## Erlang B

calculating probability of blocking given erlang distribution (including poisson arrival process, and infinite source of calls)
```           E B(E,j-1)
B(E,j) = --------------          (j=1,2,...,m)
E B(E,j-1) + j

B(E,j)          - probability of blocking
m               - number of resources (e.g. trunks)
E = lamda x h   - amount of traffic offered in erlangs
```
Calc inverse for numerical stabilty.
```  1          j      1
------ = 1 + - ----------        (j=1,2,...,m)
B(E,j)       E  B(E,j-1)
```
```Function ErlangB (E as Double, m As Integer) As Double
Dim InvB As Double
Dim j As Integer

InvB = 1.0
For j = 1 To m
InvB = 1.0 + j / E * InvB
Next j
ErlangB = 1.0 / InvB
End Function
```

## extended Erlang B

iterative calculation that incorporates recall attempts

## Erlang C

Adds a queuing system (e.g. calls never blocked)