Self-adaptive software systems continuously adapt in response to internal and external changes in their execution environment, captured as contexts. The COP paradigm posits a technique for the development of self-adaptive systems, capturing their main characteristics with specialized programming language constructs. COP adaptations are specified as independent modules composed in and out of the base system as contexts are activated and deactivated in response to sensed circumstances from the surrounding environment. However, the definition of adaptations, their contexts and associated specialized behavior, need to be specified at design time. In complex CPS this is intractable due to new unpredicted operating conditions. We propose Auto-COP, a new technique to enable generation of adaptations at run time. Auto-COP uses RL options to build action sequences, based on the previous instances of the system execution. Options are explored in interaction with the environment, and the most suitable options for each context are used to generate adaptations exploiting COP. To validate Auto-COP, we present two case studies exhibiting different system characteristics and application domains: a driving assistant and a robot delivery system. We present examples of Auto-COP code generated at run time, to illustrate the types of circumstances (contexts) requiring adaptation, and the corresponding generated adaptations for each context. We confirm that the generated adaptations exhibit correct system behavior measured by domain-specific performance metrics, while reducing the number of required execution/actuation steps by a factor of two showing that the adaptations are regularly selected by the running system as adaptive behavior is more appropriate than the execution of primitive actions.
翻译:自适应软件系统根据执行环境中捕获的内外部变化(即上下文)持续进行自适应。上下文导向编程(COP)范式提出了一种开发自适应系统的技术,通过专门的编程语言结构捕获其主要特征。COP自适应被指定为独立模块,根据感知到的周围环境情况激活或停用上下文,从而动态地组合或脱离基础系统。然而,自适应、其上下文及关联的专门行为定义需在设计时完成。在复杂信息物理系统中,由于无法预见的运行条件,这一过程难以处理。我们提出了Auto-COP——一种在运行时生成自适应的新技术。Auto-COP利用强化学习选项,基于系统执行的先前实例构建动作序列。通过在环境交互中探索选项,为每个上下文选择最合适的选项,并结合COP生成自适应。为验证Auto-COP,我们展示了两个体现不同系统特性与应用领域的案例研究:驾驶辅助系统与机器人配送系统。我们提供了运行时生成的Auto-COP代码示例,以说明需要自适应的上下文情境类型及对应的自适应生成结果。通过领域特定性能指标验证,生成的适应性能确保系统行为正确性,同时将所需执行/致动步骤数量减少一半,表明运行系统持续选择自适应行为作为比执行原始动作更合适的应对措施。