-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
56 lines (41 loc) · 1.41 KB
/
README
File metadata and controls
56 lines (41 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
tripgrid: A module to simulate trips and record their updates that provide the
ability to query data in Log(N) time. The TripQuery module provides the API to
query the database for trip information.
dependencies:
- python 2.7
- rabbitmq
- celery
- redis
To run the simulator and some queries:
- start rabbbitmq
> sudo rabbitmq-server
- start the redis server
> redis-server
- start celery app
> celery worker --app=tripgrid -l error
- start the simulator
> python
>>> import sys, tripgrid.simulator
>>> tripgrid.simulator.main()
Let the simulator run for a while and run some queries:
# all trips
python tripgrid/TripQuery.py -a --bl -90,-180 --tr 90,180
# trips that started in grid
python tripgrid/TripQuery.py -s --bl -90,-180 --tr 90,180
# trips that ended in grid
python tripgrid/TripQuery.py -e --bl -90,-180 --tr 90,180
# trips that ran between these times
python tripgrid/TripQuery.py -t --t0 '2014-01-14 15:09:00' --t1 "15:10:00"
# trips that ran between these times and ended in this grid
python tripgrid/TripQuery.py -t --t0 '2014-01-14 15:09:00' --t1 "15:10:00" -e --bl 0,0 --tr 90,180
Testing:
- start rabbbitmq
> sudo rabbitmq-server
- start the redis server
> redis-server
- start celery app
> celery worker --app=tripgrid -l error
- start test driver
> python
>>> import sys, tripgrid.drivetest
>>> tripgrid.drivetest.main()