Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def output_alert(eec, aggression, distraction):
- output = 0
- if (eec == "openRoad"):
- output += 1
- elif (eec == "normalTraffic"):
- output += 2
- elif (eec == "crowdedTraffic" or "abnormalDrivingState"):
- output += 3
- if (aggression == "cautious"):
- output += 1
- elif (aggression == "aggressive"):
- output += 3
- if (distraction == "notDistracted"):
- output += 1
- elif (distraction == "distracted"):
- output += 3
- alert = "No Alert"
- if output == 6:
- alert = "Medium Alert"
- elif output >= 7:
- alert = "High Alert"
- return alert
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement