UOM // Boost decay period from 1.5hrs to 6hrs.

This commit is contained in:
ShikiSuen 2022-07-24 00:09:24 +08:00
parent be57740d2d
commit 1cbcbb4b6f
1 changed files with 4 additions and 2 deletions

View File

@ -33,9 +33,11 @@ extension vChewing {
var mutDecayExponent: Double
var mutLRUList: [KeyObservationPair] = []
var mutLRUMap: [String: KeyObservationPair] = [:]
let kDecayThreshold: Double = 1.0 / 1_048_576.0
let kDecayThreshold: Double = 1.0 / 1_048_576.0 //
public init(capacity: Int = 500, decayConstant: Double = 5400.0) {
public static let kObservedOverrideHalfLife: Double = 3600.0 * 6 // 6
public init(capacity: Int = 500, decayConstant: Double = LMUserOverride.kObservedOverrideHalfLife) {
mutCapacity = max(capacity, 1) // Ensures that this integer value is always > 0.
mutDecayExponent = log(0.5) / decayConstant
}