基于时间的算法进球 [英] Algorithmic scoring based on time

查看:113
本文介绍了基于时间的算法进球的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们希望创建一个得分算法,将奖较少的时间和更大的时间少点,高点。一个需要注意的是,没有真正的范围,以便时间的范围可以从100毫秒至多达10分钟或更多为0的点范围为50。

We want to create a scoring algorithm that will award higher points for less time and less points for greater time. The one caveat is that there is no real range so time can range from 100 milliseconds to as much as 10 minutes or more with a point range of 0 to 50.

感谢您的帮助。

推荐答案

您可以简单地使它成为线性映射使用下列公式:

You can simply make it a linear mapping using the following equation:

点= 50 * 100 / time_in_ms

这会为您提供了:

  • time_in_ms = 100ms的 => 50
  • ...
  • time_in_ms = 10分钟 => 0.0083
  • ...
  • time_in_ms = +∞ => 0
  • time_in_ms=100ms => 50 points
  • ...
  • time_in_ms=10min => 0.0083 points
  • ...
  • time_in_ms=+∞ => 0 points

您可以轻松地调整上述公式,如果时间范围,并指出改变。

You can easily adjust the above equation if the ranges of time and points changes.

这篇关于基于时间的算法进球的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆