impl sm2next
parent
8dbe8e852f
commit
439039010a
|
|
@ -0,0 +1,30 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
func SM2Next(thisGrade int, consecutivePassesBeforeThis int, ef float64, lastInterval int) (int, float64, int) {
|
||||||
|
q := thisGrade
|
||||||
|
n := consecutivePassesBeforeThis
|
||||||
|
ef = ef
|
||||||
|
i := lastInterval
|
||||||
|
|
||||||
|
if q >= 3 {
|
||||||
|
switch n {
|
||||||
|
case 0:
|
||||||
|
i = 1
|
||||||
|
case 1:
|
||||||
|
i = 6
|
||||||
|
default:
|
||||||
|
i = int(float64(i) * ef)
|
||||||
|
}
|
||||||
|
n += 1
|
||||||
|
} else {
|
||||||
|
n = 0
|
||||||
|
i = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
ef = ef + (.1 - (5.0-float64(q))*(.08+(5.0-float64(q))*.02))
|
||||||
|
if ef < 1.3 {
|
||||||
|
ef = 1.3
|
||||||
|
}
|
||||||
|
|
||||||
|
return n, ef, i
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue