Spaces:
Runtime error
Runtime error
Create drs/drs_engine.py
Browse files- drs/drs_engine.py +9 -0
drs/drs_engine.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
def is_in_line(x, y, zone):
|
| 2 |
+
return zone['x_min'] <= x <= zone['x_max'] and zone['y_min'] <= y <= zone['y_max']
|
| 3 |
+
|
| 4 |
+
def drs_decision(bounce, impact, stumps_hit):
|
| 5 |
+
pitch_zone = {'x_min': 1.5, 'x_max': 2.5, 'y_min': 0, 'y_max': 1} # Simplified
|
| 6 |
+
impact_zone = pitch_zone
|
| 7 |
+
if is_in_line(*bounce, pitch_zone) and is_in_line(*impact, impact_zone) and stumps_hit:
|
| 8 |
+
return "OUT"
|
| 9 |
+
return "NOT OUT"
|