|
@@ -101,7 +101,7 @@ class HealthAssessor:
|
|
|
return est_X - newStates
|
|
|
|
|
|
def calcSPRT(self, newsStates, feature_weight, alpha=0.1, beta=0.1, decisionGroup=1):
|
|
|
- """优化SPRT计算(与源代码完全一致)"""
|
|
|
+ """优化SPRT计算"""
|
|
|
stateResidual = self.calcResidualByLocallyWeightedLR(newsStates)
|
|
|
weightedStateResidual = np.dot(stateResidual, feature_weight)
|
|
|
weightedHealthyResidual = np.dot(self.healthyResidual, feature_weight)
|
|
@@ -173,46 +173,6 @@ class HealthAssessor:
|
|
|
|
|
|
return MSETCore()
|
|
|
|
|
|
- # def assess_turbine(self, engine_code, data, mill_type,wind_turbine_name) :
|
|
|
- # """评估单个风机"""
|
|
|
- # results = {
|
|
|
- # "engine_code": engine_code,
|
|
|
- # "wind_turbine_name":wind_turbine_name,
|
|
|
- # "mill_type": mill_type,
|
|
|
- # "assessed_subsystems": [],
|
|
|
- # "subsystems": {},
|
|
|
- # "overall_health": None
|
|
|
-
|
|
|
- # }
|
|
|
-
|
|
|
- # # 各子系统评估
|
|
|
- # subsystems_to_assess = [
|
|
|
- # ('generator', self.subsystem_config['generator'][mill_type], 2),
|
|
|
- # ('nacelle', self.subsystem_config['nacelle'], 2),
|
|
|
- # ('grid', self.subsystem_config['grid'], 2),
|
|
|
- # ('drive_train', self.subsystem_config['drive_train'] if mill_type == 'dfig' else None, 2)
|
|
|
- # ]
|
|
|
-
|
|
|
- # for subsystem, config, min_features in subsystems_to_assess:
|
|
|
- # if config is None:
|
|
|
- # continue
|
|
|
-
|
|
|
- # features = self._get_subsystem_features(config, data)
|
|
|
- # if len(features) >= min_features:
|
|
|
- # assessment = self._assess_subsystem(data[features])
|
|
|
- # results["subsystems"][subsystem] = assessment
|
|
|
-
|
|
|
- # # 计算整机健康度
|
|
|
- # if results["subsystems"]:
|
|
|
- # valid_subsystems = [k for k, v in results["subsystems"].items() if v['health'] >= 0]
|
|
|
- # if valid_subsystems:
|
|
|
- # weights = self._get_subsystem_weights(valid_subsystems)
|
|
|
- # health_scores = [results["subsystems"][sys]['health'] for sys in valid_subsystems]
|
|
|
- # #整体健康度评分
|
|
|
- # results["overall_health"] = float(np.dot(health_scores, weights))
|
|
|
- # results["assessed_subsystems"] = valid_subsystems
|
|
|
-
|
|
|
- # return results
|
|
|
|
|
|
def assess_turbine(self, engine_code, data, mill_type, wind_turbine_name):
|
|
|
"""评估单个风机
|