Deterministic Scenario Simulation

Deterministic Scenario Simulation


As initially introduced by the Providing the Safety Case: is Deterministic or Stochastic?, a stochastic simulation containing several components that introduces randomness can lead to inconclusive and obscure solutions. The bigger the amount of randomness in the process, the more uncertain the solutions are. So, what can we do to avoid these inconclusive solutions?

AVSandbox aims to help by providing a simulation package built with deterministic components, giving the user a clear picture of what might have changed in the system as well as enabling the repeatability of scenarios. But, ok, what exactly do we mean when we say a “deterministic simulator”? What parts of the simulation are deterministic? Would it be 100% deterministic?

The Simulator Engine

Our simulator has built-in technology to ensure that the computing processes and threads, responsible for calculating the physics and graphics, synchronise so that the simulation only advances to the next time step when every process and thread has completed their tasks for the current time step. This means that the simulation will be deterministic in each frame that it simulates. When running a full vehicle simulation with multiple sensors, this synchronisation is applied to every single sensor. Simulation will not proceed to the next time step until the whole sensor suite has been fully calculated.

The video below shows this technology in use, on it the same scenario was simulated 4 times and recorded. When comparing the output side by side it is possible to see there is no variation between the frames rendered.


However, the scenario simulation is a complex environment built from several components. For this reason, for it to be deterministic, all components should also be capable of running in a deterministic environment and must produce the same outputs for the same given inputs. There are 3 components that are the most important:

Traffic agents

The traffic generation ensures that all agents (vehicles, pedestrians and objects) are initialised at the start of the simulation before proceeding with the first simulation frame. Once the simulation starts, it ensures that the same position and orientation are calculated at each time step for multiple repeats of the same scenario. That way, the agents will react, stop, slowdown in the same way when running the same scenario multiple times.


To have deterministic sensors, the simulation ensures that the same data input is generated and sent to the sensors for each time step. That means the sensors will be getting the same input at each frame, which the sensor must also process in a deterministic way.  For sensor models that include noise factors we can either disable the noise entirely or use a fixed seed for the random number generators to ensure that the noise introduced is also repeatable. What this results in, for a camera for example, is that it will produce the same image for each frame rendered when running the same scenario multiple times.

AV Controller

This is usually the more challenging component, as controllers are complex and developed by 3rd party companies. Therefore, it is the part of the simulation where we as the simulator software developers have no control over. To have a fully deterministic simulation, it is also required that the AV controller is deterministic. As most controllers are built using AI they do not behave in a truly deterministic way. However, because the rest of the simulation is deterministic, it does allow you to study how repeatable the AV controller’s behaviour is and explore its robustness.


Hopefully, this blog article brings some clarity for questions you might have on how our simulation is deterministic and what the requirements are. All components of our simulator are built in such a way that allow us to simulate scenarios that are repeatable and can run in a deterministic environment. This repeatability is extremely important for AV developers to be compliant with new legislations and the pursuit to prove that the AV is safe enough. This is a topic we will continue to explore over the coming weeks and months in future blog posts.

However, even when running an AV controller that is not deterministic, it is still possible to benefit from a simulator that is deterministic as the only changing variable in the scenario to be analysed will be the AV behaviour. This allows to put an AV controller through the same scenario as many times as necessary in order to validate changes done to the controller.  

Written by: Felipe Ferrary – Senior Software Engineer

Please get in touch if you have any questions or have got a topic in mind that you would like us to write about. You can submit your questions / topics via: Tech Blog Questions / Topic Suggestion