algorithm - Bin packing parts of a dynamic set, considering lastupdate -


A large set of objects is set dynamic: objects can be added or removed at any time. Let's call the total number of objects N

Each object has two properties: mass ( m ) and time ( T )

each of them X A small bit of minutes should be selected for processing, which updates its T for the current time. The total of all items in the batch M is limited: no more than L

I'm looking to solve three tasks here:

  1. Find a Next Batch Object Picking Algorithm;
  2. Object Classes Introduction: Simple , Priority (fit at least in each N - batch) and frequently (each Fit into batches);
  3. The forecast system capacity exhaust (time to add next server = increase l ).

What type of model best describes such a system?

The whole thing is about the service that processes "objects" in time intervals. Each object should be "measured" for each N hour. N can be different in one category X is fixed.

Objects are added / removed by humans N due to publications, with some spike, it grows fast, but rather slow; Of course the forecast can not be accurate, just a few Estimates. M varies from 0 to 1 E7 with exponential distribution, most are close to 0.

I think there may be several strategies here:

A Full throttle - Pack each batch as close to 100% as N increases, the hit increases to a particular object in average interval.

B. PAR temperament :) - Try to keep the average gaps; some value will be rising from a low level to some level of batch. When it reaches 100% - time to get more servers.

C. -?

This is a very complete design for your problem.

Your question does not match your description of the system better. So I think the details are correct.

When you schedule a measurement, you should pass an object, for the first time it can be measured, and when you want to do measurement, in the object, weight attribute and a measured method. When the measurement occurs, then the measured method will be called, and what is the difference between your classes, and with which parameter, they will reschedule themselves.

Internally you look for information about implementing one of the priority queues one.

The first queue measure can be, all the objects that can not be measured yet. Each time you schedule a batch, you will use it to get all the new measurements, which can be.

There is a second line measurement that is now ready to go, and what time is it done by the scheduling period, and then weight. I would like to ascertain both of them. You can schedule a batch by dragging and dragging the luggage of the queue until it is enough to send you.

Now you have to know how much to put in each batch. Looking at the system you describe, a spike of events can be kept manually, but over time you want to smooth those spikes. Therefore I will recommend the choice B, the same nature. To do this, as you put each object in the "now ready" queue, you can calculate your "average work weight" because its weight does not divide by the length of time until it is going to happen is. Store with the object, and keep the total number of runs you should have. Every time I can recommend that you keep adding the batch until none of the three conditions are completed:

  1. You exit the objects.
  2. You have your maximum batch capacity.
  3. You are 10% more than the 1.1 times the weight of your average work, because it is better to use a little more capacity now than being out of capacity.

And finally, capacity planning.

For this you need to use some estimation here is a proper one, which may require some tweaking for your system. Maintain an array of average measurements of your last 10 measures of average weight, maintain a "fast damping average" of your high water mark. Do this by updating each time according to the formula:

average_h________ = 0.95 * average_high_water_mark + 0.5 * maximum (with the last 10 work weight)

if average_high_water_mark Goes inside, say, 2 servers of your maximum capacity, then add more servers (the idea is that a server should be able to die without leaving you.)

< / Html>

Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -