Spaces:
Running
on
Zero
Running
on
Zero
Update scoring_calculation_system.py
Browse files
scoring_calculation_system.py
CHANGED
@@ -1661,6 +1661,10 @@ def calculate_compatibility_score(breed_info: dict, user_prefs: UserPreferences)
|
|
1661 |
# 確保最終分數在合理範圍內
|
1662 |
return max(0.15, min(1.0, final_score))
|
1663 |
|
|
|
|
|
|
|
|
|
1664 |
|
1665 |
def calculate_environmental_fit(breed_info: dict, user_prefs: UserPreferences) -> float:
|
1666 |
"""計算品種與環境的適應性加成"""
|
|
|
1661 |
# 確保最終分數在合理範圍內
|
1662 |
return max(0.15, min(1.0, final_score))
|
1663 |
|
1664 |
+
except Exception as e:
|
1665 |
+
print(f"Error calculating compatibility score: {str(e)}")
|
1666 |
+
return 60.0 # 返回最低分數作為默認值
|
1667 |
+
|
1668 |
|
1669 |
def calculate_environmental_fit(breed_info: dict, user_prefs: UserPreferences) -> float:
|
1670 |
"""計算品種與環境的適應性加成"""
|