Multi-Agent System Theory for Resource Management in Home Automation Systems

A paradigm for modelling and analysing Home Automation Systems is introduced, based on Multi-Agent System theory. A rich and versatile environment for Home Automation System simulation is constructed for investigating the performances of the system. The exploitation of limited resources (electricity, gas, hot water) depends on behavioural parameters of the individual appliances. In order to deal with the problem of developing systematic design and validation procedures for control strategies, global performance indices for the system are introduced. Different strategies for allocating resources and establishing priorities in their use can therefore be tested and compared.


I. INTRODUCTION
T HE aim of this paper is to present an approach to the study of Home Automation systems, based on the Multi-Agent System (MAS) theory, which allows to introduce a rigorous formalisation and to define practical tools for the analysis of performances.
Home Automation Systems (HAS) consist of a number of appliances (e.g.washing machine, dishwasher, oven, refrigerator, boiler) and other devices or subsystems (e.g. for heating, air conditioning, entertainment), which are connected by a communication network of some kind.The various elements of the system share common resources (mainly electricity, but also water) to accomplish their specific tasks, according to user requirements.
Since resources are limited (due to costs, contract rules or provider directives), competition between the elements of the system generates internal conflicts.Distributed or centralised control strategies have to be implemented within the system, so to allocate limited resources while maximising performances, using the information dispatched over the communication network and the computational resources the devices, or a dedicated unit of them, may have [1].
From a control theory point of view, Home Automation Systems are very complex objects, characterised by the presence of components and constraints of different kinds, a distributed structure and a hybrid event/time-driven behaviour.Although the market offers devices and solutions that allow to assemble more or less sophisticated Home Automation Systems, efficient design techniques are far from being developed.
In particular, general methods for evaluating the performances and for tuning the control strategies are missing.On the other hand, the demand for methods and tools that facilitate the systematic design of efficient Home Automation Systems is made more and more urgent by the increase of the quantity of limited resources that are consumed for domestic use and by the growing competition in the market of appliances and home devices [2].
Here, we present and discuss a specific contribution to the construction of tools for the analysis and design of Home Automation Systems.We start by recalling the notion of Home Automation System based on the Multi-Agent System theory, that was introduced and discussed in [3][4][5][6].
On the formal basis that notion provides, we construct an environment for the simulation and emulation of Home Automation Systems.At the same time, we define indices of performances for paradigmatic control strategies, characterised by suitable parameters, that allocate limited resources, by solving conflicts between individual components of the system.
The outcome of this work is a rich and versatile framework in which one can analyse the effects caused on the performance indices by variations in the parameter that characterise the control strategies.In other term, control strategies for Home Automation Systems can be validated and tuned by exploiting the results of simulation, so to increase user satisfaction and system efficiency.

II. MULTI-AGENT SYSTEM AND HOME AUTOMATION
SYSTEM DEFINITION Multi-Agent System theory has been employed to model and study several situations, characterised by the presence of autonomous agents which interact and possibly compete in various way, in many areas of computer science, automation and robotics (see e.g.[3,4,7] and the references therein).
Another application is the IHome Environment [8], an example of intelligent home that uses the Multi-Agent System technology as a way to control the behaviour of house appliances from the resource consumption and coordination viewpoint.The simulated IHome environment is controlled by intelligent agents that are associated with particular appliances.
In the MavHome project [9] the smart home is seen as an intelligent agent that perceives its environment through the use of sensors, and can act upon the environment through the use of actuators.The home has certain overall goals, such as minimising the cost of maintaining the home and maximising the comfort of its inhabitants.
C@sa [10] is a Multi-Agent system aiming at modelling, controlling and simulating house behaviour according to user and context features, using several "Operator Agent" and a "Supervisor Agent".
Another notable environment is Adaptive House [11], that focuses on the development of a home that programs itself by observing the lifestyle and desires of the inhabitants, and learns to anticipate and accommodate their needs.Although Multi-Agent System theory is not used in this work, this system is interesting since the control is handled by neural network reinforcement learning and prediction techniques.
Anyway, in all these works, the resource management strategies can neither be fine-tuned nor evaluated by means of well-defined performance indices.Moreover, the constraints on resource consumption are quite generic and not as "hard" as in the present work.
Our approach is based on the use of very special agents, that are not to be seen as computer science agents; we provide an appropriate definition of "Domotic Agent", that stems from the more general definition of agent as an entity who is capable of action.

A. Home Automation Systems as Multi-Agent Systems
As we have already mentioned, Home Automation Systems consist of appliances and other devices or subsystems, connected by a communication network.Communication may happen through the power line, by means of suitable devices called nodes.
From the point of view we have adopted, we can consider the human user himself as an agent of the Home Automation System.Competing for the resources, his needs will conflict with those of other agents in the same structured environment and the solution of conflicts will follow the same general rules.Privileges and priorities granted to the human user do not represent external disturbances which may interfere with system behaviour and degrade its performances, but are integrated in the laws that govern its operations.
In a real Home Automation System, the agents must have some individual features that facilitate their integration into a larger system, without reducing their ability to work as standalone devices and to satisfy the user.Summarising, the features can be informally described as follows: • Autonomy: the capability to perform their own tasks, when required, without support from the Home Automation System or, alternatively, the capability to negotiate resources in interacting with other agents • Collaborative behaviour: the capability to cooperate with other agents in order to share resources and to reach common goals • Adaptability: the capability to modify their behaviour according to the outcome of interaction processes • Reactivity: the capability to react, to some degree, to system actions.The above features assure the possibility to work sharing common resources, and suitable strategies for optimising individual performances are applied [6].
Multi-Agent approach is very suited to deal with such a situation and allows to model the structure of a general Home Automation System at least at two levels: a global level concerns the overall behaviour and performances of the system, and a local level that concerns the way in which single components and devices are integrated into the system and work.
In other words, in a Home Automation System we have a collection of components, which can be generically called agents, and an overall architecture, which defines the environment in which the agents interact and the modalities of interaction.From this point of view, a Home Automation System qualifies as a Multi-Agent System in the sense of Sycara [3], in which, in particular, • there is no centralised, global controller or supervisor; • data and knowledge are decentralised; • computing power is distributed and asynchronous; • each agent has incomplete information or capabilities and, as a consequence, limited knowledge and awareness of the overall situation.In order to allow the system to operate, the architecture of the system and the way in which information flows in it must guarantee that • each agent may declare itself; • each agent may detect and possibly recognise other agents; • each agent may interact with other agents according to given rules (system rules).

B. Domotic Agent
Following the Multi-Agent System theory point of view, an agent, namely the basic component of a larger system, can be defined by characterising its capabilities.Keeping in mind the application we are interested in, a suitable way to characterise an agent is provided by the following definitions.
Definition 1: An agent is a virtual or physical entity that: 1) is able to perform specific actions in a given environment; 2) is able to perceive elements of the environment; 3) is able to construct (partial) models of the environment 4) is able to use personal resources and environmental resources; 5) is able to direct its actions toward specific goals; 6) is able to communicate directly with other agents in the environment; 7) is able to offer services to other agents; 8) is able to govern its action according to its possibilities and limitations, to its goals, to its knowledge of the environment, to the resources available.Remark 1: This definition is formally analogous to the definition of agent in Ferber [7].It should be noted, as stated in Russell and Norvig [12], that in general the definition of agent "is meant to be a tool for analyzing systems, not an absolute characterization".For a more extensive discussion of the issues involved in the general definition of agent, the reader is referred to [13].Now, we can give the notion of domotic object and of domotic agent, the elementary component of a Home Automation System, by specialising Def. 1.
Definition 2: A domotic object is a generic agent in the sense of Definition 1 that has at least the general capacities 1, 4, 5 and 8 and, concerning capacity 6, it is able to communicate to other agents in the environments at least its requirements about environmental resources.
Definition 3: A domotic agent is a domotic object that, in addition, has at least the general capacity 2. A cognitive domotic agent has also capacity 3.
Remark 2: Note that in this framework "cognitive" is not meant to define faculty of cognition in general, but with respect to the object of our studies.
The above definitions are quite abstract, but, as described in [5], they fit well with the appliances and other devices found in a domestic environment.

C. Home Automation System
After having defined the main elements, namely the domotic object and agents, that will form the overall system, we can give the following Definition.c) perception and understanding; 6) a set L of operators, called Laws, that describe the time evolution of the global system according to the individual behaviour of objects and of agents.The notions described must be viewed as conceptual instruments that facilitate modelling and analysis of concrete examples, help in understanding their features and in identifying their critical parameters.
Remark that, in facts, the time evolution of a Home Automation System formally described on the basis of Def. 4 is completely determined by L and it depends, in particular, on the Rules which form R. Then, developing simulation tools and procedures as described in the next Section, it is possible to investigate the effects of different choices of the Rules on the global evolution and behaviour of the system and to evaluate the resulting performances in terms of indices that represent user satisfaction.

III. SIMULATION ENVIRONMENT
In the virtual environment we construct, agents are characterised in a realistic way, by exploiting the experience in studying and modelling white goods derived from the collaboration with Italian manufacturers.Besides making simulation more effective, this choice is crucial to allow the simulation engine to interface with real appliances.
Anyway, since the duration of an appliance cycle may be quite long, one of the important feature of the simulator is that it can work only with virtual agents, whose execution speed can be increased setting a specific parameter, so to shorten the duration of simulation.
The behaviour of each agent in the simulator is modelled as a sequence of transitions from state to state.The sequence of state transitions during normal operation of each agent is time-driven, except in case a required resource is or becomes unavailable.In such case, this event may cause a transition.
Basically, the simulator consists of a software environment, developed using LabVIEW, where programs (virtual instruments) that represent the single agents are executed simultaneously; each program implements the sequence of state transitions that characterises an agent.Agents exchange information by sharing global variables.
To run a simulation, one has to define the virtual environment by indicating the agents and the related global variables and by specifying the values of a number of global and individual (i.e.concerning a single agent) parameters.During the simulation, agents are put into action automatically, according to a chosen schedule, so to simulate normal operations in a domestic environment.
The set of agents in the Home Automation System is composed of the following: washing machine, dishwasher, boiler, human user and metering devices.Other agents can easily be added, if necessary, such as oven, vacuum cleaner, etc.A graphic representation of the considered Home Automation System is given in Fig. 1.

A. Control strategies
Allocation of limited resources is the key problem that the Home Automation System we consider has to deal with, by solving conflict between competing agents.Here, we assume that limitation of resources means that the actual consumption must not exceed a fixed threshold for a limited time T lim .
The need of a control strategy for electricity consumption is particularly perceived in typical Italian home installations, where the contract with the provider determines expressly a 3 kW threshold and T lim may vary around a few minutes; consumption over the threshold for a time greater than T lim causes a blackout.In this case the user has to switch off some appliance to go back under the threshold and put the master switch on again; it is undoubtedly an unwanted event, not least because sometimes the master switch is placed outside home.
Other possible goals could be minimise the cost, if for instance different rates for resources apply depending on peak or off-peak hours.
Denoting by overload the condition in which the threshold is surpassed and analysing available resources and their quantitative limits, we have found convenient to classify the resources in two groups: 1) resources for which overload can persist, without causing degradation in quality, for a (short) time T lim > 0, after which, if overload persists, its use becomes unacceptably expensive, or, alternatively, the resource is cut off, making necessary to intervene for restarting the system; 2) resources for which overload could persist indefinitely, without causing cut off and the necessity of restarting the system, but whose persistence in time degrades relevantly the quality, so that it is appropriate to chose T lim = 0. Two paradigmatic examples are that of electricity, for which T lim is greater than 0 and that of hot water, for which T lim is ideally 0, since overloads would cause an abrupt decrease of temperature and/or flow.
Resources belonging to different groups have to be managed with different strategies.
Overall control strategies for managing first group resources can be designed following the lines of the Power Levelling strategy introduced and discussed in [1,5].This means that the action of each home automation agent is determined by two parameters, respectively the Overload Time t o and the Suspension Time t s .The Overload Time t o represents the time the agent waits before stopping its action in case an overload occurs.The Suspension Time t s represents the time the agent waits before restarting its action after having stopped it because of an overload.
Overall control strategies for managing second group resources can be designed following the lines of the Water Levelling strategy.In case overload occurs when more than one agent at a time tries to use the resource, planning and evaluation turn out to be particularly simple.To do so, in fact, an agent has only to be able to check, before using the resource, if others are already doing so and, in case, to renounce.This kind of strategy assures the highest priority to the agent which first gets the resource and forces the others to wait.

B. Performance indices
In order to compare the results of different simulation scenarios, determining thereby which strategies and policies are the best, we need one or possibly more indices of performance.
We have defined two indices, that point at important aspects: relative delay in completion of tasks and number of overloads.Other choices are possible if different problems have to be investigated.
1) Relative delay: Let the duration of task i, when all the required resources are available, be indicated by T N i and call it nominal duration.In case of conflict and competition, during a simulation, the time needed to complete the task may take a higher value T A i ≥ T N i .Then, we consider the relative delay and, letting N be the number of tasks in the considered scenario, we define the global percent relative delay ∆% as where the p i are weights that can be chosen according to the characteristics of the task.Clearly, user satisfaction increases when this index approaches 0. Nominal durations have been determined using real appliances.
2) Number of overloads: This index simply counts the occurrences of overloads during the simulation and it is denoted by OL.Overloads stress the system and put it at risk or cause a great increase of costs, so the Home Automation System is performing better if OL is kept small.

C. Parameter optimisation
To optimise the choice of parameters in order to achieve better performances is the object of a relatively new research area, the simulation optimisation.
The capabilities of the simulator have been tested on several experiments on a simple Home Automation System, using the Power Levelling strategy with different parameters, and different parameter optimisation procedures have been implemented: a Tabu Search and a Genetic Algorithm [14,15].
As an example, we can mention the simulation results obtained using the Tabu Search approach, without entering into the optimisation method details, for which the reader is referred to [14].
The parameters that we want to optimise are the Overload Time and the Suspension Time for both the washing machine (WM) and the dishwasher (DW).As first starting solution, we decided to choose a situation of equilibrium with the same parameter values for both the appliances, i.e. t o = 50 s and t s = 1000 s.
Running the simulation with these parameters resulted in 13 overloads and 287.1% as relative delay; clearly it was a very bad solution: the great number of overloads stresses the whole system and the accomplishment of the tasks requires a duration that is almost four times as the expected one.
Applying the optimisation method, the best solution (WM: t o = 30 s, t s = 1100 s; DW: t o = 90 s, t s = 700 s) was found after 14 iterations and it resulted in 2 overloads and 22.6% of relative delay.
The performance of this solution is significantly better than the starting solution, so we can say that our framework has been very effective in finding a good set of parameters starting from a set chosen with no knowledge or prediction about the relationship between parameters and performance index, which was a very poor solution.

IV. CONCLUSIONS AND FUTURE DIRECTIONS
Starting from the formal definitions of basic concepts in home automation we have shown how a Multi-Agent approach has been used to develop a coherent, general framework for modelling, simulating and analysing Home Automation Systems.From a conceptual point of view, a key feature of this approach is the possibility of defining indices of performance, that turn out to be functional in designing and optimising global control strategies and behavioural policies.
The simulator has proven to be a useful tool that allows to adopt the most effective strategy for each scenario; when appliances are added or discarded from the house or the restrictions on the resources change, a new simulation optimisation can be easily performed.
Actually we are investigating metaheuristic methods, such as genetic algorithms, for parameter optimisation as well as other simulation optimisation methods in order to design control strategies for energy saving and optimal resource exploitation.Another promising direction could be the use of Artificial Neural Networks to determine a set of resource management parameters that optimise the performance indices.

Definition 4 :
A Home Automation System (HAS) consists of: 1) a set GR of Global Resources; 2) a set DO of Domotic Objects; 3) a set DA of Domotic Agents, subset of DO; 4) one Information Network IN, that connects domotic objects and agents; 5) a set R of Rules that govern the individual behaviour and the concurrent operation of domotic objects and concern a) use and transformation of external resources, b) communication,