| | |
| | | |
| | | override fun judgeException(p: BaseRealTimeData?, n: BaseRealTimeData): MutableMap<FactorType, Boolean> { |
| | | val res = mutableMapOf<FactorType, Boolean>() |
| | | println() |
| | | config.factorFilter.mainList().forEach { f -> |
| | | if (p?.getByFactorType(f) == null || n.getByFactorType(f) == null || n.windSpeed == null) { |
| | | res[f] = (false) |
| | |
| | | val con = windLevelCondition |
| | | |
| | | if (n.windSpeed!! in con.windSpeed.first..con.windSpeed.second) { |
| | | println("风速:${n.windSpeed},[${con.windSpeed.first} - ${con.windSpeed.second}]") |
| | | val pValue = p.getByFactorType(f)!! |
| | | val nValue = n.getByFactorType(f)!! |
| | | // 计算后一个数据相比于前一个数据的变化率 |
| | | val r = (nValue - pValue) / pValue |
| | | val b1 = r >= con.mutationRate.first |
| | | println("因子:${f.des},幅度:${r},限定:${con.mutationRate.first},${b1}") |
| | | res[f] = b1 |
| | | } else { |
| | | res[f] = false |
| | | } |
| | | } |
| | | |
| | | |
| | | return res |
| | | } |
| | | |