Advertisement
Guest User

Untitled

a guest
Dec 15th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1.  
  2. def output_alert(eec, aggression, distraction):
  3. output = 0
  4. if (eec == "openRoad"):
  5. output += 1
  6. elif (eec == "normalTraffic"):
  7. output += 2
  8. elif (eec == "crowdedTraffic" or "abnormalDrivingState"):
  9. output += 3
  10.  
  11. if (aggression == "cautious"):
  12. output += 1
  13. elif (aggression == "aggressive"):
  14. output += 3
  15.  
  16. if (distraction == "notDistracted"):
  17. output += 1
  18. elif (distraction == "distracted"):
  19. output += 3
  20.  
  21. alert = "No Alert"
  22.  
  23. if output == 6:
  24. alert = "Medium Alert"
  25. elif output >= 7:
  26. alert = "High Alert"
  27.  
  28. return alert
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement