Spaces:
Sleeping
Sleeping
File size: 877 Bytes
09755ed d454bb3 09755ed 5ec7a70 09755ed 5ec7a70 09755ed 08ec4b6 09755ed 08ec4b6 09755ed | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | from datetime import timedelta
def predict_next_service(last_service_date, usage_hours, days_per_week, equipment_type):
"""
Predict AMC date based on usage + type of equipment.
"""
# Usage intensity score
usage_score = usage_hours * days_per_week
# Base interval in days
base_interval = 180 # standard
# Adjust interval based on usage
if usage_score >= 120:
interval = 90
elif usage_score >= 80:
interval = 120
elif usage_score >= 40:
interval = 150
else:
interval = 180
# Further adjustment based on equipment type (example rules)
if equipment_type in ["Analyzer", "Centrifuge"]:
interval -= 15 # more sensitive
elif equipment_type == "Incubator":
interval += 15 # more stable
next_date = last_service_date + timedelta(days=interval)
return next_date
|