Hi Jackob,
I want to point out to your comments at github link- "when calling traci.person.getNextStage(personID, nextStageIndex) with a negative index, if the vehicle has already left the simulation, traci crashes when trying access the vehicle type".
You may be right that it happened due to the fact the vehicle has left. However, the error is due to accessing the previous stage and the properties of previous stage (not the vehicle type or ID of the current stage).
I am attaching a modified TraCI file for your reference. It raises exception on line 66, and a customized error is as follows:
Error in Previous Stage retrieval, so, skip this personID: 2229
Interestingly, when I followed the person in persontrip.rou.xml, I found the following information.
<person id="2229" depart="891.60" color="red">
<walk edges="13 104 24 22 59 53cd 53[0] 78[1][1] 189[0] 189[1][0]+20000" busStop="busStop#31"/>
<ride busStop="busStop#32" lines="14"/>
<ride busStop="busStop#21" lines="89"/>
<walk edges="134b 31 201 201c 204a[0] 204b[0] 204[1][0] 55b 55" busStop="busStop#35"/>
<ride busStop="busStop#36" lines="13"/>
<walk edges="114"/>
</person>
It means that the error occurred when 2229 waiting for his second ride (lines="89"), and I am trying to get the previous stage information, his first ride (lines="14"), possibly, the corresponding vehicle of his first ride has left the simulation. Hence, we are unable to fetch the previous stage information.
Roughly, I guess that this situation might arise whenever there is a consecutive ride (public transit lines) for a passengers, in his plan.
thanks and regards,
Dillip Rout