Agent-Based Adaptive Cooling Optimising Systems for Homes in KSA

Energy saving has been a global concern since the last few years. Due to the massive growth of population in Saudi Arabia and its extremely hot climate, electricity consumption, and costs are expected to increase every year. This work presents an intelligent and efficient technology to create a balance between the need of energy consumption minimization and standards regarding the comfort of people in Saudi Arabia. Thermal Modelling and Optimization of Cooling Systems have been considered to generate the outcomes of study. The sample size comprised of 10 houses, which have been selected randomly from Royal Commission for Yanbu province. It has been revealed through testing that there is a reduction by 20% in cooling consumption. This reduction reflects in 31% reduction in expected cooling costs without affecting the comfort of householders.


Introduction
Global energy consumption is growing every year and countries around the world are facing unprecedented expansion in electricity infrastructure.As a result, energy saving became a worldwide concern (Saudi Electricity Company, 2016;Girouard, 2010), especially in a country like Saudi Arabia where the population is expected to be drastically increasing (World Population Statistics, 2013).Due to the enhancement of population growth, the consumption of energy as well as its costs is expected to be increased.The Ministry of Saudi Water and Electricity recently announced that the country needs to invest 330 billion Riyals over the next ten years as demand for electricity continues to grow 7-8% annually (Saudi Electricity Company, 2015).Due to extreme hot weather in Saudi Arabia, the Saudi Electricity Company reported that 60% consumption of electricity goes to power air conditioning (Saudi Electricity Company, 2016).A multi-agent system is a group of networked agents or controllers for achieving some global objectives by coordination and communication among the agents (Zhao, Suryanarayanan & Simoes, 2013).An agent is an intelligent technology that is autonomously acting in some environment to achieve its goals (Wooldridge, 2009).Optimization algorithms should be applied to thermal model to control the cooling consumption.The proposed system is required to accomplish these missions to achieve its objective.These missions or goals are distributed over different agents, which form the proposed multi-agent system collectively and are known as Home Cooling Optimizer (HCO).

Literature Review
Over the recent years, different approaches for energy saving using intelligent agents have been introduced by several scientists and institutions.Rogers, Maleki, Ghosh et al. (2011) introduced an intelligent agent at the University of South Hampton in UK to control the heating system of home, in order to minimize cost and carbon emissions within a smart grid.They built an agent that learns the thermal properties of home.The agent uses greedy heuristic to adjust the timing of heating in a way that satisfies householders' preferences, while minimizes the cost and carbon emissions.Their evaluations showed that the agent reduces cost and carbon emissions by 15% and 9% respectively, compared to using a conventional thermostat.Also, Hagras, Packham, Vanderstockt et al. (Hagras et al. 2008) presented a novel agent-based system entitled Intelligent Control of Energy (ICE) for energy management in commercial buildings.Intelligent control system architecture has been built successfully by Dounis, Tiropanis, Dounis et al. (2011) that contains a master and slave agent, cooperating to reach the thermal comfort while saving energy.They used fuzzy logic techniques and genetic algorithms.
A study by Xincheng et al., (1998) was focused on the problems brought by the heterogeneity distribution and dynamic features of the internet.The agents and brokers were introduced in order to evaluate the cooperative agents and their applications in the internet.The heterogeneity interfaced can be represented by an agent.Ramchurn, et al. (2011) used mathematical programming to attain a coordination between agents in a decentralized controlling system.their results showed that their mechanism can improve grid performance by reducing peaks in demand by up to 17% and carbon emissions by up to 6%.Erickson, Lin, and others believed that in many situations, there are rooms that are infrequently used, and may be heated or cooled needlessly.So, they built control system called Lighting, Heating, Venting, and Air conditioning system (L-HVAC).
This created multivariate Gaussian and agent-based prediction models for describing occupancy and movement behaviour and accordingly set energy aspects on/off .L-HVAC said that energy could then be saved from 5-14% comparing to the other energy saving strategies (Erickson et al. 2009).Several other work in the same aspect is been presented by researchers using different techniques like: energy saving based on Web service and ontology techniques in a cloud environment by Yang (2013), gARTMAP; a multi-agent system for building heat management system by Mokhtar & Howe (Mokhtar, et al. 2014), and a multi-agent system by Davidsson and Boman to control an office building (Davidsson & Boman, 2005).

The Home Cooling Optimizer (HCO)
In this research we introduced an intelligent multi-agent system named the home cooling optimizer system (HCO).It consists of six different agents and each has its own goals and objectives.They engage artificial intelligence methods to achieve their goals.They interact with one other and exchange information with user and the environment properties in pursuit of achieving the main system objective.The main HCO system objective is to optimize the home cooling system to reduce cooling energy consumption and costs and maintain the householders' comfort.Figure 1 is an architecture design for HCO system.The architecture defines the main components of temperature as well as the interactions among these components.

Modeling Agent
The modeling agent works in the configuration phase to learn about the parameters of home thermal.To achieve this, the modeling agent receives 24 hours observations of external and internal temperature from information agent.This information has been used to create thermal model with envelope: The temperature of envelope in any time slot t should be given by: Moreover, simple thermal model will be modified to the following: Where,    is the envelope temperature at time slot t (Rogers, et al. 2011;Perera, 2014).T   refers to external temperature at time slot t.T �   refers to internal temperature at time slot t.The observed internal temperature data is fit into the model by non-linear regression method of data fitting to learn the home thermal parameters.These parameters are thermal production power, thermal leakage rate, and the envelope.The modeling agent finds the best estimates of home thermal parameters and passes them to the optimizer agent.

Optimizer Agent
The objective of optimizer agent is to find the optimized cooling consumption behaviour.In other words, it determines when the cooling system should switch the cooling on or off, in order to reduce the cooling costs by maintaining the comfort of householder.The optimizer agent interacts with the user interface agent to receive the desired temperature, budget of cooling hours, and comfort hours, i.e., the hours that are required by householders to be comforted.

Optimization of Cooling Systems
Optimization is the procedure of finding the minimum or maximum value of a function by choosing a number of variables subject to a number of constraints (Yang, 2014).The aim of optimization could be minimize the consumption and costs of energy, maximizing the income, performance, or efficiency.Optimization is useful everywhere, because resources, time, and money are valuable resources that are always limited in real-world applications and there has to be solutions to use them optimally under various constraints (Stephen, n.d).In other words, searching the thermal model space to decide in which time slots of the day, the air conditioner should be 'on' or 'off' to maintain householders' comfort while reducing cooling consumption costs.Suppose that the day is divided into a set of discrete time slots t ∈ Time is the time slot, in which the householder needs to be comfort or (comfort hours) and the desired temperature T desired should be known.
Where, T t is the predicted internal temperature by thermal model in the time slot t.
Then, the objective of the algorithm of cooling consumption optimization is to find the time slots, in which the air conditioner should be on, so the largest decrease in discomfort value would occur.Three optimization algorithms depend on heuristic search have been applied to this work:

The Greedy Algorithm
This algorithm uses greedy heuristic search in an attempt to find a local optimum solution in a series of stages.It makes best decision by searching all possible probabilities at every stage with the hope of eventually reaching a globally optimal solution.The decisions, which have been made at earlier stages, cannot be changed during later stages (Rogers, et al. 2011;Stephen, n.d;Huang, n.d).To apply the budgeted greedy algorithm in this work, all slots of daytime have been tested consecutively, what if turning the air conditioner during these slots.All time slots have been tested again, but with the consideration of last stage solution.This algorithm is known as budgeted, because it iterates until the specified budget has been reached.

The Stochastic Algorithm
In this algorithm, the technique of random heuristic search has been used, which has picked up a probability randomly at each searching stage to find the optimal solution (Moura, 2009).Here, time slots of one day are first randomly assigned on/off values for the air conditioner within the limits of specified budget.The next step is to swap their 'on/off' values, then compare the resulted discomfort value before and after the swapping.The 'on/off' values set that makes the largest decrease in discomfort value has been fixed as a temporal solution.The algorithm keeps trying another random swap until certain specified maximum number of trials has been reached.

The Simulated-Annealing Algorithm
The simulated-annealing algorithm uses random heuristic search technique.It is a general probabilistic algorithm for optimization problems.It uses a process of annealing that it accepts solution changes within a particular probability to avoid being trapped in local minima (Busetti, 2003).First to apply the simulated-annealing algorithm, one day time slots have been first randomly assigned on/off values of air conditioner within the limits of specified budget.This algorithm then randomly picks up one time slot, in which the air conditioner has been assigned 'on' value and randomly picks up another time slot, in which 'off' value has been assigned to the air conditioner.The next step is to swap their 'on/off 'values, and then compare the resulted discomfort value before and after the swapping.Here, the decision of what 'on/off' values set to be accepted as a solution at the current stage has been made with the probability: Where, ∆D is the change in discomfort and T is the temperature control parameter.After each stage, the temperature control parameter T is slightly reduced to reduce the probability P as the search progresses.The algorithm keeps trying random swaps until certain specified maximum number of trials has been reached.As the search continues and T reduces, the search space around optimal solution has become limited (Busetti, 2003).

Practical Application with Matlab
MATLAB has been used for implementation of aforementioned optimization algorithms.The main variables that were used in these algorithms to optimize cooling consumption are defined as follows: 1) The variable COOLon∈ {1,0} for every t ∈ Time such that COOLon = 1, if the air conditioner is cooling actively and 0 otherwise; 2) The variable COMFORTon∈ {1,0} for every t ∈ Time such that COMFORTon t = 1,if the time slot t is specified by householder as time to be comfortat and 0 otherwise.TheCOMFORTon value in any time slot t is given by: 3) The discomfort value D is only calculated in the comfort area or for every t ∈ Time such that COMFORTon t = 1.
The optimization algorithms are implemented according to thermal model with envelope in Formula ( 2) by non-linear regression method of data fitting.Algorithms ( 1) and ( 2) represent pseudo codes for budgeted greedy algorithm and the simulated-annealing algorithm implementation.The budgeted greedy optimization algorithm has been used by optimizer agent to search the current slot space of day time to find the best times of day to switch the cooling 'on' to best achieve the desired temperature in the comfort hours within the limits of budget.The resulted optimized cooling consumption behavior is passed to the cost calculator agent.

Cost Calculator Agent
The predicted internal temperatures, according to the optimized consumption behaviour, have been received from optimizer agent.The costs of optimized cooling consumption have been estimated for one-month bill according to the pricing method of Saudi Electricity Company.The estimated cooling cost has been passed to the user interface agent.

User Interface Agent
The user interface agent defines the setting preferences of three systems.These preferences are the desired budget of cooling hours, desired temperature, and comfort hours.The user interface agent interacts with the householder to receive these setting preferences then pass them to the optimizer agent.Then, the user interface agent interacts with optimizer agent to obtain the predicted internal temperatures, according to the optimized consumption behaviour and display them as a chart that clarifies the variability of predicted temperatures during the current day.The user interface agent has been designed to be interactive with householder, such that he/she can change the values of setting preferences and get differently presented results with every change.When the householder is satisfied with the displayed result, he/she submits these results to the optimizer agent.

Controller Agent
The controller agent receives optimized consumption behaviour submitted by the householder from optimizer agent.It controls the cooling system accordingly i.e., switch the cooling on or off according to the optimized consumption behaviour by the optimizer agent.

Optimization Algorithm
The optimization algorithms have been tested on thermal models with envelope created for Houses (A, B, E, G, K) in the period from 15 -17 June, 2013.This testing aims to evaluate the quality results and run times of optimization algorithms.In testing, the budget was suggested to be 12 hours of cooling in a day, while the comfort hours are 15 hours in total and the desired temperature was set to 18 ̊ C. The evaluation of results quality has been performed according to the total discomfort value D given by Formula (4).Accordingly, the smaller the discomfort values, the closer are the satisfaction of householder.Run times are measured in Seconds.Table 1 shows the resulted discomfort value averages and run times by using three algorithms.

Evaluation of Run Time
From testing results, the budgeted greedy exhibits the best case run time as compared to stochastic and the simulated-annealing, which have approximately similar run times.In general, these algorithms may have different run times according to the work case.However, in present study, the day was divided into 144 time slots; with a period of 10 minutes each.Then, the greedy algorithm is looping (144*budget value) times, while the stochastic and simulated-annealing have been looping 10,000 times which is the specified maximum number of trials.

Evaluation of Quality Outcomes
The qualities of three algorithms results are approximately the same.But, these results should be evaluated in comparison with expected consumption of regular householders to demonstrate how the optimization algorithms would reduce consumption and costs and maintain the householders' comfort.The householders are expected to turn on the air conditioner during his/her comfort hours.Table 2 shows the resulted discomfort values and their averages accordingly.It is noticeable that the discomfort averages are almost same before and after adding the optimization process.However, the budget in the expected consumption behaviour is equal to the comfort hours, which is 15 hours instead of 12 hours in the optimized consumption.According to Saudi Electricity Company pricing method, the budget is rational to cost price such that as the budget rises, the cost rises.Estimated cost prices have been calculated according to the expected and optimized consumption, as described in section 3. The cost price according to the expected consumption behaviour is 84.16Saudi Riyals/month, while the cost price after reducing budget by using optimization algorithms is 57.60 Saudi Riyals/month.These results indicate a reduction in cost price by 31% in the optimized consumption, which has been reduced by 20%.

HCO System GUI
The graphical user interface of the system accepts the user thermal preferences, and then displays the current temperature reading and the resulted optimized temperatures as chart to the householder.The displayed chart clarifies the plot of three data sets: • The predicted temperatures after optimization for the current day.
• The desired temperature, comfort periods, as specified by the householder.
• The cooling periods i.e. the periods in which the cooling system generates cooling.
These data sets are displayed to give the householder the ability to visually evaluate the resulted optimized temperatures.The system GUI also displays the estimated cooling cost for one month.The system GUI allows the householder to reset and change his/her preferences inputs until he/she satisfies about the displayed results.
Then, the householder 'Submit' the last optimization results for the system to start control the home cooling system accordingly.Figure 5 shows the system GUI displaying an optimized temperature chart after the acceptance of householder preferences.
Figure 5. Main screen of HCO graphical user interface with optimized temperature chart

Conclusion
An agent-based home cooling system has been proposed and developed in order to minimize and control the consumption of cooling energy while maintaining the comfort level of householders.In order to accomplish this objective, two fundamental procedures have been carried out.These procedures include thermal modeling to learn the thermal parameters of home and optimization process to optimize the cooling consumption.For evaluation of the Optimization of Cooling Systems, three optimization algorithms have been implemented.These algorithms are known as budgeted greedy, the stochastic and simulated-annealing.These algorithms have been applied to optimize the cooling consumption of 5 houses for three days.The budgeted greedy algorithm exhibits the best case run time.Results quality has been observed to be same for the three algorithms in comparison to each other.

Figure 1 .
Figure 1.Architecture and data flow of HCO system Figure (2) clarifies the components of information agent and data flows between it and the other agents in HCO system.

Figure 2 .
Figure 2. Architecture of information agent

Figure 3 .
Figure 3. Sample for home thermal model

Algorithm
Figure (Note 1) 4shows the predicted temperatures for House E by applying the expected householder's consumption behaviour and optimized consumption by budgeted greedy algorithm, the stochastic algorithm, and simulated-annealing algorithm.

Table 1 .
Summary of the comparison of optimization algorithms

Table 2 .
Values of Discomfort according to Expected Consumption of Householders