Mercurial > hg > nsaunier > traffic-intelligence
comparison python/events.py @ 735:0e875a7f5759 dev
modified prototypeCluster algorithm to enforce similarity when re-assigning and to compute only the necessary similarities
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Wed, 12 Aug 2015 00:24:06 -0400 |
| parents | b02431a8234c |
| children | 8ba82b371eea |
comparison
equal
deleted
inserted
replaced
| 734:1d4dcb5c8708 | 735:0e875a7f5759 |
|---|---|
| 293 allPoints += points | 293 allPoints += points |
| 294 else: | 294 else: |
| 295 print('unknown type of point: '+pointType) | 295 print('unknown type of point: '+pointType) |
| 296 return allPoints | 296 return allPoints |
| 297 | 297 |
| 298 def prototypeCluster(interactions, similarityMatrix, indicatorName, minSimilarity, minClusterSize = None, randomInitialization = False): | 298 def prototypeCluster(interactions, similarities, indicatorName, minSimilarity, similarityFunc = None, minClusterSize = None, randomInitialization = False): |
| 299 return ml.prototypeCluster([inter.getIndicator(indicatorName) for inter in interactions], similarityMatrix, minSimilarity, minClusterSize, randomInitialization) | 299 return ml.prototypeCluster([inter.getIndicator(indicatorName) for inter in interactions], similarities, minSimilarity, similarityFunc, minClusterSize, randomInitialization) |
| 300 | 300 |
| 301 class Crossing(moving.STObject): | 301 class Crossing(moving.STObject): |
| 302 '''Class for the event of a street crossing | 302 '''Class for the event of a street crossing |
| 303 | 303 |
| 304 TODO: detecter passage sur la chaussee | 304 TODO: detecter passage sur la chaussee |
