Spaces:
Configuration error
Configuration error
ychanakya12 commited on
Commit ·
cb748da
1
Parent(s): a7b0fd7
Ensure task grading scores are strictly within (0, 1)
Browse files- src/tasks/task_easy.py +4 -2
- src/tasks/task_hard.py +1 -1
- src/tasks/task_medium.py +2 -2
src/tasks/task_easy.py
CHANGED
|
@@ -8,6 +8,8 @@ def grade(env) -> float:
|
|
| 8 |
"""
|
| 9 |
if env.budget <= 0:
|
| 10 |
# Partial credit for how close they came
|
| 11 |
-
|
|
|
|
| 12 |
profit = env.budget - 100_000.0
|
| 13 |
-
|
|
|
|
|
|
| 8 |
"""
|
| 9 |
if env.budget <= 0:
|
| 10 |
# Partial credit for how close they came
|
| 11 |
+
val = 1.0 + env.budget / 50_000
|
| 12 |
+
return min(0.999, max(0.001, round(val, 4)))
|
| 13 |
profit = env.budget - 100_000.0
|
| 14 |
+
val = profit / 50_000.0
|
| 15 |
+
return min(0.999, max(0.001, round(val, 4)))
|
src/tasks/task_hard.py
CHANGED
|
@@ -23,4 +23,4 @@ def grade(env) -> float:
|
|
| 23 |
+ low_burnout_score* 0.15
|
| 24 |
+ rep_target_bonus
|
| 25 |
)
|
| 26 |
-
return
|
|
|
|
| 23 |
+ low_burnout_score* 0.15
|
| 24 |
+ rep_target_bonus
|
| 25 |
)
|
| 26 |
+
return min(0.999, max(0.001, round(raw, 4)))
|
src/tasks/task_medium.py
CHANGED
|
@@ -7,7 +7,7 @@ def grade(env) -> float:
|
|
| 7 |
Also rewards reputation maintenance (Factor 6).
|
| 8 |
"""
|
| 9 |
if not env.history:
|
| 10 |
-
return 0.
|
| 11 |
|
| 12 |
# Factor 1: profit growth
|
| 13 |
growth = (env.budget - 100_000.0) / 100_000.0
|
|
@@ -18,4 +18,4 @@ def grade(env) -> float:
|
|
| 18 |
|
| 19 |
# Weighted combination
|
| 20 |
raw = growth_score * 0.70 + rep_score * 0.30
|
| 21 |
-
return
|
|
|
|
| 7 |
Also rewards reputation maintenance (Factor 6).
|
| 8 |
"""
|
| 9 |
if not env.history:
|
| 10 |
+
return 0.001
|
| 11 |
|
| 12 |
# Factor 1: profit growth
|
| 13 |
growth = (env.budget - 100_000.0) / 100_000.0
|
|
|
|
| 18 |
|
| 19 |
# Weighted combination
|
| 20 |
raw = growth_score * 0.70 + rep_score * 0.30
|
| 21 |
+
return min(0.999, max(0.001, round(raw, 4)))
|