Backend
Sam-Varghese opened this issue · 0 comments
Sam-Varghese commented
Project Backend
- The database name shall be NM_VisionaryTitans
- It'll contain a table namely IncidentsDatabase which will look as follows:
ID | Type | Time | Location | Severity | Medical Aid | Legal Aid | Police Aid |
---|---|---|---|---|---|---|---|
Uo025fu | Car crash | 12 March, 2023 10:15PM | 40.7128° N, 74.0060° W | 7 | True | False | True |
He6kw89 | Fire | 13 March, 2023 02:30AM | 35.6895° N, 139.6917° E | 9 | False | True | True |
S4lh6O23 | Bike Crash | 14 March, 2023 08:45AM | 51.5074° N, 0.1278° W | 5 | True | False | False |
- In the above table, Location is GPS coordinates.
- Then it'll contain another table namely ProgrammaticActions which will look as follows
Incident ID | Medical Aid | Legal Aid | Police Aid |
---|---|---|---|
Uo025fu | True | False | True |
- And we'll have another table namely ManualActions which looks like this:
Incident ID | Medical Aid | Legal Aid | Police Aid | Officers Username |
---|---|---|---|---|
Uo025fu | True | False | True | gabbar_singh |
- In order for machine learning model to keep a track of latest trends in the road, like crowd density, average speed of vehicles, usual paths followed, number of idle vehicles on road, we need to maintain a table namely RealTimeTrends that keeps this information organized:
Start Time | End Time | People Count | Vehicle Count | Average Speed |
---|---|---|---|---|
12 March, 2023 6:00 AM | 12 March, 2023 7:00 AM | 5 | 8 | 20 |
Actual Task
In order to implement the table structure mentioned above, you're required to create python functions wherein we'll pass the column values, and the function should update the respected table
def updateIncidentsDatabase(ID, Type, Time, Location, Severity, medicalAid, legalAid, policeAid):
# Code to update the incidentsDatabase table
Similarly create 2 more python functions namely updateProgrammaticActions, and updateManualActions