Create umpire_decision.py
Browse files- umpire_decision.py +11 -0
umpire_decision.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
def simulate_umpire_decision(pitch, shot, impact, trajectory_hint):
|
2 |
+
if pitch.lower() == "outside leg":
|
3 |
+
return {"decision": "NOT OUT", "reason": "Ball pitched outside leg stump"}
|
4 |
+
|
5 |
+
if impact.lower() == "outside off" and shot.lower() == "yes":
|
6 |
+
return {"decision": "NOT OUT", "reason": "Impact outside off and shot offered"}
|
7 |
+
|
8 |
+
if "missing" in trajectory_hint.lower():
|
9 |
+
return {"decision": "NOT OUT", "reason": "Ball not likely to hit stumps"}
|
10 |
+
|
11 |
+
return {"decision": "OUT", "reason": "All conditions favor LBW"}
|