Mercurial Hosting > traffic-intelligence
comparison python/moving.py @ 108:6efe470ea5e5
added test existsAtInstant to STObject
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Fri, 15 Jul 2011 03:04:39 -0400 |
parents | 916678481896 |
children | 606010d1d9a4 |
comparison
equal
deleted
inserted
replaced
107:916678481896 | 108:6efe470ea5e5 |
---|---|
109 def getLastInstant(self): | 109 def getLastInstant(self): |
110 return self.timeInterval.last | 110 return self.timeInterval.last |
111 | 111 |
112 def getTimeInterval(self): | 112 def getTimeInterval(self): |
113 return self.timeInterval | 113 return self.timeInterval |
114 | |
115 def existsAtInstant(self, t): | |
116 return self.timeInterval.contains(t) | |
114 | 117 |
115 def commonTimeInterval(self, obj2): | 118 def commonTimeInterval(self, obj2): |
116 return self.getTimeInterval().intersection(obj2.getTimeInterval()) | 119 return self.getTimeInterval().intersection(obj2.getTimeInterval()) |
117 | 120 |
118 class Point: | 121 class Point: |