lbw_review_system_V2 / umpire_decision.py
dschandra's picture
Create umpire_decision.py
4b94bfa verified
def simulate_umpire_decision(pitch, shot, impact, trajectory_hint):
if pitch.lower() == "outside leg":
return {"decision": "NOT OUT", "reason": "Ball pitched outside leg stump"}
if impact.lower() == "outside off" and shot.lower() == "yes":
return {"decision": "NOT OUT", "reason": "Impact outside off and shot offered"}
if "missing" in trajectory_hint.lower():
return {"decision": "NOT OUT", "reason": "Ball not likely to hit stumps"}
return {"decision": "OUT", "reason": "All conditions favor LBW"}