We want to create a scoring algorithm that will reward top points in less time and fewer points in more time. One caveat is that there is no real range, so the time can vary from 100 milliseconds to as much as 10 minutes or more with a point range from 0 to 50.
Thanks for any help.
You can simply make this a linear mapping using the following equation:
points = 50 * 100/time_in_ms
This will give you:
time_in_ms=100ms
50
...
time_in_ms=10min
0.0083
time_in_ms=+∞
0
You can easily adjust the above equation if time and point ranges change.
- , . . f(x) = Ax/(A + x), 0 x = 0, , A x, . ( , , - = A - Ax/(A + x)).
f(x) = Ax/(A + x)
= A - Ax/(A + x))
, A=10,
A=10
f(0) = 10 - 10*0/(10 + 0) = 10, f(1) = 10 - 10/11 = 9 1/11, f(2) = 10 - 20/12 = 8 1/3, f(100) = 10 - 1000/110 = 10/11
..
, :
, , , :
points = [max_number_of_points]/[time]
time , . , , time , , .
time
, , , - . , , , 100 100 . , , , .
, , , .
, , , max , , .
max
, ( .
:
. , , , , , 25 1 50.
, 100 , 500 , 50 * (500 - 100 ) / 500
50 * (500 - 100 ) / 500
Source: https://habr.com/ru/post/1526868/More articles:How to install Laravel from a phar file? - phpGoogle Play Services Library is not installed. - androidhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1526865/multiple-nancy-route-patterns-to-a-single-action&usg=ALkJrhgZsiosTT2Et9UmXdztX4eq_xuyGAarm64 armv7 armv7s architecture settings - iosHow to use timeout attribute with post method in jQuery ajax request? - jqueryWhat is the purpose of using isomorphic webapps? - javascriptWhy does Document.prototype.getElementsByName exist in Chrome? - javascriptjava delimited string - javaTransparent HTML5 canvas overlay gradients - html5Creating a canvas selection panel with full rgb space - javascriptAll Articles