I have a simulation of an accident scenario that occurs at the 16000th simulation time-step. I would like to generate this same accident scenario (same geometry, same vehicles, same vehicles speed behaviors and trajectories) in a new simulation (at the beginning time step instead of waiting until 16000 as in the original simulation).
For that, I saved all the vehicles' states in the original simulation of accident: Position, speed, acceleration, type, angle, speed_factor, speed_deviation, lane_id, lane_position.
In the new simulation, I added the vehicles from the accident scenario:
1- traci.vehicle.add(vehID ,routeID ,departSpeed,typeID, departPos=0)
then, for each vehicle , and before executing a simulation step, I adjusted the state of vehicles as in the original scenario accident:
2- traci.vehicle.setAccel(vehID ,accel)
3- traci.vehicle.setSpeed(vehID,speed)
4- traci.vehicle.setSpeedFactor(vehID,factor)
5- traci.vehicle.moveTo(vehID,laneID,pos)
There is only one vehicle that I control through traci using the same rule-based control function as in the accident scenario.
However when I run this new simulation, no accident happen and the trajectories of vehicles are different from the original accident scenario. I thought that I included all the information to reproduce the original accident scenario, especially the vehicle type and speedFactor (where I forced speedFactor Deviation to 0).
Why is the new scenario different from the original ?
How to reproduce the same scenario using initial vehicle states ?
Best regards,
________________________
Zine el abidine KHERROUBI