Spaces:
Running
on
Zero
Running
on
Zero
Update scoring_calculation_system.py
Browse files- scoring_calculation_system.py +10 -13
scoring_calculation_system.py
CHANGED
|
@@ -1455,23 +1455,20 @@ def calculate_compatibility_score(breed_info: dict, user_prefs: UserPreferences)
|
|
| 1455 |
)
|
| 1456 |
}
|
| 1457 |
|
| 1458 |
-
|
| 1459 |
-
critical_issues = check_critical_matches(scores, user_prefs)
|
| 1460 |
-
if critical_issues['has_critical']:
|
| 1461 |
-
return apply_critical_penalty(scores, critical_issues)
|
| 1462 |
-
|
| 1463 |
-
# 計算環境適應性加成
|
| 1464 |
-
adaptability_bonus = calculate_environmental_fit(breed_info, user_prefs)
|
| 1465 |
-
|
| 1466 |
-
# 計算最終加權分數
|
| 1467 |
-
final_score = calculate_final_weighted_score(
|
| 1468 |
scores=scores,
|
| 1469 |
user_prefs=user_prefs,
|
| 1470 |
-
breed_info=breed_info
|
| 1471 |
-
adaptability_bonus=adaptability_bonus
|
| 1472 |
)
|
| 1473 |
|
| 1474 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1475 |
scores.update({
|
| 1476 |
'overall': final_score,
|
| 1477 |
'adaptability_bonus': adaptability_bonus
|
|
|
|
| 1455 |
)
|
| 1456 |
}
|
| 1457 |
|
| 1458 |
+
final_score = calculate_breed_compatibility_score(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1459 |
scores=scores,
|
| 1460 |
user_prefs=user_prefs,
|
| 1461 |
+
breed_info=breed_info
|
|
|
|
| 1462 |
)
|
| 1463 |
|
| 1464 |
+
# 計算環境適應性加成
|
| 1465 |
+
adaptability_bonus = calculate_environmental_fit(breed_info, user_prefs)
|
| 1466 |
+
|
| 1467 |
+
# 整合最終分數和加成
|
| 1468 |
+
final_score = (final_score * 0.9) + (adaptability_bonus * 0.1)
|
| 1469 |
+
final_score = amplify_score_extreme(final_score)
|
| 1470 |
+
|
| 1471 |
+
# 更新並返回完整的評分結果
|
| 1472 |
scores.update({
|
| 1473 |
'overall': final_score,
|
| 1474 |
'adaptability_bonus': adaptability_bonus
|