Changes between Initial Version and Version 8 of Ticket #674


Ignore:
Timestamp:
04/05/13 03:17:01 (6 years ago)
Author:
takkaria
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #674

    • Property Status changed from new to confirmed
    • Property Summary changed from Speed up item generation to Use binary search instead of iteration in alloc tables
    • Property Milestone changed from 3.1.1 beta to Future
    • Property Keywords items added
    • Property Type changed from change to task
  • Ticket #674 – Description

    initial v8  
    1 1. Instead of storing the probability of item type K, store the probability of 0 .. K-1 (cumulative).  Then roll a number from 0 to total-1 and use binary search. 
     1Instead of iterating over every entry in an alloc table to find an item and keeping a cumulative tally while iterating, store the total in the alloc tables and use a binary search to find it.  e.g. instead of 
     2 
     3alloc[0] = { item 1, entries 50 } 
     4alloc[1] = { item 2, entries 100 } 
     5alloc[2] = { item 5, entries 30 } 
     6 
     7have 
     8 
     9alloc[0] = { item 1, entries 0 } 
     10alloc[1] = { item 2, entries 50 } 
     11alloc[2] = { item 5, entries 150 }