Adaptive monitoring for autonomous vehicles using the HAFLoop architecture
Abstract
Current Self-Adaptive Systems (SASs) such as Autonomous Vehicles (AVs) are systems able to deal with highly complex contexts. However, due to the use of static feedback loops they are not able to respond to unanticipated situations such as sensor faults. Previously, we have proposed HAFLoop (Highly Adaptive Feedback control Loop), an architecture for adaptive loops in SASs. In this paper, we incorporate HAFLoop into an AV solution that leverages machine learning techniques to determine the best monitoring strategy at runtime. We have evaluated our solution using real vehicles. Evaluation results are promising and demonstrate the great potential of our proposal.
Full text
Adaptive Monitoring for Autonomous Vehicles using the HAFLoop Architecture Edith ZavalaƗ*, Xavier FranchƗ, Jordi Marco±, Christian BergerŦ {zavala, franch}@essi.upc.edu, [email protected], [email protected] ƗServices and Information Systems Engineering Department, Universitat Politècnica de Catalunya, Barcelona, Spain ±Computer Science Department, Universitat Politècnica de Catalunya, Barcelona, Spain ŦComputer Science and Engineering Department, University of Gothenburg, Gothenburg, Sweden *Corresponding author Service and Information System Engineering Department, Polytechnic University of Catalonia, Jordi Girona 1-3, 08030, Barcelona, Spain [email protected] Word count: 7,001 This is an Accepted Manuscript of an article published by Taylor & Francis Group in Enterprise Information Systems on 11 Nov 2020, available online at: http://www.tandfonline.com/10.1080/17517575.2020.1844305
Adaptive Monitoring for Autonomous Vehicles using the HAFLoop Architecture Current Self-Adaptive Systems (SASs) such as Autonomous Vehicles (AVs) are systems able to deal with highly complex contexts. However, due to the use of static feedback loops they are not able to respond to unanticipated situations such as sensor faults. Previously, we have proposed HAFLoop (Highly Adaptive Feedback control Loop), an architecture for adaptive loops in SASs. In this paper, we incorporate HAFLoop into an AV solution which leverages machine learning techniques to determine the best monitoring strategy at runtime. We have evaluated our solution using real vehicles; results are promising and demonstrate the great potential of our proposal. Keywords: self-adaptive systems; self-improvement capabilities; adaptive monitoring; autonomous vehicles; smart vehicles; machine learning Introduction Over the last decades, self-adaptive systems (SASs) have been subject of great research efforts in both industry and academic communities given their applicability in modern domains such as smart cities, mobile apps and autonomous vehicles (AVs) (B. H. C. Cheng et al. 2009; De Lemos et al. 2013; Weyns 2017; Krupitzer et al. 2015). SAS’s adaptation is supported by the self-* capabilities: self-configuration, self-optimisation, self-healing and self-protection (IBM- Corporation 2006). Feedback control loops like the IBM’s MAPE-K loop (see Fig. 1) (IBM- Corporation 2006; Kephart and Chess 2003) are typically adopted for supporting SASs’ self-* capabilities. In MAPE-K, the self-* capabilities are managed by five elements: Monitor, Analyse, Plan, Execute and Knowledge base. The Monitor gathers runtime data from the managed software system and its environment by means of Sensors. The collected data is then analysed by the Analyse element and, if needed (e.g. analysis results show a violation of the requirements), a system adaptation scheduled by the Plan element. Finally, the adaptation is enacted by the
Execute element using Effectors. In order to operate properly, a Knowledge base containing data such as measurements, logs, adaptation policies, etc. is shared. System models, static adaptation rules and objective functions are well-established concepts used by existing MAPE-K loops in order to manage the adaptation process of SASs (Lalanda, McCann, and Diaconescu 2013; Zavala, Franch, and Marco 2019). Adaption rules are typically of the form if…then. For instance, in the AV domain, examples of adaptation rules can be: if it is raining then reduce speed, if traffic is slow then adjust route to destination. In systems with highly dynamic environments such AVs, the traditional design of static feedback loops can lead to incompleteness or obsolescence of systems’ models and adaptation rules, as well as nonoptimal objective functions, particularly when runtime uncertainty is experienced (Krupitzer et al. 2017). Runtime uncertainty is one of the main factors challenging modern SASs (Zavala et al. 2018; Knauss et al. 2016; Mallozzi et al. 2019). One of the approaches for addressing this issue is to enable the adaptation of SASs’ feedback loops. In this way, for instance, adaptation rules could be updated at runtime in order to better fit context, or system and user changing requirements. Krupitzer et al. (Krupitzer et al. 2016) have defined this process as selfimprovement . Concretely, as defined by Krupitzer et al. (Krupitzer et al. 2016): Self-improvement of the adaptation logic (the MAPE-K loop elements) is the adjustment of the adaptation logic to handle former unknown circumstances or changes in the environment or the managed resources (the managed element) [Figure 1 near here] In a previous work, we have proposed a generic and reusable architecture, called HAFLoop (Highly Adaptive Feedback control Loop) (Zavala et al. 2020), for supporting the self-improvement capability of SASs. In this work, we instantiate such architecture for enabling adaptive monitoring in AVs, i.e., enabling the adaptation of the Monitor element of the MAPE-K
loop. The Monitor is a crucial element since the quality of the monitored data, i.e., accuracy, freshness, completeness, etc., affects directly the performance of the rest of the elements of the loop (i.e., Analyse, Plan, Execute and the Knowledge base). For instance, in the AV domain, a de-calibrated of faulty sensor may provoke an erroneous adaptation decision, affecting driver’s safety and/or comfortability. Runtime adaptation of the Monitor element can also be beneficial when resources are scarce. For instance, in hybrid or electric AVs, a runtime trade-off between the utility and the cost of sensors and monitoring services, may prolong the availability of the main AVs’ features, e.g. the self-driving functionality. For the purposes of this work, we use the following generic definition of adaptive monitoring (Zavala, Franch, and Marco 2019): Adaptive monitoring is the ability a monitoring system has to modify its structure and/or behaviour in order to respond to internal and external stimuli such as changes in their execution context, functional and non-functional requirements, systems under monitoring or the monitoring system itself In order to support adaptive monitoring in AVs, in this work we propose a solution that combines two HAFLoop feedback loops: (1) a level-1 loop, in charge of the AVs logic, (2) a level-2 loop, in charge of the self-improvement process. Machine learning techniques are integrated into the level-2 loop for adapting the Monitor element of the level-1 loop. The proposal is a step forward to address some of the most important challenges affecting current AVs such as sensor faults, energy-efficiency, vehicles’ communication and uncertainty (Gruyer et al. 2017; Schwarting, Alonso-Mora, and Rus 2018; Van Brummelen et al. 2018; Zhu et al. 2017). The evaluation of our solution has been performed in the context of the Swedish research project SALI (SmArt seLf-driving vehIcle). A series of scenarios have been evaluated using real vehicles and the scaled city and rural road environments of the AstaZero test track (http://www.astazero.com/) in Sweden.
The remainder of the paper is structured as follows. Section II presents the background of this work. Section III describes our generic architecture HAFLoop and its instantiation in the AV domain for supporting adaptive monitoring. Section IV provides the details of the evaluation of our HAFLoop AVs solution, and discusses the results. Finally, conclusions and future work are presented in Section V. Background This work focuses on the domain of AVs and adds self-improvement capabilities in the form of adaptive monitoring for improving AVs’ perception systems. Therefore, the background is divided into two parts: 1) perception systems for AVs, and 2) proposals to support selfimprovement capabilities. Autonomous Vehicles Perception Autonomous vehicles (a.k.a. intelligent vehicles, driverless vehicles, or self-driving vehicles; AVs for short) operate autonomously by perceiving the environment and exhibiting a responsive action such as navigating, vehicle following, overtaking, parking or lane keeping (H. Cheng 2011). The process typically comprises four main stages, as shown in Fig. 2: (1) environment perception and modelling, (2) localization and map building, (3) path planning and decisionmaking, and (4) motion control (H. Cheng 2011). These stages can be mapped to the functionalities of the MAPE-K loop elements: Monitor, Analyse, Plan and Execute, respectively. As mentioned before, in this work we focus on the Monitor element adaptation, i.e., the perception stage of AVs. In this stage, data are usually collected by multiple sensors, such as camera, radio detection and ranging (Radar), light detection and ranging (LiDAR), and infrared sensors (Van Brummelen et al. 2018).
[Figure 2 near here] Since the perception stage is the link between the real world and the rest of the AVs stages, it plays a crucial role (Gruyer et al. 2017; Guanetti, Kim, and Borrelli 2018; Zhu et al. 2017). Given its importance, over the last decade, a lot of research efforts have been dedicated to this stage, developing promising advances in AV technologies (Van Brummelen et al. 2018; Gruyer et al. 2017; Zhu et al. 2017). However, some perception challenges to attain the full potential of AVs remain open, either because they are relatively addressed or largely unaddressed by existing approaches (Van Brummelen et al. 2018). In an extensive overview, recently performed on the AVs’ perception topic (Van Brummelen et al. 2018), we have identified a set of challenges that affect the performance of AVs in poor environmental conditions and uncertain and complex settings, as well as challenges regarding the reliability and energy-consumption of sensors and the utilisation of connectivity with other road entities. Other reviews on the AV domain have also remarked the importance of addressing some of these challenges (Gruyer et al. 2017; Zhu et al. 2017; Schwarting, Alonso-Mora, and Rus 2018). From these reviews, we have identified current open perception challenges affecting AVs and classified them in three main categories: • Category 1. Technological perception challenges o ChlP1.1. Support AV perception in adverse weather conditions (Gruyer et al. 2017; Schwarting, Alonso-Mora, and Rus 2018; Van Brummelen et al. 2018; Zhu et al. 2017). o ChlP1.2. Support AV perception in poor lighting conditions (Zhu et al. 2017; Van Brummelen et al. 2018; Gruyer et al. 2017). • Category 2. Modelling perception challenges
o ChlP2.1. Support AV perception in complex urban environments (Van Brummelen et al. 2018; Schwarting, Alonso-Mora, and Rus 2018; Gruyer et al. 2017). o ChlP2.2. Reduce reliance on a priori data such as maps (Van Brummelen et al. 2018). • Category 3. Functional perception challenges o ChlP3.1. Incorporate Vehicle-to-Vehicle (V2V) and Vehicle-to-Infrastructure (V2I) communication in AVs perception systems (Gruyer et al. 2017; Van Brummelen et al. 2018). o ChlP3.2. React to faulty sensors and uncertain sensor data (Van Brummelen et al. 2018; Gruyer et al. 2017; Schwarting, Alonso-Mora, and Rus 2018; Zhu et al. 2017). o ChlP3.3. Support energy-efficient AV perception (Van Brummelen et al. 2018). The Technological challenges refer to the aspects constrained by the sensor technology available nowadays. For instance, current camera sensors generate poor-quality images that are difficult to exploit with rainy, foggy, sunny (dazzling or shining), or snow conditions (Gruyer et al. 2017). Similarly, some sensors are affected by the poor lighting conditions. One of the solutions to overcome this issue is the use of data fusion methods, i.e., combine information gathered through different sensors (Zhu et al. 2017; Van Brummelen et al. 2018; Gruyer et al. 2017). Part of the perception stage is the pre-processing of raw sensor data to generate models of the environment. In this regard, there are some Modelling challenges that are still open. For example, in cluttered environments AVs may model several interactions among different road users, failing in this task may provoke an unsafe state (Schwarting, Alonso-Mora, and Rus 2018).
Rule-based, probabilistic, learning-based, among other types of approaches have been proposed for modelling complex environments at runtime; however, there are aspects that still have to be addressed (Van Brummelen et al. 2018; Schwarting, Alonso-Mora, and Rus 2018; Gruyer et al. 2017). The last category corresponds to the Functional challenges. These challenges refer to the aspects related to the (adequate) operation of the data gathering task of the perception stage, independently from the technology, i.e., sensor data completeness/redundancy, reliability and process optimisation. For example, in high-density traffic conditions, radar systems may pick up other vehicles’ radar signals, causing false detections, interference and additional uncertainty (Hischke 2002; Schipper et al. 2015). Moreover, as more sensors are integrated into vehicles, e.g., for supporting data fusion algorithms, the risk of faults increases as well as the power consumption (Ren et al. 2018; Gawron et al. 2018). A popular approach to optimize AVs energy consumption is the adoption of V2V and V2I communications (Gawron et al. 2018; Guanetti, Kim, and Borrelli 2018); however, correctly supporting these capabilities in AVs remains still a challenge (Gruyer et al. 2017; Van Brummelen et al. 2018). In this work, we focus on the operational aspects of AVs’ monitoring systems. Therefore, our contribution regarding current AVs challenges will be on ways to address the open Functional perception challenges. Self-Adaptive Systems Self-Improvement For many years, software solutions for SASs have relied on static feedback loops that manage the whole adaptation process. This implies that changes on the structure and behaviour of the loops’ components are not possible at runtime. This vision has constrained SASs capabilities to respond to unpredictable events and in consequence limited their application. In extremely demanding domains such AVs, smart cities or mobile applications, this approach is not suitable;
in these domains, feedback control systems must be able to adapt at runtime as well. Motivated by the increased need of adaptive feedback loops, many researchers have proposed selfimprovement solutions to address this issue. In a recent work, we have reviewed 26 approaches for supporting adaptive feedback loops (Zavala et al. 2020), and presented a new generic one, HAFLoop. We have found gaps and opportunities of contribution to the research field; for instance, the urgency of solutions that satisfy modern SASs’ requirements such as decentralisation. Based on our findings, we have identified a series of challenges related to the flexibility, generalisability and reusability of the solutions that still need more research efforts to be addressed. Below, we summarize such challenges and organize them into three main categories: • Category 1. Applicability of self-improvement challenges o ChlS1.1. Provide generic self-improvement solutions, so they can be reused in a variety of SASs. o ChlS1.2. Support software engineers in the whole software development lifecycle. • Category 2. Capabilities of self-improvement challenges o ChlS2.1. Support reactive (reaction after a change) as well as proactive (action before it) adaptation. o ChlS2.2. Support changes on both the structure and the parameters of SASs’ feedback loops. • Category 3. Engineering of self-improvement challenges o ChlS3.1. Support different software components’ settings, i.e., centralized, decentralized, hybrid.
6. https://github.com/edithzavala/OpenDaVINCI/tree/feature.smartvehicle/automotive/miniature/ lanefollower o V2V component provides simulated V2V communication data, two types of messages are considered: CAM (ETSI 2011) and DENM (ETSI 2010). o City reporter component consumes the service offered by HERE (https://developer.here.com/) through API. This service provides real-time traffic data. The City reporter also consumes data from the OpenWeatherMap service (https://openweathermap.org/) in order to gather weather data. The different subcomponents of the HAFLoopMonitor, referred as Monitors in Fig. 5, are independent one from each other. Therefore, a Monitor can be removed, enabled or disabled without interfering in the operation of the rest of subcomponents. In this instance of HAFLoop- OpenDLV, the HAFLoopMonitor supports both structural and parameter adaptations (addressing ChlS2.2). Regarding the AVs main stages illustrated in Fig. 2, the HAFLoopMonitor performs the Environment perception and modelling stage which is the most relevant to this work. [Figure 6 near here] • Level-1 Analyse, Plan and Execute (HAFLoopAnalyse, HAFLoopPlan and HAFLoopExecute) o Lane follower is a complex component that appears in three of the loop elements. This component is included for simulation purposes and has been extended from an existing one available at the OpenDaVINCI software vehicles’ environment (https://opendavinci.readthedocs.io). The extended version of the lane follower6 supports a context-aware AV. This component has three main functionalities: 1) follow a lane, 2) overtake objects moving slow or static, 3) re-evaluate route to destination based on traffic and runtime events (e.g., a crash). The
7. https://github.com/edithzavala/ksam-loopa logic of this component encompasses the 3 last stages of an AV process (see Fig. 2). • Level-1 Knowledge base (HAFLoopKnowledge) o Odsupercomponent creates an UDP multicast session in order to allow the communication of all the rest of components. Apart from that, it distributes to the other components their initial policies. o Adaptation data manager forwards to the level-2 loop the monitoring data gathered through sensors and services. o Adaptation enactor manager receives requests for adaptation from the level-2 loop and sends requests for change to the Monitor. Then, policy variables are adjusted and the Monitor structure and/or parameters adapted. The level-2 feedback loop, in charge of self-improvement, i.e., adapting the level-1 loop’s Monitor, has been developed using the Java-based HAFLoop framework. The architecture of the level-2 loop7 is shown in Fig. 7. Below, we describe each of its components: [Figure 7 near here] • Level-2 Monitor (HAFLoopMonitor) o Monitoring data thresholds’ checker revises the correctness of the morning data, based on policies. Data out of thresholds could indicate, for example, a sensor fault (enabling the AV to address ChlP3.2, ChlS2.1); if that is the case, an alert is triggered. All the data gathered is persisted by the Knowledge base.
o Battery inspector continuously checks the vehicle’s battery level (consider a hybrid AV). If the vehicle starts to run out of battery, an alert is sent to the Analyse element before it gets totally depleted (enabling the AV to proactively address ChlP3.3, ChlS2.1). The battery level data can be visualized at runtime thanks to the Knowledge base element. • Level-2 Analyse (HAFLoopAnalyse) o Analysis alerts manager this component receives alerts from the Monitor element. According the alert type, e.g., a fault or a battery issue, it analyses time series data (stored by the Knowledge base) in order to determines the sensors and monitoring services (from AV’s level-1 loop) that will be used in the near future. In order to accomplish this task, it relies on a Data miner component. In case an adaptation is required, it sends an alert to the Plan element. o Data miner this component uses the data mining Weka tool (Machine Learning Group at the University of Waikato 2016) and existing models (created during a training phase), in order to forecast: (1) the position of vehicles in the near future, (2) the usage of the self-driving functionality such future position(s). Weka offers a variety of classification and clustering algorithms. In this work, we have selected a couple of these algorithms based on previous experiences (Zavala et al. 2015; 2018; Zavala, Franch, and Marco 2019; Zavala et al. 2020), particularly based on the promising results obtained in a series of experiments performed in the smart vehicles domain, in simulation environments. • Level-2 Plan (HAFLoopPlan)
o Planner alerts manager performs a trade-off between the cost of keeping a monitor (monetary and power), the data it provides, and its relevance regarding the self-driving functionality usage, every time it receives an alert from the Analyse element. Cheaper monitors are preferred if they (or a combination of them) are able to gather the data required. In the case of a battery critical situation, the Planner sacrifices coverage is and a restricted self-driving functionality is supported. When coverage is not sufficient and the risk is high, a request for take-over is sent to the user (disabling the self-driving functionality). The resulting list of monitors to adapt, and their configuration, is sent to the Execute element. • Level-2 Execute (HAFLoopExecute) o Adaptation request sender receives the requests for adaptation triggered by the Plan element, transforms them into actionable tasks that can be understood by the Managed Element ME (i.e., in this case, using the communication protocols and format required by the level-1 loop) and sends them. • Level-2 Knowledge base (HAFLoopKnowledge) o Data store persist runtime data produced by the MAPE elements. In this implementation, the data gathered by the Monitor element is in .arff files, the format used by Weka. The rest of data, e.g., list of active monitors, active functionalities, data mining prediction, etc., are stored in different runtime variables. This component is also connected to the Runtime data dashboard component for data visualization.
o Runtime data dashboard uses the monitoring tool Graphite (http://graphite.readthedocs.io) the Grafana platform (https://grafana.com/) (see Fig. 8) in order to provide a real-time visualization of the monitoring data. Fig. 8 shows the different variables we have visualized, these includes: the calls performed to the different level-2 loop elements, the data mining self-driving functionality usage prediction, the measurements of the monitoring sensors and services as well as their health (i.e., whether they are working properly or not). [Figure 8 near here] Evaluation Motivated by the current challenges affecting AVs perception (see Section 2.1), we have developed a research project called SALI (https://azopenresearch.fluidreview.com/res/p/A0034/). In the context of the SALI project, we have evaluated our solution through a series of experiments conducted in (controlled) real traffic environments, at the facilities of the test ground AstaZero in Sweden. Concretely, experiments have been executed in two test areas: a scaled city (see Fig. 9a) and a rural road (see Fig. 9b). The components of the AVs level-1 and level-2 loops (see Fig. 5 and Fig. 7) have been implemented as a series of microservices which have been containerized using Docker (https://www.docker.com/) for facilitating, among other tasks, the deployment process. While the level-1 loop was deployed and run on the vehicle’s machine during the experiments, the level-2 loop was deployed on an external machine. Concretely, a computer with an IntelR CoreTM i7- 7700HQ CPU @ 2.80GHz and 16,0GB of RAM. During the evaluation, both machines were connected through a local area network using an Ethernet connection.
The evaluation aimed at assessing the correctness and timeliness of our solution for supporting adaptive monitoring in modern SASs such the AVs, in realistic environments. In order to do so, a series of use cases have been executed using three real cars: two Volvo XC90s (henceforth Snowfox and Greyfox) and one Volvo V40. Specifically, we have run three use cases: a sensor fault, battery issues and a road accident with uncertain sensor data. Apart from the vehicles mentioned before, a soft vehicle (see left-hand yellow half-vehicle in Fig. 10) has been utilized for the road accident use case at the AstaZero city area. Our solution has been deployed on the Snowfox car, while, the other vehicles have been used for setting up the scenarios. [Figure 9 near here] [Figure 10 near here] Preparation Activities The evaluation of our solution has consisted of testing our implementation in eight scenarios of our three use cases (two scenarios per use case). Table 1 provides the description of the scenarios while Fig. 11-13 illustrate them. For the sensor fault and battery issues use cases, the AV has to determine whether the self-driving functionality is going to be used or not. In order to enable this feature, a training phase has been conducted for modelling user’s preferred route and self-driving functionality usage (see initial set-up vignette in Fig. 12 and Fig. 13). These two use cases have been executed on the rural road while the road accident use case in the city area. The IBk (Aha, Kibler, and Albert 1991) and JRip (Kotsiantis 2007; Tan, Steinbach, and Kumar 2005) algorithms from the Weka tool (Machine Learning Group at the University of Waikato 2016) have been used for training the AV; the first one for position data and the second one for
modelling the self-driving functionality usage. The patterns generated by this training phase are illustrated in Fig. 14. [Figure 11 near here] [Table 1 near here] [Figure 12 near here] [Figure 13 near here] [Figure 14 near here] In order to configure the AVs HAFLoop feedback loops, we have set an initial set of policies. Table 2 and Table 3 show a simplified version of the level-1 and level-2 loop policies, respectively. For the sake of simplicity, some policy variables related to elements’ internal structure such as the list of components’ recipients, are not shown. [Table 2 near here] [Table 3 near here] Scenarios Execution and Results The experiments have consisted on the repetitive execution of different scenarios. A total of 30 executions have been done. For analysing the evaluation results, we have explored two aspects of the self-improvement process: the response time and the adequacy of the adaptations. The response time has been divided into: • Level-2 loop response time. This is the time elapsed since a challenging factor (from Table 1) is detected by the Monitor element, until a decision of no adaptation required or an adaptation request is sent.
• Level-1 loop response time. This is the time required by the level-1loop for enacting an adaptation since a request is received. • Data mining response time. This refers to the prediction process time, i.e. the time required for predicting next vehicle’s positions and the usage of the self-driving functionality in such positions. This time is part of the Level-2 loop response time; however, we consider that is interesting to report it separately in our benchmarking. Regarding the self-improvement adequacy; first, we have evaluated the correctness of the enactment process, i.e., ensure that the expected adaptations, described in Table 1, are the ones enacted; second, if enacted, we check whether it has been enacted timely (from a humanperspective). As a conclusion of the execution of all the scenarios, it can be confirmed that the enactment of all the adaptation decisions have been done correctly and as expected. From a human-perspective, it has also been concluded that the adaptations have been timely enacted. Timelines has been evaluated as follows: for the road accident, the adaptation should have been executed before the intersection is reached (see Fig. 11); for the sensor fault and battery issues use cases, the adaptation is enacted within the segment of the route where the self-driving functionality is required (according to the patterns shown by Fig. 14). The adequacy of the self-improvement functionality has also been evaluated in terms of prediction correctness. From the results, we have concluded that the prediction of the vehicle’s position and the self-driving usage has also been accurate and timely. For instance, when the vehicle was starting the journey our solution predicted that the functionality would be used while when the vehicle was almost at the end of the segment where self-driving is typically used (see Fig. 14), the prediction indicates the functionality would not be required in the near future. Thanks to the correctness of the predictions, the vehicle has made the correct adaptation
decisions. Table 4 shows the resulting average response time (in milliseconds) for the data mining module and the level-2 loop. The response time of cases where data mining has been required is reported separately as well as of the scenarios that have configured a minimum number of alert iterations for the Monitor and Analyse elements. The standard deviation of the response times is provided as well. In Fig. 15, we have plotted a detailed response time per scenario execution. The x-axis indicated the number of the execution, while the y-axis the response times. The average level-2 loop response times go from 249,83 ms to 781,5 ms, for the cases that have not required data mining. For the rest of the cases, the time goes from 3971,75 ms to 4421,5 ms. Particularly, in the second use case, the data mining module spent in average 3624 ms. On the other hand, the use cases considering waiting iterations have experienced an increment of around 500 ms in their response time; this variable should be further investigated as it may affect the performance of the whole solution. However, we consider that its usage may depend on each application. The benefit of using an architectural solution as HAFLoop is that SASs’ owners can put their efforts on investigating domain-specific variables like this one, instead of wasting time building the generic functionalities of an adaptive loop. Regarding the adaptations’ enactment, in us2 and us6 the process has implied the adaptation of OpenDLV components (Camera and V2V) and the City reporter (Traffic service). The adaptation in these use case have managed sequentially, i.e., first the City reporter and then the OpenDLV components, resulting in a smaller level-2 loop response time for the City reporter than for OpenDLV components (see Fig, 15). This is an implementation issue that can easily be fixed with parallelism. In this work, we have considered the average of both response times.
Table 5 shows the level-1 loop’s average response time (in milliseconds). Response times are shown by component adapted: Camera, V2V or City reporter service. The de/activation of the V2V and the Camera has been simulated by software components; therefore, the response time for the adaptation enactment may be different in real cases. That is not the case of the City reporter which connects to a real service and enacts the adaptation changing its configuration. As in previous table, the standard deviation of the response times has been included. The response time per scenario execution is detailed in Fig. 16. A different graph is provided per monitoring component adapted. The x-axis show the number of execution, while response time is indicated by the y-axis. [Table 4 near here] [Table 5 near here] [Figure 15 near here] In the case of the City reporter, one can notice that the response time of the second adaptation, in us2, is much smaller than the response time of the first adaptation (almost 20 times). This systematic difference could be attributed to the service communication protocol which might take more time when the service and the client are connected for the first time; however, we cannot make any conclusions since the low-level details of the framework used for this purpose (i.e., Spring boot - https://spring.io/projects/spring-boot) are hidden from our perspective and out of the scope of this work. The execution of more experiments could improve our understanding of this phenomenon, for example adding a 3rd (or more) adaptation(s). The results of this evaluation are promising. The execution of the scenarios in a realistic environment not only shows the feasibility but also the benefits of supporting adaptive loops in modern SASs such the AVs. The adoption of HAFLoop has allowed our AV to accurately and