# On Managing Knowledge for MAPE-K Loops in Self-Adaptive Robotics Using a Graph-Based Runtime Model
## 1 Introduction  
Robotics technology is currently spreading from the highly structured environments with well-defined use cases of large-scale mass manufacturing to a wider range of market domains. In contrast to the somewhat standard mechatronic systems used in industrial robotics, these new application areas demand robots to adopt many different mechanical forms and be equipped with specific sensors and actuators. They should also interact with different unstructured and dynamic environments, often sharing space and tasks with people. Furthermore, robots must be endowed with the particular functionalities required to accomplish the very specific use cases that each application area requires, but also fulfill non-functional properties such as safety or security. For deployment in these challenging scenarios, robots must be autonomous, but this autonomous capability must be revisited in order to have an effective impact on the adoption of robots. Among the core technologies involved in increasing autonomy in robotic systems, one relevant topic is self-adaptation. If an autonomous robot is to be able to operate in a real world setting without any form of external control for extended periods of time, we can assume that, in the previously described scenario, it is mandatory that an autonomous robot can monitor the context, self-adapting its behaviour to perceived changes. A key concept behind adaptability is that of variability: robotic platforms heterogeneous in hardware, software, and capabilities; applications with different quality requirementsand particularities, and several ways of adapting a robot for a given use case. In some sense, deploying robots in one of these new scenarios can be seen as a work of tuning the variability to end up with a final configuration (hardware/software/behaviour/safety-security-performance attributes) that suits the use case. Variability can be partly set at design-time by the manufacturers, engineers or users. But there is also a part of the variability that should be closed at runtime. This part will be resolved by self-adaptation and autonomous decision making. This approach implies the deployment of a strategy to discover this unconstrained variability, the runtime mechanisms to monitor the internal and external context information, and optimisation procedures to close, also at runtime, this remaining variability. The MAPE-K feedback loop [1] is a well-adopted model for managing autonomous decision-making and self-adaptation. The MAPE-K loop is a classic control structure in autonomic computing. After dividing up the system into a managed system and an adaptation engine, it defines a loop consisting of four steps; Monitoring, Analysis, Planning, and Execution. All these steps operate on the basis of a common knowledge base, which guides the behaviour of the robot at each step of the loop. The first step of the MAPE loop is the monitoring of the controlled system. The aim is to collect data about the state of the managed system. It is relevant to note that, for executing a task, the system will require in-depth knowledge to understand when, where, what, and how to do it. Captured data can be enriched to become a reusable piece of knowledge. In any case, the existence of a knowledge gap between the internalised concepts and those needed to solve the task may result in the task not being correctly solved. Cognition can be used to bridge this gap by modelling, applying, and learning domain-dependent contextual knowledge [2]. In the Analysis step, the representation of the world is processed to determine the conditions required to trigger specific adaptation actions. The Planning step uses the inferred symptoms, as well as the policies defined at design-time, to define the intermediate actions to be implemented on the system. The Execution step is in charge of implementing the planned actions using the available resources. A single MAPE loop is not always a sufficient solution for managing complex adaptations [3].