[Home]PIP - Pick In Proportion

HomePage | RecentChanges | Preferences | My Website home page

Showing revision 3
PIP - Pick in Proportion.

You need to deal out a stream of items one at a time in proportions.

You could use a round robin list. A,B,C,A,B,A,B,C,A,B,A,B,C

This idea uses a bank of numerical controlled oscillators.

You have an array of buckets, and these accumulate fill in the required proportions.

You have a bucket for each destination.

 OnItemRecieved{
   Add requiredProportionToBuckets()
   // Pick distination
   FindBucketWithMostFill()
   // Look for bucket with most fill, Thats the destination, and empty it.
   DeliverItemToDestination( FindBucketWithMostFill() )
   EmptyFullestBucket( FindBucketWithMostFill() )
 }

With Added Rate control

Add a leaky bucket on the output. If running

Empty the bucket if picked, but by more than the sum of proportions.

If Leaky Bucket running subtract an am

 OnItemRecieved{
   Add requiredProportionToBuckets()
   // Pick distination
   FindBucketWithMostFill()
   // Look for bucket with most fill, Thats the destination, and empty it.
   DeliverItemToDestination( FindBucketWithMostFill() )
   EmptyFullestBucket( FindBucketWithMostFill() )
 }

Names

PIP Personal Improvement Plan PIP Pick In Proportion The PerfectPubRound

When you pick a bucket do you need to empty the whole bucket

You could measure the rate of OnItem Requests.

Could you have a bucket that backed off traffic, like the fairground penny fall profit.

Could you have a bucket that leaked.

OnItemReceived() - add proportions each item. OnLeak() - add proportions on timer tick, so they get picked.

When an Item is picked, subtract the sum of proportions from the bucket.

Should each bucket also have a time component? Should the bucket record when it was last emptied? If picked too often should it buffer and back off.

Rate control


HomePage | RecentChanges | Preferences | My Website home page
This page is read-only | View other revisions | View current revision
Edited April 1, 2022 7:25 am by dougrice.plus.com
Search: