Perspectives on an ALKS model in SUMO

: The UNECE regulation R157 [1] describes the requirements for a successful implementation of an approvable ALKS (Automated Lane-Keeping System) in great detail. This paper reviews some of the content of this document and describes the first steps that would be needed on how to implement such an ALKS as another driver model into the open source microscopic traffic flow simulator SUMO.


Introduction
One step towards automated driving is what is known as ALKS, an acronym for "Automated Lane Keeping System".This corresponds essentially to level 3 automated driving, and some of the requirements are described in the UNECE document 157 [1] in great length.The goal of this paper is to provisionally test what needs to be done so that SUMO can reproduce the requirements detailed in the UNECE regulation.Furthermore, the UNECE regulation R157 scenarios and models have been described and analyzed in great detail by [2].The aforementioned publication is accompanied by a GitHub repository [3] (whose main code is in Python), where all the three scenarios have been setup so that some of the plots from the document [1] can be reproduced, at least in principle.Furthermore, this repository does contain four different models, three of which are part of the R157 regulation: FSM: Fuzzy Safety Model, see [4] and [1,Chapter 3.4
In this paper, we would like to understand how models used in SUMO can be added to this list.The natural candidate would be to use SUMO's ACC model (Adaptive Cruise Control) [6], and in addition, SUMO's default model that shares some similarities with the RSS model.More precisely, the RSS is closer to Gipps' model [7]; see [8] for a more complete treatment of this matter.However, SUMO's ACC model has also a kind of a RSS model underlying as well, because all SUMO models have been built to avoid collisions under normal traffic conditions.This is achieved with the safety condition of SUMO's default model, which states that the space headway (the longitudinal distance between two vehicles on the same lane), denoted by g, must not be negative (i.e.g ≥ 0).It can be expressed as: In the equation above, V denotes the longitudinal speed of the leading vehicle while v denotes the speed of the following vehicle (also called subject or ego vehicle), τ is the reaction time or, or more precisely, the desired time headway, and b denotes the preferred deceleration of both the subject and the leading vehicles (which is assumed to be the same).Of course, going all the way down to g = 0 doesn't sound like a good idea, therefore SUMO has some additional distance (minGap) g ≥ g c > 0, which for our purpose here might be set to a few centimeters.
On the other side, the RSS states a longitudinal condition which has an additional acceleration term during the reaction time, and it uses a separate deceleration value B for the lead vehicle: as well as a lateral safety condition that enforces the lateral distance d between two adjacent vehicles to be always positive: In the equation above, the speeds v 1 , v 2 denote the lateral speeds of the two adjacent vehicles, while α and β are some lateral accelerations, which are denoted in this model as α := a lateral max,accel and β := a lateral min,brake,correct , to connect with the terminology used in [5].As in the purely longitudinal case above, it seems a better idea to require d ≥ d c > 0, where d c is small, and again of the order of a few centimeters, but this is not explicitly stated in [5].

An incomplete summary of the UNECE regulation R157
The regulatioin R157 defines in essence three different (dangerous) scenarios, which have been named as: Cut-in: A challenging vehicle cuts in from another lane, thereby challenging the ego vehicle either by a side collision or to a rear-end crash into the challenger.The challenger does not change its longitudinal speed, and the ego must be faster than the challenging vehicle, see Fig. 1, panel (a), Cut-out: In this case, the challenging vehicle cuts-out off the lane, thereby revealing another vehicle in front driving slower than the ego vehicle.For an illustration, see Fig. 1, panel (b), Car-following (CF-brake): The ego vehicle has to brake for a challenging (leading) vehicle on the same lane, see Fig. 1, panel (c).
In our opinion, the last scenario named "car-following" is not correctly labeled, as it is very different from what is meant and accepted in the microscopic traffic flow modelling community.A more convenient name would simply be "braking".Also, the paper [2] labeled this scenario as "deceleration of the leading vehicle", and we will follow this convention in this text.In addition, a detailed requirement concerning the minimum distances to be kept with respect to a leading vehicle by an ALKS-equipped vehicle are put forward in [1, Chapter 5.2.3.3] and translated into Equation (4):

The cut-in scenario
This text focuses on the cut-in scenario, which seems to be the most important one in regard to safety concerning lane change maneuvers.The cut-in scenario has four possible outcomes: interrupt-backward Here, the lane change happens too slowly, and the challenging vehicle ends up behind the ego vehicle.side collision The challenging vehicle hits the side of the ego vehicle.rear-end (front) The ego vehicle crashes into the challenging vehicle from behind.no crash The final state is collision-free.rear-end (back) There are some some border cases, where the challenger crashes into the ego vehicle; however, it is not clear to us how this could happen, since it would need the ego vehicle to reduce its speed below the velocity of the challenger.In [1] this is not mentioned explicitly, but in some of the plots some points are purple coloured.This has been observed in SUMO as well, and seems to be related to an incomplete definition of what would be a side collision, i.e. a side collision where the left front of the challenger barely touches the back of the ego vehicle might be mis-classified as rear-end.
To find the boundaries separating the different regions corresponding to the different outcomes, simulation is needed in general.A few cases, though, could be handled (almost) analytically, and these will be dealt with first, since they yield important insights and easy to understand boundaries.
The interrupt backward is such a case: here, the lane change happens too slowly, so that the challenging vehicle ends up behind the ego vehicle.This can be achieved by a small lateral speed v y or a small initial longitudinal distance d x0 (which is denoted by dx 0 in [1]), or a combination of both.Also, the two (longitudinal) speeds are denoted by V (for the challenging vehicle) and v (for the ego vehicle), while their speed difference is ∆v = v − V > 0. If we assume that both vehicles do not change their longitudinal speed during the course of the lane change, then the condition for interrupt backward is, that the time t y needed to go from the center line of the challenging vehicles' lane to touching the ego vehicle needs to be larger than the time t x , that the ego vehicle needs to go entirely in front of the challenger.This condition can be written as follows: where V y denotes the lateral speed of the challenger, which is assumed to be reached immediately at the start of the scenario, (i.e. the initial lateral acceleration is infinite), d y is the lateral distance mentioned above needed in order to complete the lance change, and the constants ℓ c , ℓ e are the length of the ego and the challenger vehicle, respectively.This is in agreement with the presentation in the Appendix of [1], where for fixed values of v and V a plot with the various outcomes in (d x0 , V y )-space is presented.Indeed, with the previous condition we obtain the boundary for the interrupt backward as an hyperbola: Note, that d x0 can be negative, e.g. if the ego vehicle has reached the rear of the challenger.Therefore, this curve, and the entire diagrams in the Appendix of [1] should not start a d x0 = 0, but at d x0 = −(ℓ c + ℓ e ).Then, the boundary can be displayed as in Figure 2; there, it has been assumed that v and V are constant, which is no longer true for v for large distances d x0 .Note, that lateral speeds larger than about V y = 4 m/s are physically very difficult to achieve 1 .
In addition to this boundary line, we can compute an additional one.Assuming again constant speeds, if the time needed to change to the new lane t y is shorter or equal to the time the ego vehicles needs to cover d x0 then the ego will end up exactly behind the challenger.Of course, in this case braking will occur before, so this is just an abstract line that determine the boundaries regarding the side collisions.It can easily be derived from the condition t y = t x = d x0 /∆v and corresponds to Equation (6) with ℓ c = ℓ e = 0.Both are visualized in Figure 2.
For large values of d x0 one may assume that human drivers will accelerate or brake, in order to safely clear up the situation.For the models in [1] this means deceleration is needed to adapt the speed to the one of the challenger, which in turn requires a complicated approach involving reaction times and the various decelerations computed there.

Replicating the cut-in scenario with SUMO
In order to analyse SUMO's behaviour according to the constraints given by the R157 document, a SUMO scenario had to be set up which replicates the initial conditions for the cut-in scenario.Figure 3 shows a screenshot of the simulated scenario.

Choice of parameters
The following two tables, Table 1 and Table 2, show the values of the different parameters for SUMO's simulator as well as for the two vehicles in the cut-in scenario.We set the initial conditions as well as SUMO's behaviour in order to replicate the overall scenario by setting several parameters in the corresponding XML demand file as well as with the help of SUMO's TraCI API.All values are set to align with the values we found in the regulation.a Reduced here to match the "ego" deceleration value in order to avoid harder braking than defined in the Reg157.
By setting a lane change duration to meet the required lateral lane change velocity for the cut-in scenario, SUMO's simple continuous lane change model is deployed, instead of the default lane change model which performs lane changes instantaneously and therefore does not apply here.It is also important to note that at the time of the writing, SUMO does not yet have a proper way to model reaction times.Indeed, by default drivers react to their environment in every simulation step and their reaction time is equal to the time step used for the simulation.To change the frequency at which decisions are taken (for delaying responses for instance), the parameter actionStepLength must be set.This parameter tells SUMO to update the simulation at every step length (time step) while taking decisions every "action step length".However this parameter is different from a genuine reaction time because whenever a decision is taken, it is taken relatively to the state in the previous simulation step rather than to the state that was seen in their previous action step, thus somehow breaking the perception-reaction loop.It nevertheless constitutes a delayed reaction to a changing environment, so it might serve in fact as a kind of surrogate reaction time.

Collision classification
As mentioned before, different types of collisions are registered.Front and back collisions are detected by SUMO already, but SUMO doesn't catch side collisions yet.In order to detect such collisions, we added a bounding box intersection test in the scenario's script.Nevertheless, most of the side collisions appeared as either front or back collisions, because the side collisions weren't captured early on.To remedy to this problem, the python script used bounding boxes that were slightly larger (a few centimeter on each side) than the bounding boxes of the two vehicles in SUMO, therefore bypass the standard detection mechanism of SUMO and allowing to classify a side collision before SUMO classifies the conflict as a front or back collision.Interrupt backward situations were simply obtained by checking the position of the vehicles at the end of the simulation.See figures 4 and 5 for two plots obtained with different initial conditions.(For more details, all the plots are included in the APPENDIX.)

Comparison with other models
As mentioned before, [2] provided a code base in order to compare the different driver models, three of them are used in the regulation R157.We adapted and extended this code to run the same computer experiments with SUMO (SUMO being instantiated directly from the aforementioned code) in a similar fashion to the TraCI script introduced before. 2 The following two figures, Figure 6 and Figure 7, show some results for collisions in low-speed and high-speed scenarios, respectively.(For more details, all the plots are included in the APPENDIX.) Firstly, we see significant differences between the two models "CC human driver" and "Reg157" compared to the other three: those two models produce a lot more crashes for higher initial distances.Secondly, we see that SUMO's collision pattern is basically independent from the lateral velocity on the right-hand side, specifically for higher longitudinal speeds, as illustrated in Figure 7.There is a cutoff regarding the initial distance between the vehicles, such that lane changes initiated with a distance larger than this cutoff will always result in no collision.This cutoff depends on the relative longitudinal velocity between the vehicles: the larger the relative speed, the greater the cutoff.On the contrary, the other driver models exhibit a different behavior: a collision is still possible even with small lateral velocities.We explain SUMO's behaviour in the Section 4 in more detail.Additionally, we see that the RSS model and SUMO produce collisions for lower lateral velocities whereas the other models avoid this (cf.the cross and bubble markers below the red line in both figures.)Table 3 shows the aggregated results, i.e. collision percentages, for two speed levels.The 'low' level corresponds to a velocity range of 0-60 km/h whereas the 'high' level corresponds to a range of 70-130 km/h.In line with the pattern we identified in the previous Figures 6 and 7, SUMO produces the fewest collisions according to these percentages.But note that, for this cut-in scenario, this is not the ideal outcome, since the original goal was to reproduce the results presented in the UNECE regulation R157.

Discussion
The results clearly illustrate fundamental differences between SUMO and the other models in terms of collision rate during a lane change as well as other patterns.Our explanation for this is twofold: 1. SUMO does not have a proper mechanism for reaction times.The action step length parameter is the best proxy available and we notice that the higher this parameter, the greater the cutoff: the distance after which SUMO doesn't produce any collision is shifted to the right.2. SUMO's mechanisms to detect lane changes and consequently perform vehicle maneuvers for interacting vehicles in such situations, is fundamentally different from the testing concept in the 'cut-in' scenario described in the regulation R157.
Basically, the 'cut-in' scenario from the regulation considers a non-cooperative lane change maneuver, i.e. when the challenging vehicle is simply not reacting to another vehicle on the adjacent lane, thereby serving merely as an obstacle to the ego vehicle.On the contrary, SUMO's lane change (LC) model is built to compute velocity changes for both, the challenging vehicle as well as the ego vehicle, to promote a successful lane change maneuver [9].This ultimately leads to the effect, that the LC model will override any deceleration computed by the carfollowing model to ensure a safe gap between a leading and a following vehicle.The mechanism becomes effective the moment a vehicle starts a lane change, thereby immediately triggering SUMO's LC model to deploy velocity adaptions on either vehicle.Even though, we utilized the continuous simple lane change model, the lateral velocity of a cut-in vehicle has no impact on the deceleration triggered by the LC model.This eliminates any potential delays for lane change detection procedures e.g. based on lateral offsets, velocities or other variables, as partially modeled in the other four models.
To illustrate this behaviour, Figure 8 compares the differences between the reaction delay of the FSM model vs. SUMO for a single example run.The FSM model clearly shows a delayed reaction to a cut-in vehicle, visible in the acceleration and speed graphs, whereas SUMO immediately reacts to a lane changing cut-in vehicle, regardless of the apparent lateral velocity.

Conclusion and Outlook
We have tried to reproduce some of the results from the UNECE R157 regulation regarding ALKS systems with SUMO.In doing so, we learned something about SUMO, but we also learned something about the UNECE regulation R157.
On one hand, SUMO fails at a proper representation of reaction times, and it recognizes an impeding lane change too early.With the reaction time, we had limited success by emulating it with the action step length mechanism in SUMO.However, this does not solve the issues of the lane change recognition: in SUMO, the ego vehicle knows immediately that it is happening and does react to it accordingly.Therefore, in most cases SUMO performs the 'cut-in' scenario much safer than what is expected for an ALKS that adheres to the regulation R157.SUMO's sublane model is probably most suited to adequately emulate the delayed-recognition mechanisms by the other reference models.Interestingly, despite these differences, its level of safety is on par with two of the models in the JRC (Joint Research Center) repository, namely the RSS and FSM, but not with the CC and the R157 model.
On the other hand, there are some examples in the regulation R157 where it is obvious, that even a simple real ALKS could outperform what is required in the regulation.It is not clear to us whether this was done intentionally, or whether it is an oversight.
Intentionally, since in this case car manufacturers could argue that their cars supersede the regulation easily.
Another difficult point touched here, however only shortly, is the detailed statement of the distances that ALKS cars are allowed, which may create capacity issues.This goes together with a fairly weak formulation in the regulation about string instability, which is a known issue of current ADAS (Advanced Driver-Assistant Systems), which could be viewed as level 1 or level 2 automated cars [10].Taken together, the time headway T 0 = 1.6 s and a possible string instability could decrease the performance of a transport system with an increasing number of ALKS-equipped vehicles.
Apart from this, the paper has described the first steps on how to implement a model in SUMO that adheres, at least in part, to the safety-related aspects of the R157.Further tests with the sublane model will be necessary to assess its feasibility for this specific application.In particular, some shortcomings in SUMO to model a perceptionreaction loop will be tackled in our upcoming research and development, e.g. by modeling concepts like 'driver awareness', which would impact reaction delays.The decision whether to put it into the SUMO kernel as another CF-model has not yet been made.

Figure 1 .
Figure 1.Simplified illustration of the three scenarios described in the regulation R157 [1, Figure 5].Panel (a) Cut-in vehicle from adjacent lane; Panel (b) Cut-out vehicle exposes leading vehicle; Panel (c) Deceleration in car-following situation.

Figure 2 .
Figure 2. The area where the challenger ends up behind the ego vehicle (yellow), and the area that corresponds to the side collisions (orange) for ∆v = 40 km/h, d y = 1.6 m and vehicle lengths ℓ e = ℓ c = 5 m.

Figure 3 .
Figure 3. Example of collision in the SUMO cut-in scenario. a Cut-in lateral velocity V y Ego's speed v ego,lon = 60 km/h, relative velocity = 40 km/h no crash interrupt-backward rear-end (front) rear-end (back) side

Figure 4 .
Figure 4. Example of collision plot for low speed cut-in scenario.

Figure 5 .
Figure 5. Example of plot for high speed cut-in scenario.

Figure 6 .
Figure 6.Example of collision plot for low speed cut-in scenario with relative speed of 20 km/h; the red line denotes the hyperbola given by Equation (6).

Figure 7 .
Figure 7. Example of collision plot for high speed cut-in scenario with relative speed of 80km/h; the red line denotes the hyperbola given by Equation (6).

Figure 8 .
Figure 8. Example of comparison between the FSM model and SUMO for a collision case.Panel (a-b) illustrates acceleration a lon , panel (c-d) illustrates longitudinal speed v lon .

Figure 10 .
Figure 10.Overview of the results for low speed 'cut-in' scenario: the y-axis are sorted by longitudinal relative velocities, while the x-axis are sorted by lateral relative velocities.

Figure 11 .
Figure 11.Overview of the results for high speed 'cut-in' scenario: the y-axis are sorted by longitudinal relative velocities, while the x-axis are sorted by lateral relative velocities.

Table 1 .
Parameter ranges used for generating the different plots

Table 2 .
Other SUMO parameters for the cut-in scenario.