1

I need to build a scoring function to rank items as they arrive in the inventory(data streams). The function will represent both the inventory value(V) and the Age of inventory(A)(from the time at which it was bought).

Score = 3V + 7A. The scoring attempts to increase the score of the item as it ages.

Doing this will mean that i will need to recompute the score every day and it will be cumbersome if the inventory size is in the millions.

Is there a better way to represent the age of the inventory that will avoid recomputation for all the items.

Thanks.

Roger
  • 123
  • 2
  • 7
  • Adding and multiplying a few million numbers should not take much time (often less than a second). – Erwin Kalvelagen Aug 30 '17 at 17:10
  • There is one way to avoid recomputing this every single day if you don't wish to. You can calculate the score periodically and store the "reference date." After that, since your score seems to be linearly dependent on the age, *only* for the items being retrieved, you can use *new score* = pre-computed score for item + *constant*. (This *constant* is calculated once per day: = 7 * days since reference date.) – Ram Narasimhan Aug 30 '17 at 19:55

0 Answers0