1
   

Need selection algorithm for fixed-priority items

 
 
arienim
 
Reply Thu 17 Mar, 2005 02:40 pm
I'm looking for a simple algorithm for selecting items with fixed priority. I.e. if I have a set of items {A,B,C,D,E}, with priorities (1,2,3,4,5} respectively, and these priorities have the weights {100,50,20, 10,2) respectively, then using the sought algorithm for selecting the next item, within any given period of time A will show up twice as much as B, 5 times more times than C, 10 times more than D and 50 times more than E. Any suggestions?
Thanks,
Arie
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Discussion • Score: 1 • Views: 380 • Replies: 1
No top replies

 
hingehead
 
  1  
Reply Thu 17 Mar, 2005 07:31 pm
I'm not great with arrays but wouldn't you create 100 A's (A:1, A:2 etc) and 50 B's, 20 C's, 10 D's and 2 E's then use a random selector on the total set?
0 Replies
 
 

Related Topics

Clone of Micosoft Office - Question by Advocate
Do You Turn Off Your Computer at Night? - Discussion by Phoenix32890
The "Death" of the Computer Mouse - Discussion by Phoenix32890
Windows 10... - Discussion by Region Philbis
Surface Pro 3: What do you think? - Question by neologist
Windows 8 tips thread - Discussion by Wilso
GOOGLE CHROME - Question by Setanta
.Net and Firefox... - Discussion by gungasnake
Hacking a computer and remote access - Discussion by trying2learn
 
  1. Forums
  2. » Need selection algorithm for fixed-priority items
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.04 seconds on 05/05/2024 at 01:38:16