feiyu02
2025-07-10 c5f380b69707a9a09fe988a2f4bd98e142bf64ae
src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/exceptiontype/BaseRTExcChangeRate.kt
ÎļþÃû´Ó src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/exceptiontype/RTExcChangeRate.kt ÐÞ¸Ä
@@ -19,7 +19,7 @@
 * @date 2025/6/10
 * @author feiyu02
 */
open class RTExcChangeRate(config: RTExcWindLevelConfig) :
abstract class BaseRTExcChangeRate(config: RTExcWindLevelConfig) :
    BaseExceptionContinuous<ExceptionTag, RTExcWindLevelConfig, PollutedClue>(config, ExceptionTag::class.java) {
    constructor(config: RTExcWindLevelConfig, callback: NewPolluteClueCallback) : this(config){
@@ -28,7 +28,7 @@
    private var callback: NewPolluteClueCallback? = null
    open var changeRate = this.config.changeRateUp
    abstract var changeRate: MutableMap<FactorType, RTExcWindLevelConfig.WindLevelCondition>
    override fun getExceptionType(): ExceptionType {
        return ExceptionType.TYPE9
@@ -58,20 +58,17 @@
            val rate = changeRate[f]
            if (rate != null && n.windSpeed!! in rate.windSpeed.first..rate.windSpeed.second) {
            val pValue = p.getByFactorType(f)!!
            val nValue = n.getByFactorType(f)!!
            // è®¡ç®—后一个数据相比于前一个数据的变化速率
            val v = (nValue - pValue)
            val b1 = if (rate != null) {
                v in rate.mutationRate.first..rate.mutationRate.second
            } else {
                false
            }
//                val r = (nValue - pValue) / pValue
//                val b1 = r >= con.mutationRate.first && r < con.mutationRate.second
                val b1 = v in rate.mutationRate.first..rate.mutationRate.second
            println("因子:${f.des},速率:${v},${b1}")
            res[f] = b1
            } else {
                res[f] = false
            }
        }
        return res
    }