Spaces:
Running
on
Zero
Running
on
Zero
Update scoring_calculation_system.py
Browse files
scoring_calculation_system.py
CHANGED
@@ -207,47 +207,6 @@ def calculate_breed_bonus(breed_info: dict, user_prefs: UserPreferences) -> floa
|
|
207 |
|
208 |
bonus += max(-0.25, min(0.25, personality_score))
|
209 |
|
210 |
-
exercise_match = calculate_exercise_score(
|
211 |
-
breed_info.get('Exercise_Needs', 'MODERATE'),
|
212 |
-
user_prefs.exercise_time,
|
213 |
-
user_prefs.exercise_type
|
214 |
-
)
|
215 |
-
bonus += exercise_match
|
216 |
-
|
217 |
-
# 運動類型特性評估
|
218 |
-
exercise_traits = {
|
219 |
-
'active_training': {
|
220 |
-
'athletic': 0.10,
|
221 |
-
'energetic': 0.08,
|
222 |
-
'working': 0.08,
|
223 |
-
'intelligent': 0.06
|
224 |
-
},
|
225 |
-
'moderate_activity': {
|
226 |
-
'adaptable': 0.08,
|
227 |
-
'balanced': 0.06,
|
228 |
-
'versatile': 0.06,
|
229 |
-
'steady': 0.04
|
230 |
-
},
|
231 |
-
'light_walks': {
|
232 |
-
'calm': 0.08,
|
233 |
-
'gentle': 0.06,
|
234 |
-
'easy-going': 0.06,
|
235 |
-
'patient': 0.04
|
236 |
-
}
|
237 |
-
}
|
238 |
-
|
239 |
-
# 計算運動類型特性匹配度
|
240 |
-
if user_prefs.exercise_type in exercise_traits:
|
241 |
-
trait_score = 0
|
242 |
-
matched_traits = 0
|
243 |
-
for trait, value in exercise_traits[user_prefs.exercise_type].items():
|
244 |
-
if trait in temperament:
|
245 |
-
trait_score += value
|
246 |
-
matched_traits += 1
|
247 |
-
if matched_traits > 0:
|
248 |
-
bonus += min(0.15, trait_score * (1 + (matched_traits - 1) * 0.1))
|
249 |
-
|
250 |
-
|
251 |
# 適應性評估 - 根據具體環境給予更細緻的評分
|
252 |
adaptability_bonus = 0.0
|
253 |
if breed_info.get('Size') == "Small" and user_prefs.living_space == "apartment":
|
|
|
207 |
|
208 |
bonus += max(-0.25, min(0.25, personality_score))
|
209 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
210 |
# 適應性評估 - 根據具體環境給予更細緻的評分
|
211 |
adaptability_bonus = 0.0
|
212 |
if breed_info.get('Size') == "Small" and user_prefs.living_space == "apartment":
|