Hello All,
I need a help to create a map of vehicle ID, pedestrian ID and its corresponding distance from vehicle and then to find the minimum distance for a particular vehicle. Something like the following:
VehID PedID Distance
0 0 X0
0 1 X1
0 2 X2
1 0 Y0
1 1 Y1
1 2 Y2 and so on..
I get each of these entries in different time based on events, like:
Event #1 at time t1 (Pedestrian_ID:0 have distance of X0 from Vehicle_ID:0)
Event #2 at time t2 (Pedestrian_ID:1 have distance of X1 from Vehicle_ID:0)
and so on....
I want to create a map so that it can store each line of entry and keep appending for next entries according to next events. Finally at the last event I should get the full map with all the entries
Then I need to find:
The pedestrian which has the minimum distance from Vehicle_ID:0
The pedestrian which has the minimum distance from Vehicle_ID:1 and so on..
I have started with this code as below:
|
std::map <int vehicle_ID std::map<<int pedestrian_ID, double distance>> my_Map;
|
But I am not able to find, how to add subsequent entries based on events generated at different time and to store them.
Thanks