| | |
| | | * @date 2025/6/10 |
| | | * @author feiyu02 |
| | | */ |
| | | class RTExcChangeRate(config: RTExcWindLevelConfig) : |
| | | open class RTExcChangeRate(config: RTExcWindLevelConfig) : |
| | | BaseExceptionContinuous<ExceptionTag, RTExcWindLevelConfig, PollutedClue>(config, ExceptionTag::class.java) { |
| | | |
| | | constructor(config: RTExcWindLevelConfig, callback: NewPolluteClueCallback) : this(config){ |
| | |
| | | |
| | | private var callback: NewPolluteClueCallback? = null |
| | | |
| | | open var changeRate = this.config.changeRateUp |
| | | |
| | | override fun getExceptionType(): ExceptionType { |
| | | return ExceptionType.TYPE9 |
| | | } |
| | | |
| | | override fun judgeDataScale(p: BaseRealTimeData?, n: BaseRealTimeData): MutableMap<FactorType, Boolean> { |
| | | val res = mutableMapOf<FactorType, Boolean>() |
| | | config.factorFilter.mainList().forEach { f -> |
| | | if (p?.getByFactorType(f) == null || n.getByFactorType(f) == null || n.windSpeed == null) { |
| | | res[f] = (false) |
| | | return@forEach |
| | | } |
| | | val nValue = n.getByFactorType(f)!! |
| | | val minValue = FactorType.getVMin(f) |
| | | res[f] = nValue >= minValue |
| | | } |
| | | return res |
| | | } |
| | | |
| | | override fun judgeException(p: BaseRealTimeData?, n: BaseRealTimeData): MutableMap<FactorType, Boolean> { |
| | |
| | | return@forEach |
| | | } |
| | | |
| | | val rate = config.changeRate[f] |
| | | val rate = changeRate[f] |
| | | |
| | | val pValue = p.getByFactorType(f)!! |
| | | val nValue = n.getByFactorType(f)!! |
| | |
| | | val v = (nValue - pValue) |
| | | |
| | | val b1 = if (rate != null) { |
| | | v >= rate.mutationRate.first |
| | | v in rate.mutationRate.first..rate.mutationRate.second |
| | | } else { |
| | | false |
| | | } |
| | |
| | | } |
| | | |
| | | override fun judgeExceptionCount(tag: ExceptionTag, factorType: FactorType?): Boolean { |
| | | return tag.exceptionData.size >= (config.changeRate[factorType]?.countLimit ?: 1) |
| | | return tag.exceptionData.size >= (changeRate[factorType]?.countLimit ?: 1) |
| | | } |
| | | |
| | | override fun needCut(tag: ExceptionTag, hasException: Boolean?): Boolean { |
| | |
| | | } |
| | | |
| | | override fun newResult(tag: ExceptionTag, factor: FactorFilter.SelectedFactor): PollutedClue { |
| | | return PollutedClue(tag, factor, getExceptionType(), config, config.changeRate[factor.main]) |
| | | return PollutedClue(tag, factor, getExceptionType(), config, changeRate[factor.main]) |
| | | } |
| | | |
| | | override fun onNewException( |