Hybrid Model

Here we explain hybrid model of macroscopic and microscopic models.

Hybrid_Night.mp4

Background

If we want to simulate a very large urban scene, it often includes several thousands of vehicles roaming around the scene. However, if we simulate the motion of each of them (using microscopic model), it is likely fail to simulate the scene in real time as the computation time is O(n), where n is the number of vehicles.

To amend this issue, we can only simulate only the region of interest with accurate microscopic model, and use macroscopic model for the rest of the scene. In the video above, only the central part is simulated with blue microscopic vehicles, while the boundary parts are simulated with red macroscopic vehicles.

Hybrid Model

As described above, we adopt both macroscopic and microscopic model in our simulator. Therefore, there should be junction points where these different kinds of lanes meet; in these junction points, we have to convert states from one another, and the process has to be differentiable to make this whole simulator differentiable. Note that there are two conversion processes here: macro to micro, and micro to macro.

Macro to Micro

There are two schemes for converting macroscopic states into microscopic states - stochastic and deterministic. In deterministic approach, we use a flux capacitor which is located at the end of the macro lane. After certain amount of flux is accumulated in the capacitor, we can generate a micro vehicle in the next micro lane. Please see the paper to learn about stochastic approach.

Micro to Macro

We can convert micro vehicles into macroscopic density and speed easily; when the vehicle enters the macro lane, we can compute the overlapped region and use it to update the density of the macro cell, and its speed.

Non-Differentiability

Note that there are discrete functions in both macro to micro and micro to macro. Since these functions are related to conversion from density to position, and vice versa, the gradient cannot flow in that direction when we backpropagte the error. Even though the gradient flows across speed, and thus it can convey some information about position and density, it is not very satisfactory.

Ancillary variable, "a"

To amend above issue, we introduce an ancillary variable a, which is equals to 1 (it depends on the implementation; in our implementation, we set as same to the length of the vehicle). This can be thought of as a medium where gradient for density and position flow. Even though it does not offer really accurate gradient, at least it tells us how densities or positions across heterogeneous lanes affect each other.