Context-dependent reconfiguration of autonomous vehicles in mixed traffic José Miguel Horcas 1 Julien Monteil 2 Mélanie Bouroche 2 Mónica Pinto 1 Lidia Fuentes 1 Siobhán Clarke 2 1 CAOSD Group, Universidad de Málaga, Andalucía Tech, Spain 2 Distributed Systems Group, School of Computer Science and Statistics, Trinity College Dublin, Ireland Correspondence José Miguel Horcas, Bulevar Louis Pasteur, 35. ETSII Lab. 3.3.3, Campus de Teatinos, Malaga 29071, Spain. Email: horcas@lcc.uma.es Funding information Magic, Grant/Award Number: P12-TIC1814; HADAS, Grant/Award Number: TIN2015-64841-R Abstract Human drivers naturally adapt their behaviour depending on the traffic conditions, such as the current weather and road type. Autonomous vehicles need to do the same, in a way that is both safe and efficient in traffic composed of both conventional and autonomous vehicles. In this paper, we demonstrate the applicability of a reconfigurable vehicle controller agent for autonomous vehicles that adapts the parameters of a used car-following model at runtime, so as to maintain a high degree of traffic quality (efficiency and safety) under different weather conditions. We fol- low a dynamic software product line approach to model the variability of the car-following model parameters, context changes and traffic quality, and generate specific configurations for each particular context. Under realistic conditions, autonomous vehicles have only a very local knowl- edge of other vehicles' variables. We investigate a distributed model predictive controller agent for autonomous vehicles to estimate their behavioural parameters at runtime, based on their available knowledge of the system. We show that autonomous vehicles with the proposed recon- figurable controller agent lead to behaviour similar to that achieved by human drivers, depending on the context. KEYWORDS autonomous vehicles, car-following model, dynamic software product line, reconfiguration, traffic quality 1 INTRODUCTION Drivers' behaviour often changes during a journey because of several environmental factors such as the typology of the roads (motorways, high speed roads, arterials, and local streets), the type of road surface (asphalt, concrete, and gravel roads), and weather conditions (dry, rain, and snow). A human driver takes into account all these factors and adapts his or her driving style accordingly. 1 In mixed-traffic environments, ie, where autonomous vehicles share the roads with conventional vehicles, autonomous vehicles should also adapt to these contextual changes but without deteriorating traffic safety and efficiency, as autonomous vehicles' behaviours that are overly different to human driven vehicles might lead to hazardous and chaotic situations. 2 The behaviour of an autonomous vehicle will be altered at runtime by modifying/reconfiguring the parameters of the car-following model (eg, desired speed, desired time headway, acceleration, and brak- ing) or even by changing the model itself (eg, the car-following model or the lane-changing protocol). For instance, lane-changing handlers in charge of controlling vehicles on motorways mostly rely on minimising decelerations (eg, the MOBIL model 3 ), whereas a lane-changing handler in urban traffic relies on the allocation of vehicles' neighbours and the management of conflict areas (eg, the Vertigo model 4 ). In any situation, the dynamic selection of the most appropriate set of model and parameters must help to increase traffic-flow safety and efficiency. However, the literature has just started to investigate the applicability of various car-following models under varying environmental contexts such as adverse weather conditions. 5,6 Driving scenarios (eg, highways, intersections, and roundabouts for dry roads) are usually studied separately, and as a result, emerging control systems do not consider contextual changes of scenarios, while real-world driving involves mixing different scenarios on the same route. Moreover, the parameters values for an autonomous vehicle controller are specific to each context and need to be taken into account at runtime: If no behavioural change is introduced, the sudden appearance of adverse weather conditions will cause autonomous vehicles to have unsafe time headways, and the sudden improvement of weather conditions will cause autonomous vehicles to be overly cautious, having a detrimental effect on