Cooperative Merging Strategy Between Connected Autonomous Vehicles in Mixed Traffic

In this work we propose a new cooperation strategy between connected autonomous vehicles in on-ramps merging scenarios and we implement the cut-in risk indicator (CRI) to investigate the safety effect of the proposed strategy. The new cooperation strategy considers a pair of vehicles approaching an on-ramp. The strategy then makes decisions on the target speeds/accelerations of both vehicles, possible lane changing, and a dynamic decision-making approach in order to reduce the risk during the cut-in manoeuvre. In this work, the CRI was first used to assess the risk during the merging manoeuvre. For this purpose, scenarios with penetration rates of autonomous vehicles from 20% to 100%, with step of 10%, both connected and non-connected autonomous vehicles were evaluated. As a result, on average a 35% reduction of the cut-in risk manoeuvres in connected autonomous vehicles compared to non-connected autonomous vehicles is obtained. It is shown through the analysis of probability density functions characterising the CRI distribution that the reduction is not homogeneous across all indicator values, but depends on the penetration rate and the severity of the manoeuvre.


I. INTRODUCTION
O NE OF the main causes of traffic congestion at highways is the on-ramps merging ( [1], [2]) and because of its strong impact on the traffic efficiency, on-ramp merging process has been widely studied by researchers since the 1930s [3]. Several techniques have been proposed to enhance the on-ramp merging, with the aim of improving traffic conditions on highways, [4], [5]. These include metering algorithms, from early fixed-time approaches (i.e., based on simple static model and on constant historical demands, without use of real-time measurements, e.g., [6]), to trafficresponsive regulators (i.e., based on real-time measurements and aimed at keeping the freeway traffic conditions close to The review of this article was arranged by Associate Editor Guoyuan Wu. pre-specified set of values, e.g., [7], [8]), and to nonlinear optimal control schemes (i.e., based on the minimizing of an objective criterion, e.g., [9]).
With the recent development of vehicle-to-vehicle (V2V) and vehicle-to-infrastructure (V2I) technologies, and connected autonomous vehicles (CAVs), several cooperative merging strategies among CAVs have been proposed, e.g., in [10], [11]. Cooperative merging has the potential in providing faster responses between vehicles, thus improving highway capacity by identifying appropriate target speed, adjusting current speed in case of unexpected events, reducing gaps between vehicles, etc., via a continuous exchange of information [12].
The methods to generate the merging sequence scheduling can be categorized into two approaches: rule-based methods (e.g., [13], [14]), and optimization-based methods (e.g., [5], [13], [15]). Moreover, implementations of the scheduling can be done and controlled centrally by a physical or a digital infrastructure (i.e., centralized control approach), or locally in each vehicle (i.e., distributed control approach).
One of the most common rule-based methods is based on the FIFO (first in first out) principle, i.e., the merging sequence is determined by the time-till-arrival to the merging zone [11]. In [16], the authors propose a merging sequence scheduling scheme, which maximizes average speed of autonomous vehicles. Another approach is the "local gap-optimal" rule, where vehicles on the highway generate gaps for the merging vehicles, [17]. A variant of this method is the cooperative merging path generation method based on Model Predictive Control (MPC) (e.g., in [14]), in which vehicles on the highway smoothly adjust their speed to allow the merging process of the entering vehicles. However, merging sequence scheduling and determining the optimal vehicles speeds are not the only choices to allow for safe merging manoeuvres. In [13], the authors proposed a dynamic rule-based algorithm that aims to achieve a nearoptimal merging car sequence with a low computational cost. However, with high traffic flow the system can hardly gain any benefit from the coordination method. Another choice is to encourage early lane-changes on the main road, in order to create more space for the merging vehicles. In [18], the authors showed that encouraging early lane-changes on the main road improves average speeds and travel time efficiency, however the impact on the number and the severity of the conflicts are not analyzed.
Many of the cooperative merging strategies often neglect other surrounding vehicles, and tend to focus only on the vehicles that are involved in the merging manoeuvre. Moreover, they typically assume that all involved vehicles are CAVs, which is not the case in the near future. Mixed traffic situations (i.e., traffic situations involving mixtures of CAVs, non-connected AVs, and manually-driven vehicles (MVs)) are expected to remain for a long time. Such mixed traffic situations can be expected to have an impact on traffic behavior including merging manoeuvres, as analyzed in [19]. Therefore, recent studies have started to consider merging strategies for mixed traffic situations (e.g., [20]- [22]).
Strategies related to cooperative control by means of ramp metering are discussed in [20], where the state-of-the-art is reviewed and challenges are identified. In [21], a cooperative merging control algorithm, for triplet combinations of CAVs-MVs, is proposed based on an MPC approach. The algorithm controls acceleration in three merging phases, where conditions and transition between phases are defined for each of the possible triplet combinations of CAVs and MVs. Their simulation results suggested a smooth merging manoeuvre, which also satisfy safety and comfort constraints. Furthermore, a cooperative decision-making for mixed traffic mechanism is introduced in [22], where a deterministic control strategies optimizing system merging cost are employed based on 13 pre-defined conditions at the merging section.
The results suggested a smoother ramp-merging, and the section throughput can increase up to 18% when all vehicles are CAVs.
Despite consideration of mixed traffic situations, proposed CAVs strategies still commonly assume a one-lane main road and a one-lane merging road in their studies (e.g., [23]). In [24], a multi-lane cooperative control method minimizing the travel time of vehicles passing through the merging zone is proposed. The authors show that the method can decrease the number of stops by more than 50% and reduce the delay time by about 70%, under certain traffic conditions. From the safery perspective, safety aspects of the merging situations are rarely evaluated, except ensuring collision-free manoeuvres.
From the content of the strategies, the cooperative merging strategies (both lane merging and on-ramp merging) proposed by most of the previous work often ask the vehicles involved to accelerate or decelerate or ask the merging vehicle to wait until it is safe to merge. We are only aware of a few papers (e.g., [25] and their previous work) that explicitly took into account the possibility of asking the vehicle on the destination lane to change lane as part of the cooperative merging strategies. Note that the merging targeted in [25] and their previous work was the lane merging into an adjacent lane on the same road, not on-ramp merging.
Hence, challenges related to on-ramp merging based on the current state-of-the-art, as also mentioned in [21], [22], include: evaluation of strategies in a continuous mixed-traffic flow, handling uncertainty in the mixed traffic, and considering multiple lane on the main road (which introduce possibilities for extra lane-changing manoeuvres).
The goal of this article is to study a suitable strategy for cooperation between CAVs in a mixed traffic (both connected and non-connected AVs mixed with MVs) on realistic on-ramp merging scenarios, with the main purpose of reducing the risk during the merging manoeuvre. In this work, risk reduction is obtained as the achievement of the minimum space gap between the two vehicles during the merging manoeuvre. The function space gap is optimized and it is calculated under spatial constraints, i.e., the two vehicles must have reached the merging point, and constraints on accelerations, as we shall see in Section III. Specifically, we introduce and implement a novel cooperative merging strategy acting on CAVs in Simulation of Urban Mobility (SUMO) [26].
Our approach is a variant of the "local gap-optimal" rule by allowing the vehicle on the on-ramp to accelerate or decelerate according to the strategy chosen together with the vehicle on the highway, to dynamically adjust the strategy during the cooperation period (i.e., to agree on the chosen strategy and to agree on the target speeds/accelerations to use) and to change lanes if that is strategically convenient. The proposed strategy allows a dynamic interaction with the surrounding mixed traffic environment, and not only limited to the CAVs involved in the manoeuvre, and thus choice of strategy is adapted to the traffic situations, e.g., if a surrounding non-connected vehicle prevents the success of the initially agreed strategy, the strategy would reduce the change of speed by the vehicle on the main road by splitting the change of speed between the two vehicles, and to guarantee greater flexibility in case of unforeseen events such as cut-ins by other non-connected vehicles.
We then simulate the daily traffic flow variation in a 2 km highway with an on-ramp merging lane in the city of Gothenburg. We run simulations with different percentages of CAVs, AVs, and MVs, which we further divided into manually-driven cars (MCs), and manually-driven trucks (MTs). To evaluate the safety during the merging of two or more vehicles on the main road, we implement, compute, and analyse the cut-in risk indicator (CRI) proposed in [27].
Our contributions can be summarized as follows: • We propose a novel cooperative strategy for on-ramps merging. The strategy may involve adjusting speed as well as lane changing. • We demonstrate and evaluate the strategy in a continuous mixed traffic flow simulation based on real traffic flow; the simulated environment includes a multi-lane main road and an on-ramp and the vehicles are a mixture of CAVs, non-connected AVs, MCs, and MTs. • We conduct safety evaluation of merging two or more vehicles using the original and modified CRI. The paper's outline is as follows: in Section II, we describe the simulation setting. In Section III, we present and analyse the proposed cooperation strategy between CAVs. Here, we focus and compare simulation results with and without the cooperative strategy (different percolation percentages of CAVs and AVs). In Section IV, we recall the definition of CRI proposed in [27] and compare the results for the simulations with and without the cooperation strategy. Finally, the conclusions, limitations, and future work based on the main observations from this analysis are outlined in Section V.

II. DESCRIPTION OF THE SIMULATION SETTING
A road section used in the DriveMe project in Gothenburg, consisting of a 2-km long 3-lane main road and a 300-m long on-ramp leading to the main road, was reproduced in SUMO. The maximum speed allowed on the ramp is 80 km/h, while the maximum speed on the main road is 90 km/h. Once the ramp enters the main road there is a 200-m long acceleration lane.
A real traffic flow variation is used to model the traffic flow in our simulation. The traffic flow variation data between the 8th and 9th of April 2019 (24 hours) is taken from an open database published by Swedish Transport Administration (Trafikverket) [28].
In order to represent the behavior of MCs and MTs as close as possible to the real traffic, we select the values of the parameters for LC2013 lane-changing model (default SUMO model) and Krauss car-following as presented in [29] and [30]; these parameters were calibrated based on the traffic behavior observed in Gothenburg. Please note that we only consider light trucks as MTs in our simulation, since this truck type is most common on the route considered. The author of [30] stated that on the DriveMe Route in Gothenburg (in 2019) the population of light trucks is 3 times the population of trucks with trailer and 8 times the population of semitrailer trucks in the slow lane, while in the middle and fast lanes the proportion of light trucks increases further compared to trucks with trailer and semitrailer.
In addition, we modify the real traffic by replacing different percentages of MCs with AVs (or CAVs), from 20% to 100% with step of 10%. During the simulation, vehicles are taken from one of two classes (AVs or MCs) according to a Bernoulli distribution, where the probability of the event "vehicle x belongs to class AV" (or MV) is given by the fraction % of AVs 33048 . This means that if, for example, we aim to simulate 80% AVs, the single sample will have probability of being an AV with mean 0.8 and variance equal to 0.8 × 0.2 = 0.16. However, the more samples we extract, the smaller the variance (scale with the number of samples). So by extracting 33048 samples the mean remains unchanged while variance becomes 0.0000048.
We used Krauss car-following model and LC2013 lanechanging model to model AVs, considering the parameters for AVs proposed in [29]. These parameters are also further analyzed in an ideal traffic scenario in [31]. From here on, unless otherwise specified, the values of the parameters for MVs and AVs (including CAVs) in the simulations are those given in Table 1. The first eight parameters in the Table 1 (i.e., up to speedFactor) are used in the carfollowing model: apparentDecel is the value used as the expected maximum deceleration of the lead vehicle, sigma is the car-following driver imperfection, tau is the driver's desired minimum time headway. The parameters starting with "lc" in the Table 1 (i.e., from lcStrategic to the end) are used in the lane-changing model: lcStrategic is the driver's eagerness to perform strategic lane changing, lcCooperative is the willingness for performing cooperative lane changing, lcSpeedGain and lcKeepRight are the eagerness for performing lane changing to gain speed and for following the obligation to keep right, respectively. For more details see [32].
The initial speed of the vehicles are taken according to the real data from Trafikverket [28], i.e., about 70 km/h for the on-ramp and about 100 km/h for the main road. Although the speed limit on the main road is 90km/h, vehicles do not always comply with the speed limit; this is represented using the speedFactor parameter (in Table 1), which represents a factor by which the vehicle multiplies the road speed limit and the result is used as the maximum desired speed in the simulation for that vehicle type. We also observe that AVs and CAVs are described by the same parameters, so when the cooperation strategy does not influence the models, the two types of vehicles will have the same driving style.

III. STRATEGY FOR COOPERATION
Two loop devices are used in the simulation, one is positioned on the main road and the other on the on-ramp. The two loop devices represent the beginning of the control zone of each road (main road and on-ramp) inside of which the vehicles can communicate with each other, [33]. While the beginning of the control zone is fixed, the end of the control zone is variable, i.e., vehicles stop communicating once merging has taken place.
When two CAVs pass through the loop devices (in a t w -second time window), then if possible the vehicle on the main road moves to the middle lane, otherwise two possible initial accelerations (a − 0 , i.e., the possible acceleration of vehicle on the on ramp, and a + 0 , i.e., the possible acceleration of the vehicle on the main road) and decelerations (−a − 0 , i.e., the possible deceleration of vehicle on the main road, and −a + 0 , i.e., the possible deceleration of the vehicle on the on ramp) are calculated in order to allow a safe entry of the vehicle onto the main road, and the lowest acceleration (and highest deceleration) is chosen. In this way, the strategy is also chosen, i.e., which of the two vehicles should pass through the merging section first, and which should come second.
Once the strategy has been agreed between the two vehicles, it may change dynamically, i.e., the initial accelerations (a − i and a + i ) and decelerations (−a − i and −a + i ) are then dynamically modified in a − i (or a + i ) and −a − i (or −a + i ), through an exchange of information between the two vehicles involved until the end of the merging manoeuvre.
We divide strategy changes into two categories: substantial and marginal changes. Marginal changes are those that lead to slight changes in acceleration/deceleration during the manoeuvre, and are due to small noises in traffic and vehicle conditions, such as road surface and tyres condition, noise in sensors, slight delay in information exchange, too large accelerations to be achieved. Marginal changes occurs when Causes that may lead to a substantial change in strategy (i.e., the vehicle that was initially to accelerate, and therefore had to pass first in the merging section, becomes the one that has to decelerate and therefore pass second in the merging section) are those due to important interactions with other vehicles, i.e., when the vehicle that has to accelerate is unable to do so because its leader is too slow, or when the vehicle that has to decelerate is overtaken, and therefore there is no longer enough space left for the vehicle that has to accelerate to enter safely. Substantial changes occurs when In the simulations, we will only consider marginal changes due to accelerations/decelerations that are too wide to be reached, while substantial changes, i.e., those due to interactions with other vehicles, be they MTs, AVs or MCs, will all be allowed and simulated.
As a criterion for a safe entry we used the minimum needed space gap between the vehicle on the main road and the vehicle on the on-ramp during the merging, d f in Fig. 1. The strategy of cooperation between vehicles is achieved by solving a dynamic optimization problem, where the function to be optimized is the space gap between the two vehicles, i.e., x OR (t) are the positions of the vehicles on the main road and on the on ramp at time t, respectively) and it is subject to space constraints (the two vehicles must first reach the intersection), i.e., x M (t f ) > x int and x OR (t f ) > x int (where x int and t f are the intersection point and the time at the optimum) and constraints on the acceleration which we explain in detail below. Once the two vehicles have reached the minimum needed space gap, then the merging manoeuvre can begin. Note that the start of the merging can take place along the entire length of the acceleration lane. The scheme of the strategy is illustrated in Box 1.
Let us describe the strategy in detail. Let d M 0 (and d OR 0 ) be the distances between the vehicle on the main road (and on the on-ramp) position at time step 0, i.e., when it passes through the loop on the main road (and on the on-ramp), and the junction intersection, Fig. 1.
In our simulations d M 0 = 180m and d OR 0 = 150m, in accordance with the average speeds, and therefore average travel times, of the two road segments. In fact, the vehicles take 7 seconds on average to travel 150m on the on-ramp and 180m on the main road. d f is the minimum needed space gap between the two vehicles before the merging manoeuvre begins, i.e., the minimum space gap required after both the two vehicles passes the junction. On a road with a speed limit of 25m/s (90km/h) it is reasonable to require a minimum needed space gap of 35 − 40m, which is equivalent to a time headway of about 1.5s. In fact, [34] showed that the highest frequency of time gap in Gothenburg's roads is within the range of (1, 1.5]s. The time window t w has been set as the maximum between half of the average time needed by the vehicle on the main road to reach the junction intersection when it passes through the loop, half of the average time needed by the vehicle on the on ramp to reach the junction intersection when it passes through the loop, and the time headway, that is t w = max( 180m 30m/s /2, 150m 23.3m/s /2, 1.5s) ∼ 3s. Therefore, if a vehicle passes through a loop at time 0s, at time 3s, when the second vehicle passes, it will have already covered half the distance and without having to modify, or modifying very little, its speed it will be able to reach the junction intersection.
From the following two systems of equations we can easily calculate two required accelerations to get the expected minimum needed space gap d f when both of the vehicles pass the junction: one acceleration is to get the vehicle on the main road as the leader at the end of the strategy manoeuvre (and the vehicle on the on-ramp as its follower) and the other one is for the vehicle on the on-ramp to become the leader (and the vehicle on the main road as its follower): The lower of the two accelerations will be taken by the system as the strategy. In the system of equations presented here, we have assumed that the acceleration and deceleration of the two vehicles are equal in magnitude, but there is nothing to prevent us from setting any other relationship between the two, e.g., deceleration k times acceleration, k > 1. It may be useful to introduce the k parameter on roads that are subject to variations in average speeds, such as on easily congested roads, to assist the flow of vehicles. Also, this parameter may vary as the state of the roads changes. Hence, by solving the system, we get the time that the vehicles take to get the safe space gap as and the acceleration as when the vehicle on the main road has to accelerate, or continue; end recalculate the best acceleration by exchanging information about each other's speed and position. The time interval between one time step and another represents the time between information exchanges between the two vehicles. In this way, if one of the two vehicles is hindered on the way by another vehicle, it is possible to recalculate the strategy and time required. The preuso-code of the algorithm is shown in Algorithm 1.
An example is shown in Fig. 2(a). Except those that are subject to the strategies, manual vehicles are shown in red and autonomous vehicles are shown in white. The vehicles involved in the cooperation strategy are colored in orange and blue: accelerating vehicle is colored blue and the decelerating vehicle is colored in orange. In the example in the figure one can see that the vehicle on the main road cannot change lane because the left side of the current lane is busy, so it is forced to slow down, while the vehicle coming from the on-ramp is accelerating.  Fig. 3 shows that during most of the daily hours (except 6:00-8:59 a.m.), the majority of the vehicles on the main road could change lanes to allow the on-ramp vehicle to do a smooth merging into the main road. This is true for all of the percentages of autonomous vehicles considered. On the contrary, in the morning rush hours, i.e., flow greater than 1 veh/s/road or 0.33veh/s/lane (6-9 a.m., see Fig. 4), most of the vehicles on the main road cannot change lanes and the vehicle's speed on the main road is on average lower than the vehicle's speed on the on-ramp, so it is preferable to decelerate the vehicle on the main road and leave space in front of it.
In order to obtain reliable and comparable statistics in simulations with different percentages of autonomous vehicles, the number of times a day is simulated is inversely proportional to n 2 , where n is the percentage of autonomous vehicles considered. In fact, at 100% AV simulations, the probability that the two vehicles passing simultaneously through the two loop devices (one at the main road and another at the on-ramp) are autonomous is 1, while at 50% AV the probability is (1/2)(1/2) = 1/4, and thus the number of times the day is simulated is 4 times the number of simulation done for 100% AV.
For each simulation we generate a sample of about 20000 data points, i.e., 20000 times that two vehicles (one on the main road and one on the on-ramp) simultaneously passing the two loop devices (one on the main road and one on the on-ramp). A one-day simulation with 100%AV generates about 640 data, so we need 32 days of 100%AV simulations, 124 days of 50%AV simulations, 352 days of 30%AV simulations, and so on. In the simulations conducted the time interval is 0.2s, i.e., every 0.2 seconds there is an exchange of information between the two vehicles and a consequent update of the strategy.

IV. INVESTIGATION ON THE CUT-IN RISK INDICATOR
In order to compare the results obtained with and without the cooperation strategy, we have analyzed the cut-in risk indicator (CRI) proposed in [27]. The CRI measures the risk of cut-in manoeuvres as a value between 0 and 2, where 0 means the lowest collision risk and the value 1 or above   indicates higher risk of collision, and is defined as follows where CRI F and CRI L are the collision risk to the following and lead vehicles (F and L vehicles in Fig. 2(b)) on the adjacent lanes, respectively. CRI F and CRI L are defined in [27] as s i,j is the space gap between the vehicles i and j, and v i is the speed of the vehicle i. In Tables 2 and 3 we compared, for different percentages of CAVs, the mean and standard deviation of CRI values of any two CAVs that have passed through the two loops, in case the strategy is active (the first two columns) and in case the strategy is not active (the last two columns), during the whole day and the rush hours, respectively. The strategy on average lowers the mean CAVs' CRI values by 35% (i.e., the strategy on average reduces the risk of collisions because of cut-in manoeuvres by 35% among CAVs) both during the whole day and during the rush hours, and lowers the total CRI values (i.e., calculating the CRIs also of non-connected vehicles) more than 20% during the whole day and more than 24% during the rush hours. In addition, the average CRI value of CAVs appears to be independent of the composition of the simulations, although the higher the percentage of AVs, the greater the probability to observe two AVs interact with each other at the merging point (from 0.04 for 20% AVs simulations, to 1 for 100% AVs simulations). In contrast, the total average CRI value reduction with the active strategy is 18% for simulations with 20%-30% AVs, and 35% for simulations with 100% AVs.
Together with the originally defined CRI, we also calculated a modified CRI without the TTC, i.e., taking into account only the relative distance between vehicles. This modification is proposed here in order to evaluate the risk of the manoeuvre even in the presence of the leader's speed greater than the follower's speed, for which the original CRI is equal to 0. Table 4 shows the results when the strategy is active and inactive. We note that, contrary to the original CRI, the average values of the modified CRI are higher when the strategy is active, and therefore the manoeuvres are evaluated as riskier on average. This result is due to the fact that the active strategy increases the distance between the two CAVs considered, thus reducing the relative distance between the vehicle on the on-ramp and the third vehicle considered. For this reason, the modified CRI is not a good indicator in our case. However, it could be a good indicator when comparing very similar traffic flows, such as in the unstable flow condition where relative distance has a significant impact on overall traffic.
A further observation concerns the set of values assumed by the CRI: even if the values of the CRI can be distributed from a minimum of 0 to a maximum of 2, we have observed that most of the values are included in the interval [0,1] and only a small part exceeds the value 1, but these values are close to 1 (Fig. 5 and Fig. 6). This aspect is justified by the fact that it is highly improbable that both the following vehicle (F vehicle on Fig. 2(b)) is much faster than the entering vehicle (E vehicle in Fig. 2(b)), and the entering vehicle is much faster than the lead vehicle (L vehicle in Fig. 2(b)).
From Fig. 5, we also notice that the normalized histogram of CRI values is highly right-skewed, meaning that while the bulk of the distribution occurs for fairly small sizes -most cut-in manoeuvres are low risk -there is a small number of cut-in manoeuvres with risk much higher than the typical value, producing the long tail to the right of the histogram.
The shape of the normalized histogram suggest that the probability distribution of CRI could be a power law, and therefore mean and standard deviation may not be good indicators for an in-depth comparison of CRI values in the various scenarios, [35]. In fact, considering only the average and the standard deviation of CRI value is not enough, especially if the distribution of values is not symmetric, or if the parameter values are such that the mean and standard deviation are not well defined (e.g., if the shape parameter of the power law is less than 3, then the standard deviation is not well defined), [35]. An analysis of the distributions allows us to understand on which values of the CRI the strategy and the different penetration rates of AVs act on (i.e., to find out to what degree the strategy and the different penetration rates of AVs influence the collision risk due to cut-in manoeuvres).
As a first step we will show which functions best represent the distributions of CRI values. Once we have identified the functions and parameters describing the different scenarios we will give an interpretation, i.e., the meaning they represent in terms of cut-in risk characteristics.
In order to check whether the function characterising the probability distributions of CAVs' CRIs, with and without strategy, is a power law, we first compare the log-log plot with linear functions, [36]. We find that the data can be fitted quite well by linear functions, as shown in Fig. 5, and therefore we can assume that they are power-law probability distributions, i.e., distribution whose density functions have the following form where γ and b are the shape and the normalizing parameters, or more general distributions, like beta distributions. However, it is shown in [37] that the parameter estimations using direct linear fit of the log-log plot of the full raw histogram of the data or linear fitting to logarithmically binned histograms, is biased and inaccurate, while the maximum likelihood estimator produces more accurate and robust estimates. From a variety of starting points for the γ parameter, from 0.05 to 2, we then take the estimate with R 2 values of the linear regression fitting the QQ-plot (or quantile-quantile plot, [36]) for the power law distribution closest to 1. In Table 5 we have collected the shape parameter γ obtained using maximum likelihood estimation for power law fitting in Python (SciPy library) obtained with the optimum starting point (Fig. 5). The results shown in Table 5 refer to the distributions of the data for the whole day and from 7:00 to 7:59 a.m., i.e., the time when the flow is the highest, both with and without the strategy. We note that the shape parameter is higher when the strategy is active, for all percentages of AVs, and is higher with the full day data than with the 7:00-7:59 a.m. time interval data. In particular, if we look at the full day data we have a mean of 0.9295 and standard deviation of 0.0043 when the strategy is active versus a mean of 0.8835 and standard deviation of 0.0084 when the strategy is inactive. In practice, the γ parameter is increased more than 5% on the whole day data when we activate the strategy, while it increases by almost 10% on the 7:00-7:59 a.m. time interval data. A higher shape parameter indicates a higher number of CRI values around zero, and therefore a lower risk during the merging manoeuvre. This means that the strategy proposed reduces risk of collision or improves safety during merging manoeuvres, not only throughout the day, but also during high flow hours.
However, while the fit of the data without the strategy works well, for the data with strategy we can note a slight  U-shape in the probability density function (PDF), Fig. 6, typical of the beta distribution, [38]. This U-shape means that, as in the power law, most manoeuvres are low risk and there are a small number of manoeuvres that are riskier than the typical value, but unlike the power law the really very risky manoeuvres are more likely to occur. Therefore, after determining the parameters of the beta distribution for the data (by using the maximum likelihood estimator from a variety of starting points of α and β, α ∈ [0, 0.2] and β ∈ [0, 1]), we evaluate through a QQ-plot which of the two distributions best characterises our data, i.e., whether very risky manoeuvres are really more likely than risky ones, or not.
In Table 6 we collected the values of α and β parameters characterising the beta distribution obtained from fitting the data, where the density function of the beta distribution have the following form where α and β are the shape parameters and (·) the gamma function. We notice that if β is equal to one we get the power law distribution with γ = 1 − α. In Tables 7 and 8 we collected the slope and R 2 values of the linear regression fitting the QQ-plot for the beta distribution (2nd and 3rd columns) and the power law distribution (4th and 5th columns), for the data covering the whole day and for only 7:00-7:59 am, respectively. If the data and the distribution being compared are similar, the points in the QQ-plot will approximately lie on the line y = x, and so the slope is close to 1. The R 2 is the coefficient of determination, i.e., 1 minus the sum of squares of the residuals over the total sum of squares. The  better the linear regression fits the data, the closer the value of R 2 is to 1. Fig. 7 shows the QQ-plots of the beta distribution and the power law distribution, for some percentages of AV. We note that when the strategy is active the distribution that best approximates the data is the beta distribution: both the slope and the R 2 are closer to 1 in the beta distribution than in the power law distribution. We can therefore conclude that CRI values are distributed following a power law distribution in the absence of the strategy, and a beta distribution when the strategy is active. Since the beta distribution is a generalization of the power law, we can easily compare the two distributions, and in particular the respective cumulative distribution functions. From  Top: the CDFs when the strategy is active (left) and inactive (right). Bottom: the percentage of CDF reduction when the strategy is activated. Table 2 and Table 3 we know that with the active strategy the average value of the CRI decreases by about 30%. Now we ask what happens for high values of the CRI, e.g., when the CRI is greater than a δ value in the two cases. Fig. 8 and   9 show the matrix plot of the cumulative distribution functions (CDFs) of CAV' CRI values when the strategy is active (left) and inactive (right), and the percentage of CDF reduction when the strategy is active compared to when it is not active (bottom), of the whole day and of the 7:00-7:59 data, respectively. We note that the values of the CDF in the case with active strategy are much lower than in the case without strategy (indicated by lighter colors in the top left figure and darker colors in the top right figure of Fig. 8 and Fig. 9), with an average reduction of more than 25% on the whole day CAV data and more than 32% on the 7:00-7:59 CAV data. Furthermore, three trends stand out on the whole day data: the CDFs of P(X > 0.5) and P(X > 0.6) have an average reduction of 26.5%, those of P(X > 0.7), P(X > 0.8) and P(X > 0.9) of 17% and for P(X > 1) the reduction is 47%. So although the reduction is present for all CRI's values, we already have most of the reduction for CRI's values around 0.5 and 0.6 and for CRI's values above 1. Whereas, on the 7:00-7:59 a.m. data, we have an average reduction of almost 37% of the P(X > 0.5) that gradually decreases to 27% of the P(X > 0.9). In this case we did not calculate the reduction in P(X > 1) because the event was rare and not enough statistics were produced. In both cases, considering the entire day or the rush hour from 7:00 to 7:59 a.m., the mixed traffic conditions on which the strategy has the greatest impact are those with 30% and 40% of AVs, where the CRI's values are reduced about 45-50% at 7:00-7:59 a.m. and 30-35% over the entire day. Fig. 10 shows the matrix plot of the cumulative distribution functions (CDFs) of total CRI values when the strategy is active (left) and inactive (right), of the whole day (top) and of the 7:00-7:59 data (bottom). Also here we notice a reduction in the probability of having CRI greater than 0.5 when the strategy is active. The average reduction of having whole day total CRI greater than 0.5 is 14%, where for 100% AV it is 30%. Increasing the threshold decreases the average Fig. 11. Matrix plots of the percentage of CDF reduction when the strategy is activated for the whole day total CRI data (left) and 7:00-7:59 total CRI data (right). reduction in whole day total CRI from 10% for a threshold of 0.6 to 0.5% for a threshold of 0.9, Fig. 11.
We also observe that the higher the CRI during merging interactions (when the strategy is deactivated), the greater the margin on which one can act to reduce it by activating it. This is typically the case when percolation rates of AVs are low and during rush hours. On the other hand, during rush hours vehicles are typically closer to each other and with less margin to negotiate. Therefore, although starting from a more improvable condition, it is not always possible to improve it due to the surrounding conditions.
In conclusion, although the greatest reduction in CRI occurs for high percentages of AV, the impact of the strategy shows a reduction in CRI even for low percentages of CAVs, both in rush hours and in whole day traffic.

V. CONCLUSION AND FUTURE WORKS
In this work, we implemented a novel rule-based cooperative strategy during the merging manoeuvre between CAVs. We tested the new strategy in SUMO. The proposed strategy includes not only decisions on the target speeds/accelerations of both vehicles, but also lane changing, and a dynamic decision-making approach that takes into account the mixed traffic surrounding (e.g., potential of cut-in by non-CAV). To test the strategy we simulated 24-hour long scenarios, using the real variation of daily traffic flow in the city of Gothenburg and for different percentages of AVs.
By means of the Cut-In Risk Indicator, CRI, we evaluated the impact of the strategy on safety (i.e., reducing collision risk) during merging manoeuvres, obtaining an average of 35% reduction of collision risks compared to without active strategy.
Moreover, we identified the magnitude, or riskiness, of the values on which the strategy has the greatest effect: through the study of the probability density function it was possible to identify which values of the cut-in risk undergo a greater reduction or the opposite, which then can be used to identify possible improvements to the strategy. In this regard, the values that were least reduced are those close to 1, i.e., those that are most risky and in which very often a third vehicle is also involved. A possible improvement of the strategy could be to involve a third vehicle in the cooperation, making it slows down/accelerates, or changes lane according to the choices of the two vehicles currently involved in the cooperation, in order to have even more flexibility. In addition, to analyze the risk during merging manoeuvres we have analyzed the original CRI and a modified CRI that does not depend on the TTC, however it would be interesting to conduct analysis of other variations on the CRI, for example replacing the TTC with the Modified TTC (MTTC, [39]).
As a final remark we point out that even if in this work we assume perfect communication and no message exchange between vehicles, nevertheless if our strategy were implemented in reality, it would be possible to do so with wireless communication interfaces (for example using satellite communications, 4G/5G cellular interfaces, or an embedded infrastructure) and current protocols, i.e., all information necessary for our strategy is already defined in the standard Cooperative Awareness Message (CAM) [40], [41].