Fix: default search parameter

This commit is contained in:
Chris Li 2016-07-07 10:01:59 -04:00
parent ca128c6f0c
commit 424c3e208d
3 changed files with 16 additions and 3 deletions

View File

@ -99,8 +99,21 @@ class SearchTuneController: UIViewController, UITableViewDataSource {
class WeightFactor {
class func calculate(prob: Double) -> Double {
if UIApplication.buildStatus == .Alpha {
if let m = Defaults[.m], let n = Defaults[.n] {
return caluclateLog(m: m, n: n, prob: prob)
} else {
return 1
}
} else {
let m = 6.4524436415334163
let n = 7.5576145596090623
return caluclateLog(m: m, n: n, prob: prob)
}
}
private class func caluclateLog(m m: Double, n: Double, prob: Double) -> Double {
let e = 2.718281828459
guard let m = Defaults[.m], let n = Defaults[.n] else {return 1}
return log(n - m * prob) / log(e)
}
}

View File

@ -36,7 +36,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1558</string>
<string>1570</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>

View File

@ -42,7 +42,7 @@ enum BuildStatus {
extension UIApplication {
class var buildStatus: BuildStatus {
get {
return .Beta
return .Release
}
}
}