Mercurial Hosting > traffic-intelligence
comparison python/sensors.py @ 998:933670761a57
updated code to python 3 (tests pass and scripts run, but non-executed parts of code are probably still not correct)
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Sun, 27 May 2018 23:22:48 -0400 |
parents | a8ca72dc1564 |
children |
comparison
equal
deleted
inserted
replaced
997:4f3387a242a1 | 998:933670761a57 |
---|---|
56 if len(instants) == 0: | 56 if len(instants) == 0: |
57 return False | 57 return False |
58 else: | 58 else: |
59 detectionInstants.append(mean(instants)) | 59 detectionInstants.append(mean(instants)) |
60 result = True | 60 result = True |
61 for i in xrange(len(sensors)-1): | 61 for i in range(len(sensors)-1): |
62 result = result and (detectionInstants[i] <= detectionInstants[i+1]) | 62 result = result and (detectionInstants[i] <= detectionInstants[i+1]) |
63 if not result: | 63 if not result: |
64 return result | 64 return result |
65 return result | 65 return result |