📄 bestguesscompoundtracker.java
字号:
package org.placelab.client.tracker;import java.util.Enumeration;/** * A CompoundTracker that simply returns whichever estimate * has the lowest standard deviation. */public class BestGuessCompoundTracker extends CompoundTracker { public Estimate getEstimate () { CompoundEstimate cEstimate = (CompoundEstimate) super.getEstimate(); float lowestStdDev = -1.0F; Estimate bestEstimate = null; for (Enumeration i = cEstimate.getEstimates().elements(); i.hasMoreElements();) { Estimate e = (Estimate) i.nextElement(); float stdDev = Float.parseFloat(e.getStdDevAsString()); if (lowestStdDev == -1.0F) lowestStdDev = stdDev; if (Math.min(lowestStdDev, stdDev) == stdDev) { lowestStdDev = stdDev; bestEstimate = e; } } // never happens if (bestEstimate == null) return null; return bestEstimate; } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -