Abstract:Multi-Agent system (MAS) is widely used to develop applications in different domains. Currently, the computing platform is becoming more and more open, dynamic, and uncontrollable. Hence, software systems are required to adapt to the changing states of themselves and their running environments. In other words, systems should be context-aware. However, the way to enhance existing MAS applications with context-awareness is not well addressed by existing works. In this paper, based on the Separation of Concerns principle, the study combines context-oriented programming (COP), reflection, as well as code instrumentation technologies in a way to introduce context-awareness to existing MAS applications. With the proposed approach, agents of an existing MAS application are transformed to context-aware ones, even if the source code is unavailable. In addition, with the help of the underlying runtime environment, the administrator can dynamically adjust the context-aware behaviors of a specified agent (or a group of agents) at runtime.