我正在尝试执行以下操作:
考虑到一些日期,比如A,B和C,我想
有人能建议一种有效的算法来实现这一目标吗?谢谢!
答案 0 :(得分:0)
让我们举一个例子:
A = 0
B = 45
C = 100
N = 10 interval (10 interval = 11 bound)
1:求出最接近AB / AC比率的比率X / N
4/10 < 45/100 5/10
we will take X = 4 in this example (the result will vary depending on how you round it.
2:将从先前计算中获取的绑定数设置为从A绑定到B
A to B:
Interval number 4 (from previous value)
Bound number 5
Average interval length is (45-0) / 4 = 11
Bound 0 = 0
Bound 1 = 11
Bound 2 = 22
Bound 3 = 33
Bound 4 = 45
3:将从先前计算中获取的绑定数设置为从B绑定到C
B to C:
Interval number 6 (the rest)
Bound number 7
Average interval length is (100 - 45) / 6 = 9
Bound 4 = 45
Bound 5 = 54
Bound 6 = 63
Bound 7 = 72
Bound 8 = 81
Bound 9 = 90
Bound 10 = 100