Steps to clean data and run the simulation
- Extract the columns listed in the report from the GPS and Ticketing data for the required time period into csv.
- Select the route you want to map (note the code has been written only for buses that run a single route in a day). The corresponding ticket data has to be extracted (the route is defined by the first part of schedule number, split by /).
- From the vehicles document find the device id of all the vehicles involved.
- Pull the gps data of the corresponding device ids.
- GPS device for each device id was stored in a seperate csv file
- Run GPS_clean_data on GPS data for each file, consider only the tuples where Usable = 0
- Run multiroutes to get a list of vehicle numbers that only run on one route for the entire day.
- Run map_vehicles to map the vehicles of the particular route (that run only that route) to the device id.
- Run Prepare_tickets to create seperate csv files for tickets purchased by each bus with a unique device id (note the device id is used as the name of the file for both ticketing and GPS data)
- Ensure that the device ids in the ticketing and GPS data are the same (haven't written code for this)
- Run bin_multi_files on all the files with GPS and ticketing data.
- Run a simple CORS server by running the simple-cors-http-server python script from the directory with the data
- The data is now ready to use for the simulation. Run init.html from the simulation folder on your browser (has been tested only on google chrome)