DawnC commited on
Commit
a43c213
β€’
1 Parent(s): f2ab00b

Update scoring_calculation_system.py

Browse files
Files changed (1) hide show
  1. scoring_calculation_system.py +10 -10
scoring_calculation_system.py CHANGED
@@ -503,9 +503,9 @@ def calculate_compatibility_score(breed_info: dict, user_prefs: UserPreferences)
503
  },
504
  "Large": {
505
  "apartment": {
506
- "no_yard": 0.15, # ε€§εž‹ηŠ¬εœ¨ε…¬ε―“ζ₯΅δΈι©εˆ
507
- "shared_yard": 0.25,
508
- "private_yard": 0.35
509
  },
510
  "house_small": {
511
  "no_yard": 0.55,
@@ -520,9 +520,9 @@ def calculate_compatibility_score(breed_info: dict, user_prefs: UserPreferences)
520
  },
521
  "Giant": {
522
  "apartment": {
523
- "no_yard": 0.10, # ε·¨εž‹ηŠ¬εœ¨ε…¬ε―“εŸΊζœ¬δΈι©εˆ
524
- "shared_yard": 0.20,
525
- "private_yard": 0.30
526
  },
527
  "house_small": {
528
  "no_yard": 0.40,
@@ -544,8 +544,8 @@ def calculate_compatibility_score(breed_info: dict, user_prefs: UserPreferences)
544
  # ι‹ε‹•ιœ€ζ±‚ε°η©Ίι–“θ©•εˆ†ηš„ε½±ιŸΏ
545
  exercise_impact = {
546
  "Very High": {
547
- "apartment": -0.30, # ι«˜ι‹ε‹•ιœ€ζ±‚εœ¨ε…¬ε―“η’°ε’ƒζ›΄ε—ι™
548
- "house_small": -0.15,
549
  "house_large": -0.05
550
  },
551
  "High": {
@@ -605,10 +605,10 @@ def calculate_compatibility_score(breed_info: dict, user_prefs: UserPreferences)
605
  def apply_extreme_case_adjustments(score):
606
  # 處理ζ₯΅η«―情況
607
  if size == "Giant" and living_space == "apartment":
608
- return score * 0.5 # ε·¨εž‹ηŠ¬εœ¨ε…¬ε―“η΅¦δΊˆζ›΄εš΄ι‡ηš„ζ‡²η½°
609
 
610
  if size == "Large" and living_space == "apartment" and exercise_needs == "Very High":
611
- return score * 0.6 # ι«˜ι‹ε‹•ιœ€ζ±‚ηš„ε€§εž‹ηŠ¬εœ¨ε…¬ε―“ζ›΄δΈι©εˆ
612
 
613
  if size == "Small" and living_space == "house_large" and exercise_needs == "Low":
614
  return score * 0.9 # δ½Žι‹ε‹•ιœ€ζ±‚ηš„ε°εž‹ηŠ¬εœ¨ε€§ζˆΏε­ε―θƒ½ιŽζ–Όε―¬ζ•ž
 
503
  },
504
  "Large": {
505
  "apartment": {
506
+ "no_yard": 0.35,
507
+ "shared_yard": 0.45,
508
+ "private_yard": 0.55
509
  },
510
  "house_small": {
511
  "no_yard": 0.55,
 
520
  },
521
  "Giant": {
522
  "apartment": {
523
+ "no_yard": 0.15, # ε·¨εž‹ηŠ¬εœ¨ε…¬ε―“εŸΊζœ¬δΈι©εˆ
524
+ "shared_yard": 0.25,
525
+ "private_yard": 0.35
526
  },
527
  "house_small": {
528
  "no_yard": 0.40,
 
544
  # ι‹ε‹•ιœ€ζ±‚ε°η©Ίι–“θ©•εˆ†ηš„ε½±ιŸΏ
545
  exercise_impact = {
546
  "Very High": {
547
+ "apartment": -0.15, # ι«˜ι‹ε‹•ιœ€ζ±‚εœ¨ε…¬ε―“η’°ε’ƒζ›΄ε—ι™
548
+ "house_small": -0.10,
549
  "house_large": -0.05
550
  },
551
  "High": {
 
605
  def apply_extreme_case_adjustments(score):
606
  # 處理ζ₯΅η«―情況
607
  if size == "Giant" and living_space == "apartment":
608
+ return score * 0.75 # ε·¨εž‹ηŠ¬εœ¨ε…¬ε―“η΅¦δΊˆθΌƒδ½Žεˆ†ζ•Έ
609
 
610
  if size == "Large" and living_space == "apartment" and exercise_needs == "Very High":
611
+ return score * 0.85 # ι«˜ι‹ε‹•ιœ€ζ±‚ηš„ε€§εž‹ηŠ¬εœ¨ε…¬ε―“ζ›΄δΈι©εˆ
612
 
613
  if size == "Small" and living_space == "house_large" and exercise_needs == "Low":
614
  return score * 0.9 # δ½Žι‹ε‹•ιœ€ζ±‚ηš„ε°εž‹ηŠ¬εœ¨ε€§ζˆΏε­ε―θƒ½ιŽζ–Όε―¬ζ•ž