Mercurial Hosting > traffic-intelligence
comparison scripts/safety-analysis.py @ 1128:e5c43496d9d8 Etienne-Beauchamp/added-d-optional-argument-1581358671588
added -d optional argument
author | Etienne Beauchamp <etienne-2.beauchamp@polymtl.ca> |
---|---|
date | Mon, 10 Feb 2020 18:18:10 +0000 |
parents | cc5cb04b04b0 |
children | e257643b1d0e |
comparison
equal
deleted
inserted
replaced
1127:94ac9c16420f | 1128:e5c43496d9d8 |
---|---|
11 # todo: very slow if too many predicted trajectories | 11 # todo: very slow if too many predicted trajectories |
12 # add computation of probality of unsucessful evasive action | 12 # add computation of probality of unsucessful evasive action |
13 | 13 |
14 parser = argparse.ArgumentParser(description='The program processes indicators for all pairs of road users in the scene') | 14 parser = argparse.ArgumentParser(description='The program processes indicators for all pairs of road users in the scene') |
15 parser.add_argument('--cfg', dest = 'configFilename', help = 'name of the configuration file', required = True) | 15 parser.add_argument('--cfg', dest = 'configFilename', help = 'name of the configuration file', required = True) |
16 parser.add_argument('-d', dest = 'databaseFilename', help = 'name of the Sqlite database file (overrides the configuration file)') | |
16 parser.add_argument('-n', dest = 'nObjects', help = 'number of objects to analyse', type = int) | 17 parser.add_argument('-n', dest = 'nObjects', help = 'number of objects to analyse', type = int) |
17 # TODO analyze only | 18 # TODO analyze only |
18 parser.add_argument('--prediction-method', dest = 'predictionMethod', help = 'prediction method (constant velocity (cvd: vector computation (approximate); cve: equation solving; cv: discrete time (approximate)), normal adaptation, point set prediction)', choices = ['cvd', 'cve', 'cv', 'na', 'ps', 'mp']) | 19 parser.add_argument('--prediction-method', dest = 'predictionMethod', help = 'prediction method (constant velocity (cvd: vector computation (approximate); cve: equation solving; cv: discrete time (approximate)), normal adaptation, point set prediction)', choices = ['cvd', 'cve', 'cv', 'na', 'ps', 'mp']) |
19 parser.add_argument('-p', dest = 'prototypeDatabaseFilename', help = 'name of the database containing the prototypes') | 20 parser.add_argument('-p', dest = 'prototypeDatabaseFilename', help = 'name of the database containing the prototypes') |
20 parser.add_argument('--no-motion-prediction', dest = 'noMotionPrediction', help = 'does not compute indicators like TTC depending on motion prediction', action = 'store_true') | 21 parser.add_argument('--no-motion-prediction', dest = 'noMotionPrediction', help = 'does not compute indicators like TTC depending on motion prediction', action = 'store_true') |
22 parser.add_argument('--display-cp', dest = 'displayCollisionPoints', help = 'display collision points', action = 'store_true') | 23 parser.add_argument('--display-cp', dest = 'displayCollisionPoints', help = 'display collision points', action = 'store_true') |
23 parser.add_argument('--nthreads', dest = 'nProcesses', help = 'number of processes to run in parallel', type = int, default = 1) | 24 parser.add_argument('--nthreads', dest = 'nProcesses', help = 'number of processes to run in parallel', type = int, default = 1) |
24 args = parser.parse_args() | 25 args = parser.parse_args() |
25 | 26 |
26 params = storage.ProcessParameters(args.configFilename) | 27 params = storage.ProcessParameters(args.configFilename) |
28 params.databaseFilename = args.databaseFilename | |
27 | 29 |
28 # parameters for prediction methods | 30 # parameters for prediction methods |
29 if args.predictionMethod is not None: | 31 if args.predictionMethod is not None: |
30 predictionMethod = args.predictionMethod | 32 predictionMethod = args.predictionMethod |
31 else: | 33 else: |