Mercurial > hg > nsaunier > traffic-intelligence
comparison scripts/safety-analysis.py @ 344:14a2405f54f8
slight modification to safety analysis and generalized script to delete computed data (objects and interactions)
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Fri, 21 Jun 2013 17:32:57 -0400 |
| parents | 74e437ab5f11 |
| children | c64a4f889b97 |
comparison
equal
deleted
inserted
replaced
| 343:74e437ab5f11 | 344:14a2405f54f8 |
|---|---|
| 4 | 4 |
| 5 import sys, argparse | 5 import sys, argparse |
| 6 | 6 |
| 7 import matplotlib.pyplot as plt | 7 import matplotlib.pyplot as plt |
| 8 import numpy as np | 8 import numpy as np |
| 9 | |
| 10 from ConfigParser import ConfigParser | |
| 11 | 9 |
| 12 parser = argparse.ArgumentParser(description='The program processes indicators for all pairs of road users in the scene') | 10 parser = argparse.ArgumentParser(description='The program processes indicators for all pairs of road users in the scene') |
| 13 parser.add_argument('configFilename', help = 'name of the configuration file') | 11 parser.add_argument('configFilename', help = 'name of the configuration file') |
| 14 # parser.add_argument('-c', help = 'name of the configuration file') # | 12 # parser.add_argument('-c', help = 'name of the configuration file') # |
| 15 args = parser.parse_args() | 13 args = parser.parse_args() |
| 51 | 49 |
| 52 objects = storage.loadTrajectoriesFromSqlite(params.databaseFilename,'object') | 50 objects = storage.loadTrajectoriesFromSqlite(params.databaseFilename,'object') |
| 53 # features = storage.loadTrajectoriesFromSqlite('amherst-10.sqlite','feature') # needed if normal adaptation | 51 # features = storage.loadTrajectoriesFromSqlite('amherst-10.sqlite','feature') # needed if normal adaptation |
| 54 | 52 |
| 55 interactions = events.createInteractions(objects) | 53 interactions = events.createInteractions(objects) |
| 56 for inter in interactions[:2]: | 54 for inter in interactions: |
| 57 inter.computeIndicators() | 55 inter.computeIndicators() |
| 58 # inter.computeCrossingsCollisions(constantVelocityPredictionParameters, collisionDistanceThreshold, timeHorizon, computeCZ) | 56 # inter.computeCrossingsCollisions(constantVelocityPredictionParameters, collisionDistanceThreshold, timeHorizon, computeCZ) |
| 59 | 57 |
| 60 storage.saveIndicators(params.databaseFilename, interactions) | 58 storage.saveIndicators(params.databaseFilename, interactions) |
| 61 | 59 |
