leaky bucket load share, split a stream of events into several streams with different proportions.

Mashup to demo this to generate Midi sequences
Input a list of parts (proportions). Use time h,h,m,m as proportions .
Use Random Add. Randomly adds up to 20% to 90% of totalBuckets.
Use flip/flop Add. Additionally adds +/- 10% total buckets.
Use Neg Exp Interarrival Time.

Here is a load share using leaky buckets. This is similar to the equitable pub round algorithm.

You and some mates walk into the pub, some only drink halves, some drink pints, and each person is supposed to pick up their round fairly.

You have a stream of events that you wish to split into streams using different proportions or parts. Have a bucket for each stream.
For each event fill the buckets at the wanted parts (proportions). To pick the stream to send the call down, pick the fullest bucket and take out a dollop equal to the sum of the parts. ( The fill may go neagtive )

A PIC16F628 rechip of Maplin's Lottery Number Picker ( work in progress )

A PIC16F628 implimentation. ( work in progress )