comparison python/utils.py @ 607:84690dfe5560

add some functions for behaviour analysis
author MohamedGomaa
date Tue, 25 Nov 2014 22:49:47 -0500
parents e24eeb244698
children 0954aaf28231
comparison
equal deleted inserted replaced
606:75ad9c0d6cc3 607:84690dfe5560
361 def _compute(self, _l1, _l2, computeSubSequence = False): 361 def _compute(self, _l1, _l2, computeSubSequence = False):
362 '''returns the longest common subsequence similarity 362 '''returns the longest common subsequence similarity
363 based on the threshold on distance between two elements of lists l1, l2 363 based on the threshold on distance between two elements of lists l1, l2
364 similarityFunc returns True or False whether the two points are considered similar 364 similarityFunc returns True or False whether the two points are considered similar
365 365
366 if aligned, returns the best matching if using a finite delta by shiftinig the series alignments 366 if aligned, returns the best matching if using a finite delta by shifting the series alignments
367 367
368 eg distance(p1, p2) < epsilon 368 eg distance(p1, p2) < epsilon
369 ''' 369 '''
370 if len(_l2) < len(_l1): # l1 is the shortest 370 if len(_l2) < len(_l1): # l1 is the shortest
371 l1 = _l2 371 l1 = _l2