Mercurial > hg > nsaunier > traffic-intelligence
comparison python/utils.py @ 619:dc2d0a0d7fe1
merged code from Mohamed Gomaa Mohamed for the use of points of interests in mation pattern learning and motion prediction (TRB 2015)
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Wed, 10 Dec 2014 15:27:08 -0500 |
| parents | 0954aaf28231 |
| children | c9a0b72979fd |
comparison
equal
deleted
inserted
replaced
| 596:04a8304e13f0 | 619:dc2d0a0d7fe1 |
|---|---|
| 359 def _compute(self, _l1, _l2, computeSubSequence = False): | 359 def _compute(self, _l1, _l2, computeSubSequence = False): |
| 360 '''returns the longest common subsequence similarity | 360 '''returns the longest common subsequence similarity |
| 361 based on the threshold on distance between two elements of lists l1, l2 | 361 based on the threshold on distance between two elements of lists l1, l2 |
| 362 similarityFunc returns True or False whether the two points are considered similar | 362 similarityFunc returns True or False whether the two points are considered similar |
| 363 | 363 |
| 364 if aligned, returns the best matching if using a finite delta by shiftinig the series alignments | 364 if aligned, returns the best matching if using a finite delta by shifting the series alignments |
| 365 | 365 |
| 366 eg distance(p1, p2) < epsilon | 366 eg distance(p1, p2) < epsilon |
| 367 ''' | 367 ''' |
| 368 if len(_l2) < len(_l1): # l1 is the shortest | 368 if len(_l2) < len(_l1): # l1 is the shortest |
| 369 l1 = _l2 | 369 l1 = _l2 |
