[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.c

distribution algo question

Jake B.

3/27/2011 3:00:00 AM

Hoping to get some thoughts on a dispatch algorithm.

Here is the problem:
There is a finite set of reservation counters, for e.g (R1, R2, R3,
R4)
People who've lined up in a queue as P1,P2,P3,p4,P1,P2...Pn need to be
dispatched to one of these counters.
Rule is once they've been dispatched to a reservation counter, they
will have to go the same counter going fwd.
So in a queue based order, if following is the (infinite)sequence -
P1,P4,P5,P1,P3,P2,P1,P1,P8
(note multiple occurances of p1) Supposing P1 is dispatched to counter
R1, for every occurance
of P1 in the sequence needs to be dispatched always to R1.

Thoughts anybody?


TIA, Jake
2 Answers

Ben Bacarisse

3/27/2011 3:14:00 AM

0

"Jake B." <jake_brendon@yahoo.com> writes:

> Hoping to get some thoughts on a dispatch algorithm.
>
> Here is the problem:
> There is a finite set of reservation counters, for e.g (R1, R2, R3,
> R4)
> People who've lined up in a queue as P1,P2,P3,p4,P1,P2...Pn need to be
> dispatched to one of these counters.
> Rule is once they've been dispatched to a reservation counter, they
> will have to go the same counter going fwd.
> So in a queue based order, if following is the (infinite)sequence -
> P1,P4,P5,P1,P3,P2,P1,P1,P8
> (note multiple occurances of p1) Supposing P1 is dispatched to counter
> R1, for every occurance
> of P1 in the sequence needs to be dispatched always to R1.
>
> Thoughts anybody?

comp.programming is a good place for what is an algorithm question.
I've set followups-to there. It is certainly not a C question.

As for thoughts, you need to specify it some more. The obvious solution
is to direct all people to R1 but this is probably not what you want.
The second thing that needs more specification is how the Pn are
represented. If they are numbered as you suggest you could dispatch Pn
to R(n mod 4) but I doubt that is the solution you want either.

--
Ben.

Geoff

3/27/2011 5:21:00 AM

0

On Sat, 26 Mar 2011 20:00:13 -0700 (PDT), "Jake B."
<jake_brendon@yahoo.com> wrote:

>Hoping to get some thoughts on a dispatch algorithm.
>
>Here is the problem:
>There is a finite set of reservation counters, for e.g (R1, R2, R3,
>R4)
>People who've lined up in a queue as P1,P2,P3,p4,P1,P2...Pn need to be
>dispatched to one of these counters.
>Rule is once they've been dispatched to a reservation counter, they
>will have to go the same counter going fwd.
>So in a queue based order, if following is the (infinite)sequence -
>P1,P4,P5,P1,P3,P2,P1,P1,P8
>(note multiple occurances of p1) Supposing P1 is dispatched to counter
>R1, for every occurance
>of P1 in the sequence needs to be dispatched always to R1.
>

Your question is in the domain of queuing theory. Restricting users to
a predetermined queue once they have been assigned to a queue randomly
may be sub-optimal if they come at a time when their assigned queue is
full and another queue is empty.

Follow-ups set to comp.programming (with two m's).