[Home]PIP - Pick In Proportion

HomePage | RecentChanges | Preferences | My Website home page

Showing revision 7

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. The fullest bucket gets the Item and the bucket is emptied.

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

When you empty the bucket, do you add the sum of the buckets or the sum or the proportions.

Why are you picking in proportion?

Is it so that destinations get an exact equal share or just try to share the load when overloaded.

If time is added, then each timer tick, different proportions could be added to the bucket. How would this affect the result?

The Account Analogy

Get an income, when funds available buy the required item.

Another way.

What about BULK Buys where the cost on multiple items is less.

It might be we want a set of proportions, but it would be best to buy in bulk, or use in bulk.

It might cost more to use an item one at a time, so it may be best to hold back the purchase.

With Added Rate control

Add a leaky bucket on the output. If running, what do you do?

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

If Leaky Bucket running subtract Add an amount for Time

Names

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.

If the bucket fill leaked, it would get picked more often. The leak could be negative.

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.

Links

http://www.dougrice.plus.com/Erlangs/loadShareTry.htm

http://www.dougrice.plus.com/Erlangs/loadShare.htm

http://www.dougrice.plus.com/Erlangs/loadShareMidi.htm


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