Randomly pick a destination. Try and measure time from last pick. Plot this.

Fill the buckets at a constant rate. Pick one bucket and empty the bucket. There are fewer buckets that get really full compared to the average. This page shows the buckets filling and being randomly emptied. Show them sorted, or Show the fill when the bucket is emptied. Occassional a bucket goes a long time between being picked. Show "fill" as yellow if less than buckets/2, red if more than buckets *2 else green.

Sort by the current fill. Show the fill when the buckets is emptied.
50 buckets, try 10, 30, 50, 70, 90 buckets and see how the curve be comes more exponetial in shape.

I was told that the time between calls should be a negative exponential distribution.

This is a simulation, of this. My call generator should use this to space the calls.

 nextInterArrivalTime = -ln( 1-rand() ) / callRate 

I remember a late night. Our live system had fallen over. The management had us in working to reproduce the problem. Our model call generator was converted from a constant interval tick to "neg exp" interval tick and the model system now failed!

Chap 3, p27 /28, D Bear Principles of Telecommunication Traffic Engineering. ISBN 0 906048 36 2 inspired this page.

"In data communication systems, the message length is not continuous since it is made up of discrete units of information (bits, characters etc.) The geometric distribution is sometimes applicable."

This page uses "discrete" units as it is easier than "continuous"

Notes:-

Use a constant tick.

Pick bucket using uniform distribution random number.

Chance of being picked = 1 / number of buckets = p

Chance of not picking bucket = ( 1- p ) = q

Chance of not picking bucket n times in a row = q^n = ( 1- p )^n = q^n

Lets say we have 100 buckets:

Chance of not picking a bucket 100 times in a row = ( 1 - 1/100 )^100 = 0.366032341273 or 36.6 %

Chance of not picking one of n buckets n times in a row tends towards 1/exp(1) which is about 36 per cent!

A bucket may go for a long time unpicked.

I was told that the time between calls should be a negative exponential distribution.

I was told I should be using the formulae below, but there is no exp() in it so rearrange it a bit to find exp().

nextInterArrivalTime = -ln( 1-rand() ) / callRate 

Calculate a new value of nextInterArrivalTime each call.

nextInterArrivalTime = -ln( 1-rand() ) / callRate

exp( -nextInterArrivalTime * callrate ) = ( 1-Rand() )

exp(1)^( -nextInterArrivalTime * callrate ) = ( 1-Rand() )

exp(-1)^( nextInterArrivalTime * callrate ) = ( 1-Rand() )

1/exp( 1 ) = exp( -1 )

If you itterate ( 1-Rand() ), you should get a uniform distribution, with average value of 0.5

calculate nextInterArrivalTime = -ln( 1-rand() ) / callRate each time.

Micro controllers have clock chains and timers that provide constant ticks. How do you get a neg exp interval tick?

This web page shows that even with a constant tick, a random pick, any one bucket will have a random time between picks that approximates the "neg Exp" distribution.

Chap 3, p27 /28, D Bear Principles of Telecommunication Traffic Engineering. ISBN 0 906048 36 2 inspired this page.

"In data communication systems, the message length is not continuous since it is made up of discrete units of information (bits, characters etc.) The geometric distribution is sometimes applicable."

This page uses "discrete" units as it is easier than "continuous"

This page was modifed from leaky bucket load share, split a stream of events into several streams with different proportions.

See: ePIP - endpoints Picked in Proportion/ Perfect Pub Round Load Share demo


This page is influenced by Chapter 4 and equ 4.3, p88, mt hills, Telecommunications Switching Principles. ISBN 0 04 621029 6

and Chap 3, p36, D Bear Principles of Telecommunication Traffic Engineering. ISBN 0 906048 36 2