comparison python/events.py @ 321:a5e40bd04cf4

rearranged LCSS indicator functions
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Tue, 07 May 2013 02:02:55 +0200
parents 419f30491a4b
children 6c9c7c956926
comparison
equal deleted inserted replaced
320:419f30491a4b 321:a5e40bd04cf4
40 self.roadUser2 = roadUser2 40 self.roadUser2 = roadUser2
41 self.categoryNum = categoryNum 41 self.categoryNum = categoryNum
42 self.indicators = {} 42 self.indicators = {}
43 43
44 def getIndicator(self, indicatorName): 44 def getIndicator(self, indicatorName):
45 return self.indicators[indicatorName] 45 return self.indicators.get(indicatorName, None)
46 46
47 def addIndicator(self, indicator): 47 def addIndicator(self, indicator):
48 self.indicators[indicator.name] = indicator 48 if indicator:
49 self.indicators[indicator.name] = indicator
49 50
50 def computeIndicators(self): 51 def computeIndicators(self):
51 '''Computes the collision course cosine only if the cosine is positive''' 52 '''Computes the collision course cosine only if the cosine is positive'''
52 collisionCourseDotProducts = {}#[0]*int(self.timeInterval.length()) 53 collisionCourseDotProducts = {}#[0]*int(self.timeInterval.length())
53 collisionCourseAngles = {} 54 collisionCourseAngles = {}