Hello Jakob, Thanks for the clarification.
I went back to the output of both approaches to compare, and I was expecting to see that the minTTC value would change to a lower one when the one I calculate is equal to that value. But what I found are completely different values (example snippet in the attached csv file.) am I calculating the ttc wrong? Thanks Mariam From: sumo-user <sumo-user-boun...@eclipse.org> On Behalf Of Jakob Erdmann Sent: Friday, May 13, 2022 1:48 AM To: Sumo project User discussions <sumo-user@eclipse.org> Subject: Re: [sumo-user] Calculating time-to-collision minTTC returns the *minimum* TTC observed for all ongoing encounters of the ego vehicle (during the whole time of the encounter thus far) instead of the current TTC which you are calculating. Am Fr., 13. Mai 2022 um 02:43 Uhr schrieb Mariam Wessam Hassan Mohamed Nour <mariam.n...@knights.ucf.edu<mailto:mariam.n...@knights.ucf.edu>>: Hi all, I'm trying to calculate time to collision at every time step for each vehicle in sumo. I'm getting the spacing between each two vehicles as well as the speed of the leader using the getLeader function. Then I use the equation ((spacing+minGap)/difference in speed) to get ttc. The gap calculation was based on this (https://github.com/eclipse/sumo/issues/10178<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feclipse%2Fsumo%2Fissues%2F10178&data=05%7C01%7Cmariam.nour%40knights.ucf.edu%7Cd13e51836af04bf16ab908da34a438cd%7C5b16e18278b3412c919668342689eeb7%7C0%7C1%7C637880177181658316%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=eXbbAPsj47mtscLkyZ3utWJRF%2BqHGgrDOdyfyWnOMIU%3D&reserved=0>) On the other hand, every vehicle is equipped with an SSM device to calculate ttc. So I'm also able to directly get ttc values for each vehicle using traci.vehicle.getParameter(veh, "device.ssm.minTTC"). However, this ttc value and the one I calculate above don't match. Am I calculating ttc using wrong values in the first approach? If not, then what could be the problem? Thanks Mariam _______________________________________________ sumo-user mailing list sumo-user@eclipse.org<mailto:sumo-user@eclipse.org> To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.eclipse.org%2Fmailman%2Flistinfo%2Fsumo-user&data=05%7C01%7Cmariam.nour%40knights.ucf.edu%7Cd13e51836af04bf16ab908da34a438cd%7C5b16e18278b3412c919668342689eeb7%7C0%7C1%7C637880177181658316%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=xizxaSCbVgRdbtfpoticPRJkn%2FV7Y7dXB%2FCw4Zudwy8%3D&reserved=0>
snippet_ttc.csv
Description: snippet_ttc.csv
_______________________________________________ sumo-user mailing list sumo-user@eclipse.org To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user