smart home - teiresias -...

75
Czech Technical University in Prague Faculty of Electrical Engineering Master's Thesis Smart Home - Teiresias by Bc. Martin Hasaj Thesis supervisor: Ing. Pavel Kordík Study program: Electronics and Informatics Subject: Software Engineering May 2009

Upload: vothu

Post on 23-Feb-2018

213 views

Category:

Documents


0 download

TRANSCRIPT

Czech Technical University in PragueFaculty of Electrical Engineering

Master's Thesis

Smart Home - Teiresias

by

Bc. Martin Hasaj

Thesis supervisor: Ing. Pavel Kordík

Study program: Electronics and Informatics

Subject: Software Engineering

May 2009

ii

Acknowledgement

I would like to thank my relatives who stood by me during my studies and my friends who always gave me motivation to work harder.

I would like to thank those without whose consideration I wouldn't be able to write this work:

To Neural Group at Computer Science Dept. at FEE CVUT for Fake GAME.

To Computer Science Dept. at FEE CVUT for KNX testing environment.

To Roc Messeguer, for his dedication towards his students and my work.

To Pavel Kordík, for leading my project towards successful end.

And to all my friends and colleagues for being patient while writing thesis.

iii

iv

Declaration

I hereby declare that this master's thesis is my own work and effort and that I have listed all other sources of information, literature and publications used.

I have no objection to use of this work in compliance with the Article §60 of Act 121/2000Sb. (copyright law), and with the rights connected to the copyright law including further amendments of the Act.

In Prague 22nd May 2009 ..............................................................................

v

vi

Abstract

A great deal of contemporary research is showing that it is not work that goes home but home that goes to work. I would like to write my thesis about smart home possibilities (theoretically), which are available, or proposed to the market. Then I would like to design (practically) part of smart home according to available technologies. I am more considered with the software part of the problem, but I want to use real hardware if it would be possible rather then a simulator.

Software should be portable, written in JAVA, using Open Source Solutions and Technologies. It should be able to manage all smart home interfaces and extensible. Brain of the system should be Neural Network, which should be able to learn automatically the inhabitants' behaviors and help them in their everyday routine. “Make technologies disappear and you have succeeded.”

For example, if system finds out that some switch is turning on every time after doors are open, it will turn it on automatically. But it should consult this decision in the beginning to avoid collisions with human decision (according to Asimov rules). These shall avoid starting mixer with nothing in it, or even turning lights on when nobody is at home.

The system shall communicate through the network, which could be wired, or wireless. After searching the technologies available I decided to concentrate on open standard KNX.

Abstrakt

Množstvo súčasných výskumov poukazuje na to, že už viac nie práca prichádza domov, ale domov sa presúva do práce. Preto by som sa chcel v mojej práci zamerať na možnosti inteligentných domov (teoreticky), ktoré sú dostupné na trhu, alebo je ich príchod na trh ohlásený. V ďalšej časti sa chcem venovať návrhu (prakticky) časti systému inteligentnej domácnosti v závislosti na dostupných technológiách. Jadro môjho záujmu tvorí softwarové riešenie problému, chcel by som však na overenie funkčnosti použiť skutočný hardware radšej ako simulátor.

Software by mal byť prenosný, napísaný v JAVE, použitím Open Source riešení a technológií. Mal by byť schopný ovládať všetky rozhrania inteligentného domu a byť rozšíriteľný. Mozog systému bude tvoriť neurónová sieť, ktorá sa musí byť schopná učiť automaticky správanie sa obyvateľov a pomáhať im v každodenných úlohách. „Nechaj technológie zmiznúť a máš vyhrané.“

Napríklad, ak systém zistí, že niektorí vypínač sa zapína vždy po otvorení dverí, systém ho zapne automaticky sám. Ale toto rozhodnutie musí byť v úvodnej fáze učenia konzultované s užívateľom aby sa predišlo kolíziám s ľudskými rozhodnutiami (v súlade s Asimovími pravidlami). Toto by malo zamedziť zapínaniu mixéra pokiaľ je prázdny či blikaniu svetiel keď nikto nieje doma.

Systém by mal komunikovať po sieti a to či už klasickej či bezdrôtovej. Po preskúmaní vhodných technológii som sa rozhodol koncentrovať na otvorený štandard KNX.

vii

viii

Table of contentsIntroduction.............................................................................................................................11.Smart Homes.......................................................................................................................2

1.1.Background of Smart Homes........................................................................................21.2.Smart Home Issues......................................................................................................21.3.Area of Possible AI applications...................................................................................3

1.3.1.Spatio-temporal Reasoning...................................................................................31.3.2.Temporal Granularity.............................................................................................31.3.3.Casual Reasoning.................................................................................................31.3.4.Planning................................................................................................................41.3.5.Learning................................................................................................................41.3.6.Case-Based Reasoning........................................................................................41.3.7.Decision Trees......................................................................................................41.3.8.Neural Networks....................................................................................................51.3.9.Multi-agent Systems..............................................................................................5

2.Artificial Neural Networks.....................................................................................................62.1.Overview.......................................................................................................................62.2.Model of Neuron...........................................................................................................62.3.Network Architecture....................................................................................................7

2.3.1.Feed-Forward Architecture....................................................................................82.3.2.Recurrent Neural Network.....................................................................................82.3.3.Time-Delay Neural Network..................................................................................8

2.4.Learning process..........................................................................................................82.5.Activation Function.......................................................................................................92.6.Learning Function ........................................................................................................92.7.Application of Neural Networks in Smart Home Environment ......................................92.8.ANNs for Control of Smart Home Devices and Appliances.........................................11

2.8.1.Entertainment......................................................................................................112.8.2.Safety and Security.............................................................................................112.8.3.Caregiver............................................................................................................122.8.4.Health Monitoring................................................................................................12

3. Fuzzy Systems..................................................................................................................133.1.Fuzzy logic..................................................................................................................133.2.Fuzzy control..............................................................................................................14

3.2.1.Fuzzification........................................................................................................143.2.2.Fuzzy inference...................................................................................................143.2.3.Defuzzification.....................................................................................................14

3.3.Fuzzy ART Neural Network........................................................................................144.Genetic Algorithms.............................................................................................................16

4.1.History........................................................................................................................164.2.Biological background.................................................................................................16

4.2.1.Chromosome.......................................................................................................164.2.2.Reproduction.......................................................................................................164.2.3.Genetic Algorithms basics...................................................................................16

4.3.Operators of Genetic Algorithms.................................................................................174.3.1.Encoding of a Chromosome ...............................................................................174.3.2.Crossover ...........................................................................................................174.3.3.Mutation .............................................................................................................17

4.4.Parameters of Genetic Algorithms..............................................................................184.5.Selection.....................................................................................................................18

4.5.1.Roulette Wheel Selection ...................................................................................195.FAKE GAME......................................................................................................................21

5.1.Automated data preprocessing...................................................................................21

ix

5.2.Automated data mining ..............................................................................................226.KNX....................................................................................................................................23

6.1.KNX basics.................................................................................................................246.2.Testing environment design........................................................................................256.3.KNX@Home...............................................................................................................25

6.3.1.Basic conditions for the live CD...........................................................................266.3.2.Architecture.........................................................................................................26

6.4.KNXLive!.....................................................................................................................276.5.Calimero.....................................................................................................................28

7.Teiresias Application..........................................................................................................297.1.Adaptability of Neural Network....................................................................................297.2.Scenarios....................................................................................................................30

7.2.1.Bathroom/Corridor Lights according to ambient light level...................................307.2.2.Leaving home routine..........................................................................................317.2.3.Coming home routine..........................................................................................317.2.4.Ventilation – keeping balance of humidity, co2 and temperature.........................327.2.5.Heating in different weather and humidity conditions..........................................327.2.6.Decision priority of users.....................................................................................337.2.7.Volume control with active noise cancellation.....................................................347.2.8.Phone calls handling...........................................................................................357.2.9.Custom plants watering schemes........................................................................367.2.10.Fresh boiled coffee replaces alarm clock..........................................................377.2.11.Turning off multimedia devices after everybody falls asleep..............................387.2.12.Turning lights on wherever you move, one step ahead.....................................397.2.13.Sun blinds control sun intensity.........................................................................397.2.14.Intelligent fridge with storage control.................................................................397.2.15.Emergency smoke detector...............................................................................40

8.Design................................................................................................................................418.1.Application use case...................................................................................................428.2.Package structure.......................................................................................................438.3.Components...............................................................................................................438.4.Deployment................................................................................................................448.5.Implementation...........................................................................................................458.6.Proof of concept..........................................................................................................45

9.Conclusions........................................................................................................................4610.Future Works....................................................................................................................47List of shortcuts.....................................................................................................................48Bibliography..........................................................................................................................49APPENDIX A KNX Testing Environment Schema.................................................................51APPENDIX B GAME Training Input Data Sets......................................................................52

x

List of figuresActivity similarities between (a) a computing neuron and (b) a biological neuron....................6Structure of a (a) Feed-Forward neural network (b) Recurrent neural network, RNN (c) Time-Delay neural network, TDNN...................................................................................................7Linguistic variable 'luminance' defined with three membership functions..............................13GA - Roulette Wheel Selection..............................................................................................19Situation before ranking (graph of fitness).............................................................................19Situation after ranking (graph of order numbers)...................................................................20FakeGame schema...............................................................................................................21Computing strategy of the distance of two neurons...............................................................22KNX logo...............................................................................................................................23KNX Applications..................................................................................................................23KNX Physical communication media.....................................................................................24KNX addressing....................................................................................................................24KNX testing environment.......................................................................................................25KNX@Home Application Overview.......................................................................................25Architecture of KNX@Home Project......................................................................................26KNXLive! architecture............................................................................................................27Calimero Architecture Design................................................................................................28TV volume dependency if only TV is ON...............................................................................34Music volume dependency if only music is ON.....................................................................34TV volume dependency if everything is ON...........................................................................35Music volume dependency if everything is ON......................................................................35Inaccurate recorder dependency on motion and phone ringing.............................................36Accurate recorder dependency on motion and phone ringing...............................................36Coffee Scenario Decision Tree..............................................................................................38Teiresias Architecture............................................................................................................41Use Case Diagram................................................................................................................42Package Diagram..................................................................................................................43Component Diagram.............................................................................................................43Deployment Diagram.............................................................................................................44Teiresias Application GUI Screenshot...................................................................................45

xi

List of tablesList of the main devices that require automation in smart home...........................................11Significance of Bathroom Scenario Inputs.............................................................................31Significance of Leaving Home Scenario Inputs.....................................................................31Significance of Incoming Home Scenario Inputs...................................................................32Significance of Ventilation Scenario Inputs............................................................................32Significance of Heating Scenario Inputs................................................................................32Significance of Priority Scenario Inputs.................................................................................33Significance of Volume Control Scenario Inputs....................................................................35Significance of Watering Scenario Inputs..............................................................................37Significance of Multimedia Scenario Inputs...........................................................................38Significance of Lights Scenario Inputs...................................................................................39Significance of Sun blinds Scenario Inputs............................................................................39Significance of Fridge Scenario Inputs..................................................................................40Significance of Smoke Scenario Inputs.................................................................................40Bathroom Scenario from chapter 7.2.1. Raw input data........................................................52Bathroom Scenario from chapter 7.2.1. Prepared optimized Data........................................53Leaving Home Scenario from chapter 7.2.2..........................................................................54Returning back Home Evening Scenario from chapter 7.2.3.................................................55Ventilation Scenario from chapter 7.2.4.................................................................................56Heating Scenario from chapter 7.2.5....................................................................................56Priority Scenario from chapter 7.2.6......................................................................................57Volume Control Scenario from chapter 7.2.7........................................................................57Phone Recorder Scenario from chapter 7.2.8......................................................................58Time-shifted Recorder Scenario from chapter 7.2.8..............................................................58Plants Watering Scenario from chapter 7.2.9.......................................................................59Time-shifted Plants Watering Scenario from chapter 7.2.9...................................................59Coffee Scenario from chapter 7.2.10.....................................................................................60Time-shifted Coffee Scenario from chapter 7.2.10................................................................60Multimedia Scenario from chapter 7.2.11..............................................................................61Lights Scenario from chapter 7.2.12.....................................................................................62Sun blinds Scenario from chapter 7.2.13...............................................................................62Fridge Scenario from chapter 7.2.14.....................................................................................63Smoke Scenario from chapter 7.2.15....................................................................................63

xii

IntroductionA great deal of contemporary research is showing that it is not work that goes home but

home that goes to work. Basic Idea of all this research is to make life as easy for inhabitants as possible. “Make control process disappear and you have succeed”.

For example, if system gathers that whenever somebody opens doors to the bathroom, it turns the lights on. It can automatically turn on lights whenever doors are opened. But it should consult its actions to avoid collisions with human decision (according to Asimov rules). These shall avoid starting empty devices if it is not necessary, or even turning lights on when nobody is at home and wasting of energy ( except necessary rules according to security policies).

In 2001, Orange, a UK mobile network operator, announced the “Orange at Home” project, a smart house incorporating the latest technology wizardry built some 20 miles north of London. It was intended to be more than a mere showcase, with plans for real families to move in and live with the smart home.

In 2002, Intel launched the proactive health research project, while in 2000, Sun Microsystems and Invensys announced the development of "smart home" infrastructure to accelerate the delivery of services to wired appliances in the home. Also, C.P. Technology has used IBM's web sphere and developed the high tech "smart home" for marketing from the year 2004.

More applications are discussed at Chapter 2.7 with concern on Artificial Neural Network in Smart Homes environment.

My goal is to develop autonomous smart home system, which will be portable, robust, extensible and smart enough to help inhabitants make life easier in everyday situations without disturbing them. I want to prepare system, which will be easily reconfigured for new sensors and controllers set configuration without necessary long-term time consuming configuration and debugging process. This can be achieved by selecting technologies which can learn and adapt to changing environment of smart homes autonomously.

More specifically, I would like to concentrate on development of implementation of neural network which will serve particular needs of virtual home inhabitants. These needs shall be defined as subset of real problems set. After proving ability to learn I would like to test behavior on real hardware. Furthermore, I would like to test possibility of solving more complex situations as well.

1

1.Smart Homes

1. Smart Homes

1.1. Background of Smart HomesTo effectively address the needs within the realms of the 'Smart Homes'[1], environment

requires a multidisciplinary collaboration. Such developments will usually involve specialists from Architecture, Computer Science, Electrical and Electronic Engineering and some applications related to the health sector may also require participation of professionals from Social Sciences, Medicine and Occupational Therapy. Within this text I will try to address only a part of this huge discipline. I will discuss possibility of smart homes to help inhabitants in everyday routine without necessary system maintain which is common for smart homes in general.

The use of Smart Homes is focused on support of independent living needs. There is possibility of designing an intelligent monitoring system that can detect when an undesirable situation may be developing ( hazard, security threat, etc). Although all people can be involved in such undesirable situations, elderly people and people with health problems require more exhaustive monitoring when they are not accompanied by a health care professional.

Smart Homes are usually equipped with embedded devices that can enhance the functionality of conventional domotics appliances. ‘Sensor’ is a keyword in this area. By this we understand a coupling of hardware and software that is installed in one or more locations of the house and can provide information about what is happening inside the house or in its vicinity. Examples of these can be a movement sensor, a smoke alarm and a timer fitted in a microwave. There are also enriched devices which besides providing information can also accept it, e.g., a tap can provide information detailing how long it has been turned on for and conversely the water flow to the tap can be remotely stopped.

Most of the work focused in the literature is devoted to individual sensors/devices that can bring new services. My goal is to reach a second, and more evolved stage it has to introduce more AI-related problem solving strategies so that all the sensors available can be used to form : (a) a more robust system combining different sources of information in order to provide a more global insight into the activities of a patient and (b) a more flexible executing tool as the circumstances in which the semi-autonomous devices have to act can be better identified having a global view of the activities inside the home.

The essential point here is that, according to my experience, Smart Homes can be much more intelligent with less effort for maintenance than they currently are. Problem of nowadays systems is not their usability, but their user-unfriendly ( or maintenance-unfriendly) nature which comparing to their high price inhibit their wide spreading between end users. On one side is nice to have perfect system prepared in lab, but if you have to spend few months to debug it before possibility to apply it commercial, it is not as much useful as it would seem.

1.2. Smart Home IssuesFrom recently developed Smart Homes system we can learn a lot of essential data, which

can help develop system which is accurate, easy to maintain and robust. Problems which exist are usually devoted from lack of contextual information of systems. There are documented some issues when owners of such “SMART HOMES” were complaining about their houses controlling them instead of vice versa desired behavior. For instance there were incidents of doors opening automatically in front of potential thief while owner was walking

2

1.Smart Homes

toward doors and otherwise had been closed and locked after owner went out to check his mailbox and kept doors open, because he left keys at home. This undesired behavior must be avoided under any circumstances, that is why it is important to implement security policies, which prevent this kind of behavior of AI Smart Homes.

1.3. Area of Possible AI applicationsAI techniques can be used to contribute to the development of Smart Homes in many

ways. The Sections below exemplify this further, however, this should not be considered as an exhaustive set of possibilities but more an opportunity to offer some concepts of how the various levels of applications waiting to be explored may be deployed.

1.3.1. Spatio-temporal ReasoningAnalysis of the activities developed in the Smart Home should not be based on visual aids

due to privacy issues. Instead it should be based on the information obtained from the sensors. It is vital in this process for the system to be aware of the places visited by the inhabitant and the order of events generated as well as their duration.

For example, it is fundamental to the understanding of a situation to be able to consider in which order the places where visited and realizing that by being in bed last the resident is now in a passive position and hence is more likely to forget about taking care of what has been left on the cooker. Detection of position can be achieved via the movement sensors in each room; to disambiguate some situations RFID detectors are needed which helps to distinguish between more residents of same flat or even visitors and pets.

Spatio-temporal reasoning is fundamental here to reason about where the resident can be and according to the time elapsed to diagnose if action is required. The whole situation of leaving the cooker on followed by a period of time where the resident goes outside the kitchen leaving the cooker unattended is a complex event, depending on the condition that it takes more time than it is considered safe, this may or may not constitute a situation of interest for the monitoring system. Here qualitative as well as quantitative temporal reasoning is required to differentiate between these situations.

1.3.2. Temporal GranularityActivities can be monitored at many different levels in terms of information granularity.

Choosing the right level of information granularity is not trivial and can have important consequences in terms of what the system can achieve and how well it can perform in terms of efficiency.

There are reasoning activities that may demand to analyze only one, two or three successive activities and for that a few seconds are enough but to infer a trend a much more global view spanning for several minutes or days may be needed. For some diagnostic tasks low levels of time granularity are needed to allow the system to infer that the inhabitants are in regular movement because of the speed at which they are moving through the successive rooms. But for other diagnostic tasks a way of abstracting different views of the system in terms of the different granularity levels of temporal information is very important.

1.3.3. Casual ReasoningCertainly the relation between the actions performed by the inhabitants and the resulting

states is a fundamental part of an automated diagnosis system however this issue has not yet been considered from the perspective of information analysis in Smart Homes and it is not clear, for example, what system will be most effective in predicting possible outcomes given a trend of behavior of residents.

Suppose the cooker has no timer, it will stay on and if it persists in that state for a sufficiently long time the food may be burnt with the consequent possibility of causing a fire

3

1.Smart Homes

and subsequently generating a call to the fire brigade. Persistence coupled with causal reasoning is fundamental here to predict possible outcomes and help the system to react in order to avoid potential problems. Also of relevance here is the detection of complex events.

1.3.4. PlanningPlanning can be applied to the use of Smart Homes for health care. For example,

according to the patient’s demands for medicines, a plan can be constructed regulating medication intake hence its application or realization by the patient can be monitored by the system reporting instances of non-compliance or significant deviations from the prescribed medication regimen.

Other scenario is shopping planing. Before your fridge goes out of food system can plan shopping event, enter order into e-shop and let it deliver on time. Which means that resident would not realize it was running out of stock.

1.3.5. LearningLearning about the behavior of the inhabitants is essential in order to self-tune the system

to further support the personalized independence the Smart Home can offer. Even when a system is prescribed for a Smart Home environment, different homes would have different conditions and habits which have to be taken into account for the system to be useful. For example, the normal time for a resident to be in bed may be from 11PM to 7AM and s/he may be expected every day to be up and active at 7:30 AM. Detecting this is not the case will be a cause for concern, while for others at 9AM will be the normal time and being waken up at 7:30 AM by automatic coffee machine would be inappropriate.

Data Mining is useful here in order to learn new information from the statistics of the system, which can then be focused on a single person, group of residents sharing a specific condition, or in a more heterogeneous group of people using system of Smart Homes. These learning capabilities are essential for correct predictions.

1.3.6. Case-Based ReasoningCBR can be used to identify patterns of person behavior. This can be used for diagnosis

of situations which need urgent reaction on behalf of the system.

Sometimes deviations from the expected time for taking meals or going to bed can be expected as daily activities can be changed by visits or exceptional events which are not related to long term change of habits and don't need any change of learned patterns. Differentiating these issues on the basis of contextual and historical information poses a real challenge for a diagnostic system to give useful advice whilst minimizing the chances of making false decisions.

1.3.7. Decision TreesDecision Trees may be used to monitor the sequence of events within the home and allow

the monitoring system to react accordingly, especially in instances of concern where the person requires a form of intervention. Within the home environment it is common that sequences of events will be repeated, some of which will lead to hazardous situations requiring intervention and others can be considered as normal behavior. These events, although occurring at different instances in time, should result in similar resulting supporting actions by the system. Although finite, it is possible to identify a large set of repeating actions with moderately varying degrees of support required.

For example, the system suggesting a possibility that the TV has been left on has different risks involved than when it is suggesting the possibility that the cooker has been left on. Although the aforementioned are at the most simplistic levels they may be supported by such an approach. More intricate sequences and outcomes can be detected by longer term

4

1.Smart Homes

monitoring and profiling of activities which can be used as the basis to form the decision model and where appropriate introduce the notion of time.

1.3.8. Neural NetworksNeural Networks have long been established as powerful tools for classification and

prediction. The vast array of topologies and supervised and unsupervised methods of learning offer the potential for a number of solutions to the management and processing of information within the Smart Home. For example, from a monitoring perspective Time Delay Neural Networks can be used to represent temporal relationships and hence within the given context of Smart Homes they can be used to predict likely activities of the person based on a preceding set of actions over time. Considering the scenario described in the beginning of this chapter, the activities of the person and their time dependencies can be used as continuous inputs to the network and the output of the network can be trained to either automatically ’turn off the cooker’ as in the scenario described above or for a more generic sequence of time related events, it can automatically raise an alarm to the authorities.

1.3.9. Multi-agent SystemsMAS can be used as a development paradigm where a house is monitored for a group of

agents with different skills and duties. The application of agent-oriented technology to smart homes environment is an area which is receiving increasing attention in the research community especially in medical care.

The mentioned scenario can be assisted at a design level by including MAS-related developing methodologies where different parts of the system are seen as interacting agents with specific skills and monitoring duties. For example, an agent can be designed to monitor activities in the kitchen and another in the living and another in the bedroom or there can be agents specialized in different types of sensors. Hence, while one is dealing with devices another is in charge of movement monitoring sensors. Conclusions in the system can be reached after deliberation of different agents and by using different techniques related to the representation of consensus and disagreement.

5

2.Artificial Neural Networks

2. Artificial Neural Networks

2.1. OverviewAn Artificial Neural Network (ANN)[2] or alternatively known as Neural Network is a

computational tool, which follows the activities of a biological brain. The basic processing unit of ANNs is a neuron [3], which has similarity with a biological neuron, first described by Cajal in 1911. ANNs learn relationships between the inputs and outputs from examples presented to the networks without any prior knowledge about the underlying relationships that exist within the data sets. This important ‘adaptive’ attribute of the ANNs makes it suitable for many applications where there is very little or no information available regarding the input-output relationships or the underlying transfer function among the data [4].

There are many standard texts [5][6] that describe the history of ANNs and the links that exist between the operations of the biological and artificial neurons. An ANN is usually characterized by:

• the way the neurons are connected to each other, • the method that is used for the determination of the connection strengths or weights

the activation function that is used to process the data.

2.2. Model of Neuron

Figure 2.1: Activity similarities between (a) a computing neuron and (b) a biological neuron

As already stated a neuron is the fundamental unit of the ANN. A neuron takes a number of inputs and after some mathematical processing it produces an output. Each neuron is connected to the other neurons by means of links that have weights, which represent strengths of the connections. Figure 2.1 compares a computational (artificial) neuron and a biological neuron. The inputs to the neuron signify activities of the dendrites of a biological

6

2.Artificial Neural Networks

neuron. The weights on the edges represent the activities of synapses, the mathematical equation shown in the circle is a representation of the soma, and the calculation of the output of each neuron signifies the axon. Generally, a neuron in an ANN has more than one input nodes but only one output. The weights shown on each connection line represent information to be used in processing the input signals to build the ANN model of the problem. The mathematical function used by each neuron to calculate the output is called the activation function. There are different types of activation functions used for processing the incoming signals, some of which are briefly discussed in section 2.5.

2.3. Network ArchitectureThe way the neurons are connected to each other can be visualized using the network

architecture. Depending on the position of the neurons in an ANN three layers are defined: input layer, hidden layer and output layer. There may be none or more than one hidden layer in an ANN which primarily depends on the complexity of the problem. Researchers have proposed different types of network architectures that are suitable for solving their own particular problem. However, the most popular and widely used network architectures include: feed-forward fully connected neural network, recurrent neural network and time-delay neural networks.

Figure 2.2: Structure of a (a) Feed-Forward neural network (b) Recurrent neural network, RNN (c) Time-Delay neural network, TDNN

7

2.Artificial Neural Networks

2.3.1. Feed-Forward ArchitectureIn a feed-forward neural network (Figure 2.2(a)), the neurons of each layer are connected

to the next layer only in the forward direction, i.e., neurons are connected in unidirectional way and there is no backward connection among the neurons. Figure 2.2(a) illustrates the structure of a three layer feed-forward fully connected neural network. Feed-Forward ANN has a relatively simple architecture to map the input-output relationship to automate devices (e.g., face recognition, temperature control, fire alarm, etc), which can be applied in a smart home environment.

2.3.2. Recurrent Neural NetworkThe structure of a recurrent neural network (RNN) is the same as the feed-forward ANN

except that, there is a connection between neurons that feeds back the output of that neuron to the input of the previous neuron. Figure 2.2(b) illustrates the structure of a RNN. Here the outputs are fed back into the hidden layer, thus the structure representing a RNN. A RNN is normally efficient for dealing with a sequential problem where the current state depends on past states of the same variable (e.g., human behavior prediction in a smart home).

2.3.3. Time-Delay Neural NetworkA time delay neural network (TDNN) or also known as Tapped Delay Line (TDL) is a

temporal network where the input pattern is fed into the network by introducing a delay in time. The successive representation of input data sequences facilitates the network to adapt to the temporal behavior of the problem (e.g., daily activities of a smart home inhabitant). TDNN can be quite useful for those problems where both the temporal information and the relationship between the input/output data sequences are important. Figure 2.2(c) illustrates the architecture of a TDNN, here the successive inputs have been delayed by λ.

2.4. Learning processOne of the main characteristics that make ANNs unique from other mathematical

processing methods is that it can learn from the characteristics of the data and adapt parameters of the network according to the underlying structures in the training dataset. The process is known as learning. As defined by Haykin [3]:

“Learning is a process by which the free parameters of a neural network are adapted through a continuing process of stimulation by the environment in which the networks are embedded. The type of learning is determined by the manner in which the parameter changes take place”.

Depending on the learning environment there can be fundamentally two different learning paradigms: supervised learning and unsupervised or self-organized learning. As the name suggests, in a supervised learning paradigm the ANN is trained under a guided supervision, i.e., there is target output(s) that the ANN aims to achieve during the learning/training process. On the contrary, in unsupervised learning there is no external supervisor to facilitate ANN’s learning: the distribution of the data and the structural similarities amongst the dataset are used as the basis for learning.

Over the years researchers have proposed many rules for training the ANNs that follow the learning technique. Some of the widely used supervised learning rules include:+

1. Perceptron Learning rule2. Error-Correction/ Delta rule3. Hebbian Rule [7]

Among these rules, the Delta rule is the most widely used one.

8

2.Artificial Neural Networks

2.5. Activation FunctionThe output of a neuron in the ANN architecture is generated by using a mathematical

function, which is known as activation function. Most often a nonlinear function is used as activation function so that the ANN structure becomes suitable to adapt to nonlinear problems. Two of the most popular nonlinear activation functions are:

• Sigmoidal function• Signum function

Details of these functions can be found in [3].

2.6. Learning Function There are several learning algorithms proposed in the literature that can be used to

determine the appropriate weights of the ANNs. Some well-known learning algorithms include:

• Back propagation• Radial Basis Function• Hopfield Algorithm

Among the many learning algorithms, the back-propagation algorithm is widely used involving majority of the applications in a smart home environment (according to [2]). In a back propagation algorithm, the weights are modified first by calculating the error via some suitable error function. If a differentiable function is chosen as an error function, gradient descent on such a function will naturally lead to a learning rule. Historically, several researchers have proposed this idea e.g.[8]. Eventually, Rumelhart et al. [9] developed practical techniques that gave us a powerful engineering tool. The back-propagation technique follows the delta rule while modifying the network weights.

2.7. Application of Neural Networks in Smart Home Environment In the above sections we have briefly discussed the operation and algorithms of ANNs. In

the context of smart homes, ANN has been used for classification, control and automated home appliances, next step/action prediction, etc. In the following, lets review some of the significant applications involving ANNs approaches in smart home environment.

Chan et al. [10] appear to be the first to use ANN to help develop a smart home automation system for use by the elderly and disabled people. Altogether twelve rooms were included as part of the system where sensors were deployed in the rooms to collect information representative of the behaviors of the inhabitants. ANNs were trained using the acquired data to classify normal and abnormal behaviors.

The first comprehensive application involving ANNs in smart home environment was undertaken by Mozer [11] in 1998. It was named ACHE which stands for Adaptive Control of Home Environments. The system was able to alter the environmental system (e.g., air heating, lighting, ventilation, water heating) in line with the residential needs and comfort levels. Thus, the home environment was in tune with the lifestyle and requirements of the residents. ACHE had two main goals. It was able to anticipate the inhabitants’ needs such as lighting, air temperature, hot water, and ventilation by studying the patterns of adjustments made by the inhabitants. These settings acted as training signals for ACHE so that after some time it was able to anticipate the needs of the resident. The second objective was to conserve energy, i.e., meeting the inhabitant’s demand with less energy consumption. To satisfy these two objectives the author introduced a cost function to optimize the comfort level of the resident with least possible amount of energy being consumed. Feed-forward

9

2.Artificial Neural Networks

ANNs trained with back propagation algorithm were reported for data analysis and controlling the home appliances.

Jorge and Goncalves [12] focused on automated health monitoring of elder citizens’ everyday life using an artificial intelligence tool. They used ubiquitous computing devices to collect data from the elderly relating to neurological disorders (e.g., loss of motor, sensorial and cognitive problems). The authors emphasized the usage of artificial intelligence to learn patterns from data produced by ubiquitous computing devices and then to use them to predict next activities. For instance, patients requiring constant medical monitoring should be considered differently as they might need special needs and care. So, the challenge for the system is to take a decision whether someone should be classified under this group or not based on the available information. For such a problem, the rules and patterns that are inferred by the system should be unique and individual-specific, and in this regard an artificial intelligence tool like the ANN technique could potentially play a significant role in decision-making.

Pigot et al. [13] proposed a theoretical as well a practical framework with a view to minimizing risks that may arise due to the actions undertaken by the elderly in a physical environment. In this framework, the computer infrastructure of the smart home system consisted of three layers: The application layer, the middleware layer and the hardware layer. The hardware layer included electrical equipment, e.g. sensors [14]. The middleware connected the devices in the hardware layer with the application layer. The application layer was the decision making layer which took decision about the action to be undertaken in the next step. Tele-monitoring module was one of the application modules in the decision-making process to detect abnormal behaviors of the monitored person. The authors emphasized the advantage of applying ANNs along with other mathematical models to help with the detection of patterns associated with a risk.

Cook et al. [15] developed a project called MavHome. This project focuses on the creation of an environment that acted as an intelligent agent. The main operations of MavHome included the control of temperature, electric appliances, TV, video, robot, etc. The MavHome was organized into an architecture, which connected the agent and the technologies within each agent. The decision layer was one of four layers. This layer selected actions for the agent to be executed based on information supplied from the other layers. MavHome has been defined as a unique agent, which combined technologies from artificial intelligence, machine learning, databases, mobile computing, robotics, and multimedia computing. To acquire and recognize the activities of the inhabitants within the MavHome a number of prediction algorithms were employed in parallel: the SHIP prediction algorithm, Active LeZi (ALZ) online algorithm, and a data-mining algorithm known as Episode Discovery. In the final decision phase the MavHome developed a metapredictor called Predict to select one of the predicted actions obtained from the aforementioned predictors. In predict algorithm, a back propagation ANN was applied to learn the confidence value for each of the prediction algorithms based on the gathered data, the accuracy strength of each of the predictors and the meta features (i.e., amount of data, number of devices, etc).

R-Illengworth et al. [16] presented novel connectionist embedded agent architecture to recognize daily life behaviors. A number of unobtrusive and relatively simple sensors were used in this architecture. Different high-level daily routine activities (e.g., sleeping, eating) were recognized with the help of a constructive algorithm with temporal capabilities. Consequently, abnormal behaviors were also identified using this algorithm. The focus of the task was the development of some connectionist approach which would overcome the difficulties of adapting neural network to the continuous changes in the smart home, and eliminate the requirement of retraining the ANN to take into consideration the newly added input/output nodes (if any). The authors used adaptive neural architecture, first proposed by Kasabov [17], known as EcoS (Evolving Connectionist System), which was found suitable for

10

2.Artificial Neural Networks

the environmental data. A memory layer was added to the model to handle temporal component i.e., to detect abnormalities in the sequence, frequency and duration of the activities. Being RNN in nature, there were feedback connections between the two layers (memory and hidden layers) that followed the architecture proposed in [18]. The authors applied this model, in conjunction with 18 sensors, for activity recognition and to identify abnormalities inside a dormitory room at the University of Essex.

2.8. ANNs for Control of Smart Home Devices and AppliancesPeople have defined smart homes from different perspectives. Smart homes have been

designed with the primary aim of helping people with special needs, adapt to meet the user’s limitation and also to improve the general lifestyle of the inhabitants. Accordingly, the use of devices within the home environment and the associated models vary. Some application examples of smart homes might be for people with movement disabilities that may require assistance with mobility, for elderly people to help with balance problem, and for people with hearing or visual impairment requiring specialized communication and lighting devices. Furthermore, smart homes are designed with a focus towards minimizing caregiver support for the people who would like to live independently at home. Table 1 lists some of the main items that might require automation and control in a smart home.

Table 1: List of the main devices that require automation in smart home

2.8.1. EntertainmentThere are different kinds of equipment that may need automation to provide entertainment

to the inhabitants in a smart home. Examples include the provision of an automated TV control that may need turning on and off according to the daily routine of the inhabitant. A trained ANN can be utilized to make this action automated via information collected from various sources (e.g., time/day and activity of the inhabitant such as morning exercise, etc). Chan et al. [10] has already demonstrated the usefulness of ANNs in the control of TV in their smart home. ANNs can also be programmed to expand the controls of TV/Video/DVD during any time of the day by feeding the requisite information relating to the behavior and activities of the inhabitant. Similarly, ANNs can be employed for automated control of daily exercises. For example, it can be used to activate reminder notes for exercise and to regulate the air temperature of the exercise room (e.g., using a TDNN).

2.8.2. Safety and SecurityOne of the major aims of smart homes is to provide a secure and safe environment for

their inhabitants. This may include intruder or unwanted person detection and automatic activation of, for example, fire alarm for 24 hours. With regard to the previous task,

11

2.Artificial Neural Networks

computerized technique involving face detection, person and object identification can play a vital role. Recently, many research projects have been undertaken pertaining to the use of ANNs for face detection and recognition, see for example [19]. In some researches, it has been shown that ANNs are able to recognize face with very high success rate (82% to 100%), which suggests their suitability for application in smart home environment for intruder detection, and subsequent activation of appropriate security services such as the police or security guard.

ANNs may also be used to assess fire hazards in the home by studying smoke alarm signals from various parts in the house. In [20], the researchers have developed satellite-based remote sensing techniques for identifying smoke from forest fires. It seems that with little modification, this concept could be applied in smart homes to detect and assess fire hazards using a dedicated ANN system for intelligent decision making as to whether to activate or not the fire alarm system [20].

2.8.3. CaregiverIn this category, issues are discussed to help the inhabitants of smart homes to do his or

her daily routine activities, such as eating, house keeping, cleaning, etc. Already significant progress has been made in this area, especially with the help of indoor robots. In [21], the authors have employed ANNs to control a robot within the indoor environment as a personal assistant for indoor service applications such as surface cleaning, distribution of meals, etc. Such type of controlled robot has the potential to be employed in smart home environment to carry out various tasks, e.g. to deliver meal according to the daily routine of the inhabitant. ANNs have played a substantial role in many such control applications, for example, helping the robots to navigate using sensor signals taken from the surrounding environment or monitoring the time of taking meal.

Besides robots, ANNs have been valuable for doing many other household duties and tasks. For example, for automated control of bathtub water temperature within a comfortable level, both back propagation ANNs [22] and hybrid systems (neuro-fuzzy inference network) have been proposed [23]. ANNs, with the help of speech recognition techniques, could also potentially provide assistance with the online shopping activities undertaken from within the home environment.

2.8.4. Health MonitoringContinuous health monitoring capability offers enormous benefits to individuals living in

smart homes, especially for older persons and individuals with chronic diseases (heart, neurological disorders, etc) to have a better quality of life. Here the idea is to have sensor devices that would constantly deliver information about the health status of the inhabitants. ANNs or other artificial intelligence tools might be used for processing medical and physiological data, and to take intelligent decision about the overall health condition of the subject. ANNs could also facilitate information transfer to medical and health professionals in case of detected abnormality in recorded signals that would warrant urgent medical attention. Some of the examples include routine medication surveillance, falls event detection in older adults, heartbeat and ECG monitoring, blood pressure monitoring, EEG monitoring in dementia patients, etc. Already a substantial body of literature is available describing various issues related to health monitoring and using sensors placed in smart homes (e.g., bed, bath, toilet, etc) to obtain various physiological and health information data. ANNs can play a vital role in this context for processing various biomedical signals and assisting to diagnose diseases from the acquired biosignals [24] and also, for example, to develop ANN-based medical decision support system [25].

12

3.Fuzzy Systems

3. Fuzzy SystemsSince human speech and communication use fuzzy variables that have inexact bounds,

fuzzy systems present an easy way to communicate between humans and computers. [26] proposed that by using fuzzy systems a more natural and realistic environment can be established.

3.1. Fuzzy logicFuzzy systems theory is based on uncertainty and on imprecision. Uncertainty is very

natural to humans and people usually make decisions based on indiscreet observations. [27] A man can reason that he will not need an umbrella when going outdoors, if it does not rain much. Here the meaning of the fuzzy word ‘much’ is dependent on context and from the point of comparison.

The presentation of uncertainty is complicated to a computer using traditional methods. Among scientists uncertainty has been considered to be an inevitable part of speech and a precise expression has been an objective of research for a long period of time. [27] For example, for a computer it is very hard to understand what dark and bright means. Let us define a border between dark and bright to 100 lux. If the sun shines outdoors, the illumination can be measured to be 50 000 lux. Here it is quite easy to say that it is bright outside. However, if we measure a workspace to have 110 lux, the room is still brightly illuminated.

That does not sound very meaningful to a man. Hence, the borderline cases are difficult to handle. The problem exists in the binary logic of the computer. Outdoor light level can be either dark or bright. Fuzzy logic presents a solution called multi-value logic. Using multi-value logic, the illumination level can be dark and bright at the same time that means more than two truth-values exist. Here, it is possible for illumination level to be at the same time much bright but little dark. There is no need to define exact bounds for continuous values and the different regions of truth can overlap each other. [27]

Figure 3.1: Linguistic variable 'luminance' defined with three membership functions

Linguistic variables are used in fuzzy systems as a method for performing calculations. The values of linguistic variables can be presented using membership functions that define the degree of membership in real input or output spaces. Figure 3.1 demonstrates how the linguistic variable ‘luminance’ is defined with values ‘dark’, ‘normal’ and ‘bright’. For example, with a real input value of 150 from a light sensor luminance is characterized to be dark in degree of 0, normal in degree of 0.8 and bright in degree of 0.2.

13

3.Fuzzy Systems

3.2. Fuzzy controlFuzzy control systems have many abilities that conventional control systems do not

possess because of their multi-value logic. Fuzzy control includes three major steps: fuzzification, fuzzy inference and defuzzification. [27]

3.2.1. FuzzificationIn order to be able to do fuzzy inference the real measurement values must be fuzzified.

Fuzzification is performed by using membership functions that define the input spaces and the values’ degrees of membership for each variable separately. During fuzzification, every value of a linguistic variable receives a degree of membership based on the definition of the membership function and on the real measurement. An example of this was already presented with the linguistic variable ‘luminance’ in the previous chapter.

3.2.2. Fuzzy inferenceFuzzy systems utilize a relatively simple rule table that represents the behavior of the

whole system. The rules are of ‘if – then’ type. In the ‘if’ part the inputs’ and in the ‘then’ part the outputs’ linguistic variables’ values are defined. ‘If’ part determines whether the rule is or is not valid in the current situation. ‘Then’ part is used to define the states of the outputs.

All the fuzzified input values must be aggregated to achieve a complete degree of truth to a rule. The aggregation is usually done using a minimum operator that takes the smallest degree of membership of the values of the input variables.

Composition follows next from the input aggregation. In the composition step the aggregated degree of truth of the ‘if’ part is multiplied by a weighing factor to get a degree of support (DoS) for the whole rule. Weighing factor or weight is associated with each rule and describes the significance of the rule. The weighing factor is usually defined to be in the interval <0, 1>.

Since many of the rules can be true at the same time to a different degree, the result must be aggregated for each output variable’s value separately. This is usually done by selecting the biggest result after the composition step controlling the output’s value. This value determines the linguistic variables’ output’s degree of membership.

3.2.3. DefuzzificationAfter result of aggregation the linguistic variables are defuzzified to real output signals to

actuators. Defuzzification can be done in several ways.

One common method is the center of gravity defuzzification. All the values of the output linguistic variables are filled from zero to the degree of the membership of the value. Then the center of the filled area is calculated and the real result is read from that point.

3.3. Fuzzy ART Neural NetworkFuzzy ART has been introduced in the neural network literature by Carpenter[28], et al.,

1991, and since then it has been established as one of the premier neural network architectures in solving classification problems. To deal with supervised learning tasks, the so-called Fuzzy ARTMAP classifier was developed around the combination of two Fuzzy ART modules by Carpenter, et al., 1992.

To reduce the sensitivity of Fuzzy ARTMAP to the order of training samples, output combinations of independently trained Fuzzy ARTMAP systems were proposed, such as Williamson[29] proposed a Fuzzy ARTMAP based on the Gaussian radix in 1996, Verzi improve Fuzzy ARTMAP in 1998,and proposed BARTMAP and Eduardo proposed a improve neural network in 2002.

14

3.Fuzzy Systems

But all these algorithms proposed are sensitive to the vigilance, and with the increase of the vigilance the output patterns increase saliently, and the output patterns are so similar to each other, the false segment rate increases. To solve this problem, Zhang[30] proposed a new Fuzzy ART neural network model based on dual competition and resonance technique. This new model takes the competition and resonance method of the input nodes into the output nodes, and combines the output pattern according to the vigilance to avoid high similarity between the output patterns.

15

4.Genetic Algorithms

4. Genetic AlgorithmsGenetic algorithms[31] are a part of evolutionary computing, which is a rapidly growing

area of artificial intelligence. Obviously, they are inspired by Darwin's theory of evolution. Simply said, a solution to a problem solved by genetic algorithms evolves.

4.1. HistoryIdea of evolutionary computing was introduced in the 1960s by I. Rechenberg in his work

"Evolution strategies" [32]. His idea was then developed by other researchers. Genetic Algorithms (GAs) were invented by John Holland and developed by him and his students and colleagues. This lead to Holland's book published in 1975.[33]

In 1992 John Koza has used genetic algorithm to evolve programs to perform certain tasks. He called his method "genetic programming" (GP). LISP programs were used, because programs in this language can expressed in the form of a "parse tree", which is the object the GA works on.

4.2. Biological background

4.2.1. ChromosomeAll living organisms consist of cells. In each cell there is the same set of chromosomes.

Chromosomes are strings of DNA and serve as a model for the whole organism. A chromosome consists of genes, blocks of DNA. Each gene encodes a particular protein. Basically can be said, that each gene encodes a trait, for example color of eyes. Possible settings for a trait (e.g. blue, brown) are called alleles. Each gene has its own position in the chromosome. This position is called locus.

Complete set of genetic material (all chromosomes) is called genome. Particular set of genes in genome is called genotype. The genotype is with later development after birth the base for the organism's phenotype, its physical and mental characteristics, such as eye color, intelligence etc.

4.2.2. ReproductionDuring reproduction, first occurs recombination (or crossover). Genes from parents form

in some way a whole new chromosome. The new created offspring can then be mutated. Mutation means, that the elements of DNA are a bit changed. This changes are mainly caused by errors in copying genes from parents.

The fitness of an organism is measured by success of the organism in its life.

4.2.3. Genetic Algorithms basicsGenetic algorithms are inspired by Darwin's theory of evolution. Solution to a problem

solved by genetic algorithms is evolved.

Algorithm is started with a set of solutions (represented by chromosomes) called population. Solutions from one population are taken and used to form a new population. This is motivated by a hope, that the new population will be better than the old one. Solutions which are selected to form new solutions (offspring) are selected according to their fitness - the more suitable they are the more chances they have to reproduce.

This is repeated until a certain condition (for example number of populations or improvement of the best solution) is satisfied.

16

4.Genetic Algorithms

4.3. Operators of Genetic AlgorithmsAs you can see from the genetic algorithm outline, the crossover and mutation are the

most important parts of the genetic algorithm. The performance is influenced mainly by these two operators. Before we can explain more about crossover and mutation, some information about chromosomes will be given.

4.3.1. Encoding of a Chromosome The chromosome should in some way contain information about solution which it

represents. The most used way of encoding is a binary string. The chromosome then could look like this:

Chromosome 1 1101100100110110

Chromosome 2 1101111000011110

Each chromosome has one binary string. Each bit in this string can represent some characteristic of the solution. Or the whole string can represent a number.

Of course, there are many other ways of encoding. This depends mainly on the solved problem. For example, one can encode directly integer or real numbers, sometimes it is useful to encode some permutations and so on.

4.3.2. Crossover After we have decided what encoding we will use, we can make a step to crossover.

Crossover selects genes from parent chromosomes and creates a new offspring. The simplest way how to do this is to choose randomly some crossover point and to copy everything before this point from the first parent and then to copy everything after the crossover point from the second parent.

Crossover can then look like this ( | is the crossover point):

Chromosome 1 11011 | 00100110110

Chromosome 2 11011 | 11000011110

Offspring 1 11011 | 11000011110

Offspring 2 11011 | 00100110110

There are other ways how to make crossover, for example we can choose more crossover points. Crossover can be rather complicated and largely depends on encoding of the encoding of chromosome. Specific crossover made for a specific problem can improve performance of the genetic algorithm.

4.3.3. Mutation After a crossover is performed, mutation takes place. This is to prevent falling all solutions

in population into a local optimum of solved problem. Mutation changes randomly the new offspring. For binary encoding we can switch a few randomly chosen bits from 1 to 0 or from 0 to 1.

17

4.Genetic Algorithms

Mutation can then be following:

Original offspring 1 1101111000011110Original offspring 2 1101100100110110Mutated offspring 1 1100111000011110Mutated offspring 2 1101101100110110

The mutation depends on the encoding as well as the crossover. For example when we are encoding permutations, mutation could be exchanging two genes.

4.4. Parameters of Genetic AlgorithmsThere are two basic parameters of GA - crossover probability and mutation probability:

Crossover probability says how often will crossover be performed. If there is no crossover, offspring is the exact copy of parents. If there is a crossover, offspring is made from parts of parents' chromosome. If crossover probability is 100%, then the whole offspring is made by crossover. If it is 0%, whole new generation is made from exact copies of chromosomes from old population (but this does not mean that the new generation is the same!).

Crossover is made in hope that new chromosomes will have good parts of old chromosomes and maybe the new chromosomes will be better. However it is good to leave some part of population survive to next generation.

Mutation probability says how often will parts of chromosome be mutated. If there is no mutation, offspring is taken after crossover (or copy) without any change. If mutation is performed, part of chromosome is changed. If mutation probability is 100%, whole chromosome is changed, if it is 0%, nothing is changed.

Mutation is made to prevent falling GA into local extreme, but it should not occur very often, because then GA will in fact change to random search.

There are also some other parameters of GA. One also important parameter is population size:

Population size says how many chromosomes are in population (in one generation). If there are too few chromosomes, GA has a few possibilities to perform crossover and only a small part of search space is explored. On the other hand, if there are too many chromosomes, GA slows down. Research shows that after some limit (which depends mainly on encoding and the problem) it is not useful to increase population size, because it does not make solving the problem faster.

4.5. SelectionAs you already know, chromosomes are selected from the population to be parents to

crossover. The problem is how to select these chromosomes. According to Darwin's evolution theory the fittest ones should survive and create a new offspring. There are many methods how to select the best chromosomes, for example roulette wheel selection, Boltzman selection, tournament selection, rank selection, steady state selection and some others. Some of them will be described in this chapter.

18

4.Genetic Algorithms

4.5.1. Roulette Wheel Selection Parents are selected according to their fitness. The better the chromosomes are, the more

chances to be selected they have. Imagine a roulette wheel where all chromosomes in the population are placed, every one has its place big accordingly to its fitness function, like on the following figure.

Figure 4.1: GA - Roulette Wheel Selection

Then a marble is thrown there and selects the chromosome. Chromosome with bigger fitness will be selected oftener.

This can be simulated by following algorithm.

1. [Sum] Calculate sum of all chromosome fitness in population - sum S. 2. [Select] Generate random number from interval (0,S) - r. 3. [Loop] Go through the population and sum fitness from 0 - sum s. When the sum s is greater then r, stop and return the chromosome where you are.

Of course, step 1 is performed only once for each population.

4.5.2. Rank Selection The previous selection will have problems when the fitness differs very much. For

example, if the best chromosome fitness is 90% of the entire roulette wheel then the other chromosomes will have very few chances to be selected.

Rank selection first ranks the population and then every chromosome receives fitness from this ranking. The worst will have fitness 1, second worst 2 etc. and the best will have fitness N (number of chromosomes in population).

You can see in the following figure, how the situation changes after changing fitness to order number.

Figure 4.2: Situation before ranking (graph of fitness)

19

4.Genetic Algorithms

Figure 4.3: Situation after ranking (graph of order numbers)

After this all the chromosomes have a chance to be selected. But this method can lead to slower convergence, because the best chromosomes do not differ so much from other ones.

4.5.3. Steady-State Selection This is not particular method of selecting parents. Main idea of this selection is that big

part of chromosomes should survive to next generation.

GA then works in a following way. In every generation, there are a few (good - with high fitness) chromosomes selected for creating a new offspring. Then some (bad - with low fitness) chromosomes are removed and the new offspring is placed in their place. The rest of population survives to new generation.

4.5.4. Elitism Idea of elitism has already been introduced. When creating new population by crossover

and mutation, we have a big chance, that we will loose the best chromosome.

Elitism is name of method, which first copies the best chromosome (or a few best chromosomes) to new population. The rest is done in classical way. Elitism can very rapidly increase performance of GA, because it prevents losing the best found solution.

20

5.FAKE GAME

5. FAKE GAMEFully Automated Knowledge Extraction (FAKE) is project developed by Neural Group from

Computer Science Dept. of FEE CTU in Prague. Project is divided into automated data preprocessing module and automated data mining module based on Group of Adaptive Models Evolution. The results of data preprocessing, data mining and several knowledge extraction techniques are compiled in one report using JasperReport framework.

5.1. Automated data preprocessingPreprocessing module implements basic groups of methods for data preprocessing. Each

group consists of several methods. All together there are 40 methods implemented from the following categories:

• Import from several different formats including MS Excel XLS• Export to several different formats – Weka, MS Excel• Data normalization – linear, soft-max, z-score• Missing values replacement – basic methods for replacement by constant, mean

value, etc.• Discretization • Simple methods for data reduction• Clustering• Data cloning in minority class

Individual methods are implemented in form of plugins that implement simple interfaces.

21

Figure 5.1: FakeGame schema

5.FAKE GAME

5.2. Automated data mining This module is a core of the FAKE GAME environment. As an input, it requires

preprocessed data and it produces ensemble of GAME models for subsequent knowledge extraction.

To create a GAME model, module loads neurons with various transfer functions and optimization methods from the jcool module. Then, it uses a genetic algorithm (GA) with deterministic crowding to evolve topology of the model (transfer functions of neurons and their interconnections).

The genetic algorithm repeatedly layer by layer optimizes neurons (inputs and transfer functions). You can choose population size in each layer, default number 15 means that 15 neurons will be initialized to the initial generation of the genetic algorithm. Then the crossover, mutation and deterministic crowding based selection will be applied to generate population of the same size in the next epoch. Maximal number of epochs (generations) of the genetic algorithm is 30 in default settings. Maximal number of surviving units affects the number of neurons, which are selected and frozen in the layer after last generation of the genetic algorithm.

The genetic algorithm is combined with a niching strategy called Deterministic Crowding. Niching methods work with mutual distance of individuals in the population. In our case, the distance of two neurons can be computed in several ways:

as described in the FAKE GAME thesis[35].

You can stop genetic algorithm before it reaches the maximal epoch set in the Complexity panel. The overall diversity of units is monitored and when it drops below certain threshold, the GA is stopped.

Experiments showed that the best option of the next item is that half of neurons inherit their type and optimization method from parents, second half of neurons is assigned random type and method to optimize their coefficients.

The importance of individuals distance is used when selecting neuron to be frozen in a layer. With emphasis on distance, diverse neurons (some with poor results) are selected.

22

Figure 5.2: Computing strategy of the distance of two neurons

6.KNX

6. KNXKNX is the Worldwide STANDARD for Home and Building Control

developed and maintained by KNX Association.

In order to transfer control data to all building management components, a system is required that does away with the problems of isolated devices by ensuring that all components communicate via one common language: in short, a system such as the manufacturer and application domains independent KNX Bus.

This standard is based upon more than 15 years of experience on the market, amongst others with predecessor systems to KNX: EIB, EHS and BatiBUS. Via the KNX medium to which all bus devices are connected (twisted pair, radio frequency, power line or IP/Ethernet), they are able to exchange information.

Bus devices can either be sensors or actuators needed for the control of building management equipment such as: lighting, blinds/shutters, security systems, energy management, heating, ventilation and air-conditioning systems, signaling and monitoring systems, interfaces to service and building control systems, remote control, metering, audio/video control, white goods, etc. All these functions can be controlled, monitored and signaled via a uniform system without the need for extra control centers.

KNX is approved as an International Standard (ISO/IEC 14543-3) as well as an European Standard (CENELEC EN 50090 and CEN EN 13321-1) and Chinese Standard (GB/Z 20965). KNX is therefore future proof. KNX products made by different manufacturers can be combined – the KNX trademark logo guarantees their inter-working and interoperability. KNX is therefore the world´s only open Standard for the control in both commercial and residential buildings.

A benefit in every type of building: From the office complex to the average household. Whatever the kind of building is, KNX opens up complete new opportunities for building control systems while keeping the costs at a manageable level. KNX can provide solutions that can only be realized with considerable effort with conventional installation techniques. Via a single interface, all applications in the home or building can be controlled. From heating, ventilation and access control to the remote control of all household appliances – KNX allows completely new ways to increase comfort, safety and energy savings in the home or building.

23

Figure 6.1: KNX logo

Figure 6.2: KNX Applications

6.KNX

6.1. KNX basicsEIBnet/IP allows to communicate with an KNX/EIB installation by tunnelling over IP

networks. The protocol is published in the KNX Handbook[38] and in the European standard EN 13321-2:2006 [39], available from European standardization organizations. Meanwhile EN 13321-2 is useless without information on the KNX/EIB control network specific data structures (cEMI, DPTs); these should be defined in EN 50090 (Home and Building Electronic Systems).

KNX protocol is environment independent which illustrate figure 6.3. It works on base of Group Addresses. Every device is member of several groups. Sensor sends packet to BUS with set correct group address, every device on BUS read message but only members of same group react on inputs. Others simply discard data. Figure 6.4 shows whole process.

24

Figure 6.3: KNX Physical communication media

Figure 6.4: KNX addressing

6.KNX

6.2. Testing environment designTechnical schema of testing environment is enclosed as appendix A at the end of this

document. At figure 6.5 you can see photo of device.

6.3. KNX@HomeKNX@Home[40] is an open source free building control server developed at the

University of Applied Sciences in Deggendorf, Germany[41]. The project is managed by Professor Dr.-Ing. Andreas Grzemba from the Institute of Electrical Engineering. Goal is to offer an easy-to-use web based graphical user interface to everybody whose house has got an integrated KNX/EIB-Bus.

Figure 6.6: KNX@Home Application Overview

25

Figure 6.5: KNX testing environment

6.KNX

The main goal of the application is to allow the user to control his KNX-BUS installation with his home desktop computer. This goal is to be achieved by using the KNXLive! from the Vienna University of Technology, which is an operating system that starts directly from CD. There is also a Teach-In-Module that allows the user to simply add elements from the KNX-Bus-System to the KNX@HOME Application.

The application should:• Be able to control a KNX installation of arbitrary size• Be Controlled and presented web based• Be flexible and adapted to the users’ needs• Provide full functionality to the user for manual configuration• Be simple

6.3.1. Basic conditions for the live CDThe whole applications (Calimero, Persister, web server) should be integrated into a GNU

Linux Live CD, like Knoppix.

Because of this, the programs have to get by without a hard disc and with the RAM of an average computer. In fact this is not a big problem, except the database, which requires the access on a hard disc, USB-stick, SD-card, etc.

Several Live distributions can handle an available empty partition on a data medium to store the database.

Once the Live CD has started a complete Linux with a graphical user interface like KDE, the user will be able to use the main application immediately by opening a browser like Konqueror or Firefox. As home page, the browser will show the welcome screen of the web interface.

Due to this, it will be very easy for the user to launch our application-bundle, without installing any programs permanently to his system.

6.3.2. Architecture

Figure 6.7: Architecture of KNX@Home Project

26

6.KNX

6.4. KNXLive!Since 1999, the Automation Systems Group at the Institute of Automation, TU Vienna is

researching and teaching the topic of home and building automation. For many developments and research prototypes, EIB served as the technology platform. KNX follows in the footsteps of EIB, the well known installation bus system.

In the course of these activities, a variety of free software for (what is today) KNX was developed.

• The device drivers necessary to communicate with a BCU 1• A lean KNXnet/IP Tunnelling server for BCU 1 ("Tweety")• A powerful and versatile EIB access daemon ("eibd")• A Java library ("Calimero") for interacting with a KNX network via KNXnet/IP• A graphical demonstration client for Calimero• A tool set for writing and downloading BCU applications, RAD-style ("BCU SDK")• BASys 2003, a new approach towards planning and configuring installation bus

systems• A prototype oBIX server for KNX

All this software is Open Source. Its use is free, and full source code is available (however, check the licensing terms for redistribution and derivative works). Most of it is under the GNU General Public License.

All this is included on KNXLive! : a Linux Live-CD, including a setup assistant that helps you turn your PC into an EIBnet/IP (KNXnet/IP) server with only a couple of mouse clicks. The entire operating system (including a graphical desktop) and applications are started from CD-ROM. No installation is necessary, the contents of the hard disk remain untouched.

27

Figure 6.8: KNXLive! architecture

6.KNX

6.5. CalimeroProbably you have noticed that both KNX@Home and KNXLive! solutions are based on

Calimero framework which is a collection of Java APIs that together form a foundation for further EIB/KNX high level applications (including remote access and control).

Eibclient is a EIBnet/IP client library that, in its current version, supports Tunnelling connections as well as search and description. The aim of this API‘s is to allow the establishment of EIBNet/IP connections with minimal effort. The entire EIBnet/IP message exchange including heart beating is hidden from the client programmer, who merely is faced with an API to send and receive cEMI messages. In addition, eibclient is able to parse cEMI messages to extract the relevant data as well as assemble them. The current implementation is limited to TP1 standard frames.

Eibxlator is a collection of encoders/decoders for Application layer protocol data units (APDUs) relevant for exchanging and interpreting group values. In this version only a subset of KNX DPT‘s are implemented, but the package was designed to make the addition of further ones easy.

Eibpoints offers the ability to maintain a list of the data points in the KNX/EIB system and their relevant data, including group address, friendly name, and DPT type. The data point list abstraction offers look-up facilities by name and address. The entire configuration can be exported and imported as an XML file or stream.

These APIs can be used largely independently.

28

Figure 6.9: Calimero Architecture Design

7.Teiresias Application

7. Teiresias ApplicationTeiresias was a famous blind prophet from Thebes in Greek mythology, who obtained his

gift from Zeus after he decided an argument between Zeus and Hera about pleasure that love gave to men and women. Because he decided that women enjoyed love more then men and therefore Zeus was right, Hera had made Teiresias blind. As a reward Zeus gave him the gift of prophecy.

Application should be able to act as a prophet in real life situations. It should predict people's moves and make decisions to help them before they even decide to do what they want. This application should be able to predict simple scenarios as well as more complex situations. In chapter 7.2. I will discuss simple scenarios, which I plan Neural Network to teach to prove their abilities. Afterwards, I will try to join them into one complex neural brain and evaluate its efficiency.

But first, lets concentrate on the basic principles of the whole application.

7.1. Adaptability of Neural NetworkThe major concern has grown in process of adaptation to users' behavior changes. Let us

assume we have a well trained network, which evaluates users inputs and predicts actuators states. If prediction is strong enough (reliability based on several ensembles of problem is high enough), application tries to change the state of outputs according to its prediction.

But what if the prediction was wrong and did not obey the user's wish. There must be a well defined process of penalizing such decisions, recognize these situations and avoid disturbing users with incorrect decisions.

For example, let us assume user opens the window in bedroom each and every day after he wakes up. But one time, it is too cold and he does not want to open the window. However, the network will recognize a pattern according to previous behavior and open the window itself. That is not that bad while there is a way how to penalize such decision. User can close the window and with such act figure out he does not want the window to be open. The network has to penalize (ignore state of window) any decision to open window until user decides to open it manually. After his decision the application can start to manage the window's state again.

But what happens to the training data?

Network is off-line generated and updated every morning after 2AM. At this time, short-term data are collected from whole day. They are preprocessed to get rid of irrelevant entries and added to the long-term. In case there is any conflict, data are enriched by time-shifted values of significant inputs to keep the context of data.

Subsequently, 3 ensembles are generated by GAME and stored in memory for next day evaluation. Each time an input changes, models are used to count output values (there is one model for each output in each ensemble). Outputs values are compared to the previous value across all ensembles. If differences between ensembles output values are too big, decision is not taken into account (expected misleading decision). Otherwise, packet is sent to actuator to change his state to decided value.

In evaluation phase, actuator is controlled by Teiresias prediction if and only if predictions are accurate enough and there has not been counter decision of any user. In case there are

29

7.Teiresias Application

any penalties on output, the state shall never be changed against users' decisions, rather it shall be discarded.

This should help to provide an algorithm robust enough to deploy useful application, which user would not want to get rid of after first day, when network is not trained yet and it is deciding awkwardly against user's will. It can as well help in future life-cycle to avoid any disturbing collisions between users and Teiresias resolutions.

Examples of adaptation of Neural networks on changes can be found in the following chapter.

7.2. ScenariosThe scenarios depend on personal identification based on RFID. This is a widely used

technology, which allows to identify location of people in rooms.

Input data used to train Neural Network and develop GAME model are enclosed as appendix and/or (if too complicated) on CD. On CD you can find trained model with testing data and reports as well. Each GAME model consists of several (usually 3) ensembles to improve reliability and accuracy.

First it is trained on training data and then approved on testing data. Resultant error is counted from evaluation on testing data to prove the ability of the neural network to decide unspecified situations correctly.

7.2.1. Bathroom/Corridor Lights according to ambient light levelThis is the simplest scenario that I contemplate firstly . It consists of the following routine:

after somebody opens the door to the bathroom, he turns on the light in the bathroom. After that he can close the door or not but while he stays in the bathroom the light is still on. Just after he leaves the bathroom he turns the light off and closes the door. This allows us to specify simple rules:

• If the door is open and there was nobody inside the bathroom beforehand, turn the light on

• If somebody is in the bathroom keep the light on• If there is nobody inside the bathroom, turn the light off

To make it little bit more complicated I added more variables, one of them is light in corridor which depends on occupancy and ambient light level as well. We can formulate the following rules:

• If somebody is moving in the corridor turn the light on only if the light is not sufficient • After somebody has opened the door from inside the bathroom he has to go through

the corridor, which means turning on the light in the corridor, however this rule should comply with the previous one

• If there is nobody in the corridor turn the light off•

I used GAME to generate the model. First (table 15) I used raw data. It had terrible results because action and reaction were in different step and that is why neural network was not able to learn this simple pattern. Then I decide to simulate preprocessor which prepared the data as you can see in table 16. This helps the Neural Network to be more precise in prediction of the situations. GAME model showed significance of Inputs as you can see in table 2. This provides knowledge that is necessary to process inputs before evaluation to which I will pay attention in the incoming chapters. In learning phase reaction must be present in the very same step where action occurs. This helps immediate reaction to action in evaluation phase.

30

7.Teiresias Application

ambient light dark

ambient light normal

ambient light bright

bathroom door

hall motion

bathroom motion

bathroom humidity

hall light 19% 8% 19% 10% 33% 8% 0%bathroom light 0% 0% 0% 0% 0% 100% 0%bathroom fan 0% 0% 0% 0% 0% 0% 100%Table 2: Significance of Bathroom Scenario Inputs

The classification accuracy on training and testing data set was 100%.

7.2.2. Leaving home routineThis scenario describes common routine of leaving home. Before you leave home, you

close every single opened window, turn of the heating, electric devices, water and gas to assure nothing would happen while you are not there. Let's try to teach the Neural Network this pattern.

Let us suppose somebody is watching TV in living room. He is moving around the place until he decides to leave home and goes towards door through the hall then opens the entrance door and leaves. After closing the entrance door, TV (all electrical appliances) and heating must be turned off and windows closed.

After this simple scenario NN was not able to reliably recognize the pattern. What I had to do was to iterate the same pattern several times which brought better results. Finally, after 4 iterations (Table 17) NN was able to detect decision to leave home and turned off all appliances. In table 3 you can find significance of inputs.

Hall motion Living room motion Doorheating 0% 100% 0%window 30% 34% 34%TV 27% 40% 31%Table 3: Significance of Leaving Home Scenario Inputs

The classification accuracy of model on training data was 100% and on testing data 96%.

7.2.3. Coming home routineThis scenario is an extension of the previous one. It should be responsible for rollback

changes done in previous one and return home to the same state as it was before leaving. In case NN decided to close/turn off anything, it should open/turn it on again to make the person feel like he has never left.

I tried to make it little bit more complicated when I decided to add dependency on ambient light level. When you return while it is dark outside, you usually do not open windows. (Especially if home was autonomously ventilating while you were outside, which is the concern of the scenario in chapter 7.2.4.)

First I trained network to react to simple return pattern. This went well. After that I added difference between the day and night and with two iteration of whole pattern I could accomplish significantly good results. Windows were opening when somebody has been entering the room. Then I decided to add some disruption in pattern. In one iteration, person who entered living room did not turn on the TV. Result was interesting. Next time he entered the room the TV was turned on again. It means decision to turn the TV on was stronger then to leave it off.

31

7.Teiresias Application

Ambient light Hall Living room Doorheating 0% 0% 100% 0%window 26% 12% 36% 24%TV 0% 21% 42% 36%Table 4: Significance of Incoming Home Scenario Inputs

The classification accuracy on training data was 100% meanwhile on testing data 93%.

7.2.4. Ventilation – keeping balance of humidity, co2 and temperatureAnother simple scenario came from the routine which is essential for every home – the

ventilation. Everybody has a different sense of aromas but we can feel lack of oxide in air. This means we have to ventilate our home to let the fresh air in. This routine is tied very closely to the temperature management. Because more fresh air means more temperature control, it includes higher energy costs. If you want to save money but keep breathing the fresh air you have to ventilate your house wisely. Why do not delegate this task on your intelligent home?

Scenario consists of several rules:• If there is too much CO2 in the air – open the window• If the window is open – turn off the heating• If it is too cold in the room – close the window and start the heating• If there is high humidity level – switch on the fan • If the air is fresh enough – stop all the countermeasures

temperature motion humidity co2heating 0% 100% 0% 0%window 22% 10% 33% 33%fan 40% 0% 41% 17%Table 5: Significance of Ventilation Scenario Inputs

The classification accuracy of this scenario on both training and testing data was 100%.

7.2.5. Heating in different weather and humidity conditionsHeating is one of the most complex systems for analysis. It has too many unpredictable

variables which means it is difficult to model it. I would like to illustrate solely simple part of the problem. It should be able to identify the correct temperature to set up in the case of different weather conditions. Humidity influences subjective feeling of warmth.

Scenario consists of several rules which are made up to check the ability to learn such patterns. It helps the system to recognize which factor should raise the temperature and which one should lower it.

sunny cloudy rainy windy foggy storm humidityheating 15% 12% 14% 1% 19% 5% 30%Table 6: Significance of Heating Scenario Inputs

As you can see heating was mainly dependent on humidity. Other values were fuzzified parts of weather condition value and more or less similarly significant. This matches theoretical expectations.

32

7.Teiresias Application

Neural network has problems deciding analog values instead of digital. It is capable to get reasonable results but needs more accurate data and more iterations to recognize the pattern. That is why it is preferred to use fuzzified values instead if possible.

The classification accuracy on training data was 100% and on the testing data after several iteration of pattern in training data was 92%.

7.2.6. Decision priority of usersEach inhabitant can be recognized according to RFID card. This involve the question of

priority of inhabitants' decisions. In the following scenario I will try to prove that neural network is able to decide who has higher privilege to make decisions at home, based on past decisions analysis.

Firstly, I model a small scenario of family which consists of mother and father and they have different demands on the heating temperature and the lights intensity. Father wants 25°C and only 80% of the lights intensity while mother likes 30°C and full intensity. NN is able to recognize these needs significantly well. But what would happen if network realized presence of the both of them. I have tried this evaluation on taught network and was surprised that network tried to sum both preferences. Which finished/ended up with maximum temperature of 40°C and even unsupported lights intensity 1,8. This was behavior which I had not expected, I had rather expected average values, which should have been the correct behavior. That is why I tried to evaluate behavior after additional iterations and some samples of correct behavior in training set.

After I evaluated previous model with added rules ensuring the correct behavior in case of presence of both parents I realized that system was becoming more reasonable but still false. It predicted the temperature preferred by the mother to 29°C and it used this temperature as average as well. That is why I decided to iterate this scenario more repeatedly.

Iterations did not help at all. It has just made model smoother, but without any correction. I have noticed the endeavor of the system to teach mother to use more energetic friendly temperature 29°C instead of 30°C. This means that system needs some penalty value which helps to provide more information about difference between the prediction and the user's decision.

Final attempt was successful on behalf of decision to teach NN with small changes not the big one. This means I have never changed both users at once (do not let them leave or enter room together). This helps to generate model after few iteration which could predict situations quite precisely even if they are entering the room together.

mother fatherheating 56% 43%lights 59% 40%Table 7: Significance of Priority Scenario Inputs

In Table 7 you can see significance of inputs, which are priorities of users decisions. This shows that the mother has higher priority then the father. This is somehow result of input data set, because the values I used to train the NN in case both of them were present in the room, were not average. In case I use average values it would suppose to be 50%.

33

7.Teiresias Application

The classification accuracy on training data was 100% but only 80% on testing data. This shows up problem of model to decide correct values in case of big step changes of input values (more values changed at same time). Another chance for preprocessing to do its job.

7.2.7. Volume control with active noise cancellationThis scenario is based on active noise cancellation. A noise-cancellation speaker emits a

sound wave with the same amplitude but with inverted phase (also known as antiphase) to the original sound. The waves combine to form a new wave, in a process called interference, and effectively cancel each other out - an effect which is called phase cancellation. Depending on the circumstances and the method used, the resulting sound wave may be so faint as to be inaudible to human ears.

Because real time software processing the audio inputs (analog/digital/analog) is too slow, we have to rely on the hardware processing. This would be possible with the hardware neural network (local decision). That is why I do not try to simulate such application in the Teiresias application and presume the existence of such technologies.

I will test only the volume control based on occupancy and users interactivity. One of the available scenarios is the volume control of the TV, music and phone ringing. If phone starts to ring all other sounds should quiet down. Otherwise if only one source is on, its loudness is not controlled, however if two are on at the same time, the sound should be lowered to a specified level. To control the volume of the radio and TV, an IrDa Remote Control connected to the KNX Bus can be used.

After first iteration of the training set, the NN was able to decide all the situations correctly except one. While somebody was watching TV and listening the music and the phone rang, TV was muted completely. This behavior was unexpected and wrong. After 4 iterations it started to work correctly.

Figure 7.1: TV volume dependency if only TV is ON

Figure 7.2: Music volume dependency if only music is ON

34

7.Teiresias Application

As you can see from figures 7.1 - 7.4 (model after first iteration) there are differences between the model of the behavior of the TV and the music even though they are acting almost the same. The most interesting is the figure 7.3 which shows a model inconsistency. Real value of the TV volume when everything is ON should be 0,2 but it is modeled as 0,134. This has got imporved after 4 iterations to 0,198 (almost 0,2).

Figure 7.3: TV volume dependency if everything is ON

Figure 7.4: Music volume dependency if everything is ON

The classification accuracy was 100% on training set after several iterations and 95% on testing set.

tv_on music_on phone_ontv_volume 41% 26% 32%music_volume 20% 45% 34%

Table 8: Significance of Volume Control Scenario Inputs

7.2.8. Phone calls handlingThis scenario is more concentrated on preprocessing than model creation. It helps to

recognize the following pattern. If the phone rings while nobody is at home, system should turn on the message recorder immediately.

Let us assume we have the phone with message recorder connected to KNX Bus. Every time the phone rings and nobody answers, recorder starts to record message. But in case nobody is at home why should the phone wait to start recording a message? If there is somebody at home it works normally how expected.

Let us try it to see whether default GAME preprocessing can handle such situations. I used preprocessing but without success. It seems that for GAME it is difficult to make decisions dependent on more states in a row, because GAME does not use recurrent networks. What you have to do is create time shifted values of variables which state evolution is important for the whole model. After that GAME is able to recognize time driven patterns. The only problem is that you have to decide how many values from the past to take

35

7.Teiresias Application

into account. If you decide to use a sequence of all inputs your input data file can be multiplied by 2 or even more.

Figure 7.5 shows how accurate are decisions of taught NN in several ensembles. Only one of them has predicted value correctly. It means that decision done with such trained network should not be taken into account. It has to wait until decisions would be similar and only after that we can use it for prediction. This state of NN needs to be trained further.

Figure 7.5: Inaccurate recorder dependency on motion and phone ringing

Figure 7.6: Accurate recorder dependency on motion and phone ringing

That is where figure 7.6 comes in. It shows how it should look like after further iterations of training data with the specified pattern. This GAME ensemble is well trained and can be safely use for evaluation. The classification accuracy on both training and testing data was 100%.

7.2.9. Custom plants watering schemesThis is another example of a scenario that needs sequence preprocessing in order to

work correctly. Each plant has a different schedule of watering. Smart Home should be able to recognize the individual needs of each one and help them keep their life environment healthy.

First I started a scenario of two plants. The A needs to keep the moisture of the soil between 50% and 80% and the B between 40% and 80%. I started with two iterations and I watered them at the same time. It resulted in dependency between the plants moisture. That is why I decided to use time sequence to get rid of dependencies.

36

7.Teiresias Application

I have generated GAME model of 5 ensembles and overall ratings were:• plant A:

◦ RMS error: 5.282598541451027E-7◦ Simple ensemble classification accuracy: 100.0% ◦ Weighted ensemble

▪ RMS error: 5.282598084067383E-7▪ Classification accuracy: 100.0%

• plant B◦ RMS error: 8.669946428573342E-6◦ Simple ensemble classification accuracy: 100.0% ◦ Weighted ensemble

▪ RMS error: 8.669942649773585E-6▪ Classification accuracy: 100.0%

In the following table 9 you can see the significance of inputs which are supposed/are predicted to be 100% or nearby because plants do not rely on each other. This result shows that the NN was able to recognize the pattern of keeping the specified level of moisture in the soil for two different plants.

moisture A moisture Bwater A 91% 9%water B 5% 95%Table 9: Significance of Watering Scenario Inputs

The classification accuracy on testing data was 100% as well.

7.2.10. Fresh boiled coffee replaces alarm clockIt would be nice to have a coffee aroma to wake you up instead of an alarm clock. Why

not to teach NN to do it. If you make coffee every day just after you wake up it can probably start to boil itself.

Morning is identified with daytime_morning value which goes to 1. After waking up (movement in the room) and entering the kitchen (movement in the kitchen) you boil a coffee. After 5 iteration NN was still not able to learn this simple pattern. Problem is with state just after boiling coffee which is responsible for misunderstanding. There is no change in any input value except the actuator. This involves problems because the network is not able to decide according to an actual state and it has to take into account even previous states (probably 2 or 3). This ends up with hesitation and uncertainty. Without time sequencing people have to boil their coffee themselves.

Here comes helpful GAME time sequence preprocessing which creates virtual inputs, which are past values of selected input shifted back in time selected amount of events. This means you can predict behavior according to an actual state and history. Problem is, how to decide which values should be time-shifted. As you can see in the figure 7.7, that shows which inputs (rectangles) are significant for coffee output (biggest circle) and their function. Coffee simulation needs two time-shifted values of daytime morning and kitchen motion inputs from past to correctly predict when to boil coffee and when not. In this case reliability of network has increased on both training and testing data set to almost 100%.

37

7.Teiresias Application

coffee = EXP(( -5.780 * (EXP((0.801 * room_motion(t-0) – 0.076 * kitchen_motion(t-2) – 0.627) * 20.391) * 0.019 + 0.040) + 1.555 * kitchen_motion(t-2) + 0.945 * (EXP((0.911 * (EXP((0.801 * room_motion(t-0) - 0.076 * kitchen_motion(t-2) – 0.627) * 20.391) * 0.019 + 0.040) - 0.069 * (0.348 * room_motion(t-0) + 0.039) + 0.502 * room_motion(t-1) – 0.401) * 19.179) * 0.009 – 1.993E-5) + 6.305 * (14.271 * (EXP((-0.139 * daytime_morning(t-1) + 0.013) * 12.409) * ( - 0.270) + 0.321) * (EXP((-0.139 * daytime_morning(t-1) + 0.013) * 12.409) * (-0.270) + 0.321) – 3.777 * daytime_morning(t-2) * (EXP((-0.139 * daytime_morning(t-1) + 0.013) * 12.409) * (-0.270) + 0.321) + 0.839 * kitchen_motion(t-0) * (EXP((-0.139 * daytime_morning(t-1) + 0.013) * 12.409) * (-0.270) + 0.321) + 1.713E-8) – 2.703) * 6.995) * 0.353 – 9.611E-6

7.2.11. Turning off multimedia devices after everybody falls asleepIt is relatively common that somebody fall asleep while watching TV or listening to the

radio. This scenario should prove that Teiresias is able to learn a simple schema of switching devices off if people fall asleep and nobody is watching them. Even though it would be able to turn the lights off.

However, it is similar to the home leaving scenario, it reacts on signals indicating sleeping people instead of opening the entrance door. After pattern recognition it should be able to turn off every noisy device. Therefore, noise control is needed as well.

In case iany device could detect a sleeping person remotely it would be a simple rule: if everyone is sleeping turn off electrical appliances. The problem is that currently there is no such device available. Nevertheless, there may be one in the future. That is why I will try to simulate some physical variables which can be measured and according to this pattern detect sleeping people. I decided to use motion detector in living room, hall and bedroom. I simulated a simple scenario where somebody turns on the TV then walks around and turns off the TV when he goes to bed.

After one iteration NN was able to turn off the TV when the person left living room to bedroom and did not move there for a while. On the other hand it did not turn the TV on any time, which is good, because we do not want the TV to be turned on automatically while wandering around home.

living room motion

hall motion

kitchen motion

bedroom motion

TV 34% 18% 29% 17%Table 10: Significance of Multimedia Scenario Inputs

The classification accuracy was 100% on both training and testing sets of data.

38

Figure 7.7: Coffee Scenario Decision Tree

7.Teiresias Application

7.2.12. Turning lights on wherever you move, one step aheadThis should help people to protect their lives. In case it is dark and you start to move

around there is quite a big possibility of injury. Therefore it would be necessary to teach NN to turn the lights on wherever somebody tries to walk and it is dark.

After a few iterations NN recognizes walking around at night and turns the lights on autonomously quite sufficiently. TV was listed as actuator but it would be more helpful as input this time, because one part of my scenario was to teach the network to turn off the light if somebody starts to watch TV. Significance of inputs follows:

ambient light dark

hall motion

bedroom motion

living room motion

kitchen motion

bathroom motion

hall light 38% 43% 0% 6% 0% 11%bedroom light 35% 0% 40% 23% 0% 0%living room light 36% 8% 0% 41% 13% 0%

kitchen light 41% 0% 0% 7% 50% 0%bathroom light 0% 0% 0% 0% 0% 100%

TV 37% 24% 0% 38% 0% 0%Table 11: Significance of Lights Scenario Inputs

The worst results had represented living room lights, which should be dependent on another output (TV). This is not possible in GAME and that is why it was necessary to add TV as input.

The classification accuracy on training set was 95% and on testing data set only 75%.

7.2.13. Sun blinds control sun intensityThis is a relatively simple scenario of sun control. If there is a too bright light comming

through window, let the sun blinds control the sun intensity. They consist of a sensor which measures the light intensity in the room and another fuzzified which shows how bright the ambient light is.

It was easy to teach the network directly after the first iteration. Even though it has learned some hidden dependencies such as if there is a more intense light inside than outside do not close the sun blinds because there is probably a light source inside. This behavior was not intended but it is correct.

ambient light bright light intensitysun blind 59% 40%Table 12: Significance of Sun blinds Scenario Inputs

The classification accuracy on both training and testing data sets was 100%.

7.2.14. Intelligent fridge with storage controlIntelligent fridge is a technology which has been simultaneously developed by bigger

companies specialized in both electrical equipment and computing. It should be able to keep a list of items according to the food stored inside or advice you the best meals to cook. This depends on mood as well.

39

7.Teiresias Application

After you run short of something it prepares you a list of things you have to buy or even in some countries it can use your credit card and buy the groceries on-line. Those can be delivered by a delivery boy directly into your fridge.

Storage control is based on RFID which gives you the chance to control the amount of food. This will be one of inputs in my scenario. Output is process of ordering the refill of the fridge.

Simple scenario shows how the buying process is triggered whenever something is running short. Process of ordering groceries is independent from the Teiresias application. Teiresias is responsible for identification of needs to make an order. Concrete amounts should be decided by hard coded module, which counts amounts and necessities.

butter camembert milk yogurtbuy 0% 0% 66% 33%Table 13: Significance of Fridge Scenario Inputs

In the table 13 you can see significance 0% on butter and camembert. It is solely because my training data (Table 32) never triggers buying operations. In an ideal environment where every goods consumed with the same ratio it should be 25% each. In this case I have obtained the classification accuracy 100% on training but only 45% on testing data. Which means the NN needs to be taught by more complex data set. Here comes up the adaptation process. Training data needs to be enriched and then new generation of GAME model needs to be generated and evaluated again.

The same pattern can be applied on any storage at home with RFID technology installed.

7.2.15. Emergency smoke detectorSmoke sensors in the kitchen turn off oven, microwave oven, and other devices and turn

on the fan to ventilate the smoke out of the kitchen. I will try to teach the network to send a message by email about smoke detected in kitchen. This can be done through a rule created manually. If smoke occurs in kitchen you turn off everything manually, turn on fan and then send email via Teiresias application. Teiresias will recognize this behavior and next time send message autonomously, theoretically.

As result NN was able to turn off devices but not turn them on again, which is good, because it would avoid self control of cooking. I could manage to teach the network how to send an email, start fan and turn off devices. It was so perfect that these actions became more acute while nobody was moving in kitchen.

smoke motionoven 59% 40%fan 100% 0%email 41% 58%Table 14: Significance of Smoke Scenario Inputs

The classification accuracy on both training and testing data sets was 100%.

40

8.Design

8. DesignTeiresias application will be designed as modular multitier client-server application. It

consists of several subsystems (layers) as you can see at figure 8.1. At the bottom, there is communication interface, which can be implemented as real KNX Bus communication dispatcher (Calimero from chapter 6.5) or simulator. Both of them should be able to send and receive data and interpret or log them.

All data are stored in database and accessed through Data Access Objects interface, which is implemented by DataStore.

Main Application Module is Teiresias itself. It is responsible for application life cycle as described in chapter 7. It consists of Configuration and Logging modules and uses GAME module for the Neural Networks models generation and evaluation.

At the top lies TeiresiasGUI (client part) which is responsible for configuration and monitoring of the application state. It communicates by RMI.

Figure 8.1 shows how Teiresias is connected to KNX Bus as well. With Teiresias you can use both KNX@Home and KNXLive! as view layer.

41

Figure 8.1: Teiresias Architecture

8.Design

8.1. Application use caseApplication would be used by Users who are inhabitants of smart home in real life. Before

application can be used it must be configured by Administrator to ensure correct setting. Configuration consists of grouping sensors and actuators which hang together logicaly. These groups as described in chapter 6.1. are responsible for packets addressing in KNX network and therefore must be configured once when deployed. Afterwards it should be only configured if changes are necessary. All actions done by users are monitored and logged by Teiresias application and according to them the Neural Network model is generated. This model is used by GAME to evaluate the actual state of sensors and predict actions of users in the future, that's why GAME should be able to manipulate all actuators the same way like user does.

Lastly simulator should have same possibility to simulate inputs almost like user to be able to test application before deployed.

42

Figure 8.2: Use Case Diagram

8.Design

8.2. Package structureI have divided the application into packages as you can see at figure 8.3, where each

package contains functionality provided to whole system. There are following systems: Database package containing DataStore, Communication

package containing Communication Interface implementation (Calimero wrapper), Config package containing configuration methods, GAME as itself, GUI package with Graphic User Interface and last but not least Teiresias package as the main application.

8.3. ComponentsFigure 8.4 shows how particular components are tied together through APIs.

43

Figure 8.4: Component Diagram

Figure 8.3: Package Diagram

8.Design

8.4. DeploymentDeployment would be delivered on one server machine connected to the KNX Bus on the

one side and to the Internet on the other side. This allows control of house remotely. We only have to concern ourselves with security aspects of solution in the future.

In testing environment Teiresias is deployed on a regular PC with JAVA (jdk6) and Database (mysql) engine installed. This machine communicates on intranet which is managed by router with DHCP enabled. This is necessary to allow communication with KNX Bus through KNX/IP tunneling protocol.

In production mode server can be connected to KNX Bus via separated Ethernet connection and can act as the firewall as well, which prevents the possibility of unauthorized interference with system from outside the Internet. Database can be segregated into the dedicated machine as well.

At figure 8.5 you can find the necessary component which needs to be deployed for a full-operable system. GUI act as remote client via RMI technology.

44

Figure 8.5: Deployment Diagram

8.Design

8.5. ImplementationThe application was developed in Netbeans IDE, written in JAVA language in compliance

with jdk 6. The following technologies were used::• log4j for logging• junit for unit testing• simple xml for xml handling• swing for gui• mysql as database• game for neural networks modeling

It consists of modules specified in chapter Chyba: zdroj odkazu nenalezen. At the Figure8.6 you can see an example how Teiresias GUI looks like.

8.6. Proof of conceptTo prove the application's usability I have prepared a more complex scenario which I

enclosed on CD. This scenario simulates real life situations by merging previously taught patterns in one enormous network.

Results were as expected not that much accurate as they were in simple scenarios. A problem occurred in relation to the amount of data.. In order to be able to recognize significant inputs for selected output we need enough data to eliminate noises of irrelevant inputs.

Nevertheless, the classification accuracy of the taught neural network was 95% on training data set and 75% on testing data which is relatively satisfying if you compare it to the complexity of the problem and the amount of generated data.

GAME Neural Network was able to recognize intended patterns after several iterations.

45

Figure 8.6: Teiresias Application GUI Screenshot

9.Conclusions

9. ConclusionsThe Neural Networks based on GAME models are able to suit basic needs of smart

homes and their inhabitants which was proven in the scenarios. Problem can occur while developing complex systems based on plenty of wired sensors and actuators. Hidden dependencies can arise which is partially what this project was intended to be about.

To identify such dependencies and manage them it is necessary to deploy an application into real life environment and monitor its behavior in long term (possibly whole year).

This observation can generate enough relevant data to be able to testify relevancy and usability of the application as a whole.

I have analyzed possibilities of both KNX@Home and KNXlive! systems to be used as KNX Bus communication dispatchers. Both of them are open source based on Linux and Calimero framework. Both of them are relatively stable, KNXlive! has bigger added value due to the whole bundle of utilities which can be used. On the other hand KNX@Home seems to be more user friendly. Their drawbacks are similar because they originate from Calimero bugs in KNX/IP tunneling (which is common for both of them) and of course their nature of open source is their advantage as well.

That is why the usage of one (or eventually compliance with both) of them was delayed until Calimero 2 New Generation would be released in production version and bugs would be fixed.

For Neural Networks modeling GAME was used, which seems to be too complicated at first sight, but became the best friend in the end. It helps to simplify the development by solving common problems that usually arise while working with neural networks such as time dependencies and inputs data inconsistency. All this can be well solved by GAME data preprocessing. After model is generated, it contains all necessary informations to decide how accurate results (predictions) are. GAME model ensembles serve this need perfectly. The evaluation of generated model is relatively straight-forward.

Adaptability of the neural network on change of user's behavior was solved by off-line uploading which is not the most user friendly way, but it helps to prevent any freezing. It is robust and reliable enough to solve specified requirements.

46

10.Future Works

10. Future WorksIt is crucial for a project to be evaluated in real life environment to collect data, find hidden

interconnections and users' responses to the utility of the system.

The available KNX Bus sensors and actuators were bundled into a testing environment which should be easy to install in any laboratory. The sensors can be installed outside the bundle and connected with KNX Bus. Actuators are held inside the box to protect users from high-voltage injuries. It should be able to be operated by students as well, because it does not have any live parts which could be touched.

Currently, only binary sensors (switches) and actuators(lights) are available. In the future more types of sensors and actuators would be needed to test more complex scenarios.

The Teiresias application simulator has to be developed in the future to test and monitor the communication level. One possible option is to use the Oscar visualiser used in the diploma thesis by Marek Tvrdý[43].

KNX@Home and (or) KNXlive! Adaptations should be reconsidered after Calimero 2NG becomes stable in the production version.

47

List of shortcuts

List of shortcutsACHE – Adaptive Control of Home EnvironmentsAI – Artificial IntelligenceAJAX – Asynchronous JavaScript and XMLALZ – Active LeZiANN – Artificial Neural NetworkAPI – Application InterfaceART – Adaptive Resonance TheoryARTMAP – Predictive ARTAWT - Abstract Window Toolkit, part of the Java programming languageCBR – Case Based ReasoningCPU – Central Processing UnitDNA – Deoxyribonucleic AcidECG – Electro CardiogramEcoS – Evolving Connectionist SystemEEG – Electro EncephalogramEIB – European Installation BusFFNN – Feed Forward Neural NetworkGA – Genetic AlgorithmsGP – Genetic ProgrammingGUI – Graphic User Interface HSQLDB – Hyperthreaded Structured Query Language DatabaseHTTP – Hypertext Transfer ProtocolJAVA – programming language originally developed by Sun MicrosystemsJDBC – Java DataBase Controller JSP – Java Server PagesKDE – Linux K Desktop Environment KNX – standardized (EN 50090,ISO/IEC 14543), OSI-based network communications

protocol for intelligent buildings administered by the Konnex.LINUX – Unix-like computer operating system familyLISP – high-level programming language with fully parenthesized syntaxMAS – Multi Agent SystemsNN – Neural NetworkOS – Operating SystemRAM – Random Access MemoryRFID – Radio Frequency IdentificationRMI – Remote Method InvocationRMSE – Root Mean Square ErrorRNN – Recurrent Neural NetworkSHIP – Prediction Algorithm SD – Secure DigitalSQL – Structured Query LanguageSVN – SubversionSWING - Sun's lightweight GUI library for the Java languageUNIX – operating system originally developed by AT&T employees at Bell LabsTDL – Tapped Delay LineTDNN – Time Delay Neural NetworkUSB – Universal Serial Bus

48

Bibliography

Bibliography1: Augusto J.C., Nugent C.D., Smart Homes Can Be Smarter, 20062: Begg R., Hassan R., Artificial Neural Networks in Smart Homes, 20063: Haykin S., Neural Networks: A Comprehensive Foundation, 19944: Hassoun M. H., Fundamentals of Artificial Neural Networks, 19955: Hecht-Nielson R., Neuro Computing6: Eliasmith C., Anderson C.H., Neural Engineering Computation And Dynamics in Neurological Systems, 20037: Hebb D. O., The Organisation of Behavior: A Neurophysiological Theory, 19498: Takagi H., Introduction to Fuzzy Systems, Neural Networks, and Genetic Algorithms, 19979: Rumelhart D. E., McClelland J.L., and the PDP Research Group, Parallel distributed processing: explorations in the microstructure of cognition, 198610: Chan M., Hariton C., Ringeard P., Campo E., Smart House Automation System for the Elderly and Disabled11: Mozer M. C., The Neural Network House: An Environment that adapts to its Inhabitants, 199812: Jorge D., Goncalves V., Ubiquitous Computing and AI Towards an Inclusive Society, 200113: Pigot H., Lefebvre B., Meunier J., Kerherve B., Mayers A., Giroux S., The role of intelligent habitats in upholding elders in residence, 200314: Rialle V., Noury N., Herve T., An experimental Health Smart Home and its distributed Internet based Information and Communication System: first steps of a research project, 200115: Cook D. J., Youngblood M., Heierman E. O., Gopalratnam K., Rao S., Litvin A., Khawaja F., MavHome: An Agent-Based Smart Home, 200316: Illingworth F.R., Callaghan V., Hagras H., A Neural Network Agent Based Approach to Activity Detection in AmI Environments, 200517: Kasabov N., Evolving connectionist systems: Methods and applications inbioinformatics,brain study and intelligent machines, 200218: Elman J. L., Finding structure in time, 199019: Prasanna C.S.S., Sudha N., Kamakoti V., A Principal Component Neural Network based Face Recognition System and Its ASIC Implementation, 200520: Zhanqing L., Khannanian A., Fraser R. H., Cihlar J., Automatic Detection of Fire Smoke using Artificial Neural Networks and Threshold Approaches Applied to AVHRR Imagery, 200121: Hanebeck U.D., Fischer C. Schmidt G., ROMAN: a mobile robotic assistant for indoor service applications, 199722: Khalid M., Omatu S., A Neural Network Controller for a Temperature Control System, 199223: Lin C.T., Juang C.F., Li C.P., Temperature Control with a Neural Fuzzy Inference Network, 199924: Nazeran H., Behbehani K., Neural Networks in Processing and Analysis of Biomedical Signals, 200125: Silva R. and Silva A.C.R., Medical Diagnosis as a Neural Networks Pattern Classification Problem, 199826: Vainio A.M., Valtonen M., Vanhala J., Learning and adaptive fuzzy control system for smart home, 200427: Wang L. X., A course in fuzzy systems and control, 199728: Carpenter G. A., Grossberg S., Rosen D. B., Fuzzy ART: Fast Stable Learning and Categoization of Analog Patterns by an Adaptive Resonance System, 199129: Williamson J.R., Gaussian ARTMAP: A Neural Network for Fast Incremental Learning of Noisy Multidimensional Maps, 199630: Zhang L., Wang G., Wang W., A New Fuzzy ART Neural Network Based on Dual Competition and Resonance Technique, 200631: Obtiko M., Introduction to Genetic Algorithms, 2008, http://www.obitko.com/tutorials/genetic-algorithms/, 200932: Rechenberg I., Evolutionsstrategie, 196033: Holland J., Adaption in Natural and Artificial Systems, 197534: FAKE GAME, ttp://fakegame.wiki.sourceforge.net/, 200935: Kordík P., Fully Automated Knowledge Extraction using Group of Adaptive Models Evolution, 200636: KNX, http://www.knx.org/, 200937: Konnex Association, KNX System-architecture, 200138: Konnex Association, KNX Handbook for Home and Building Control, Basic Principles, 2006

49

Bibliography

39: Konnex Association, Open Data Communication in Building Automation, Controls and Building Management - Home and Building Electronic Systems - Part 2: KNXnet/IP Communication, 200640: Wurm R., Reichert A., Bayer J., KNX@HOME, 200641: KNX@HOME, http://knxathome.fh-deggendorf.de/knxathome/wiki/, 200942: KNXLive!, https://www.auto.tuwien.ac.at/a-lab/knx-eib.html, 200943: Tvrdý M., Řízení nízkoenergetické inteligentní domácnosti, 200944: Hasaj M., Smart Home – Opportunity to make life easier, 2008

50

APPENDIX A KNX Testing Environment Schema

APPENDIX A KNX Testing Environment Schema

51

APPENDIX B GAME Training Input Data Sets

APPENDIX B GAME Training Input Data Sets

ambient light dark

ambient light normal

ambient light bright door hall

motionbathroom motion

bathroom humidity

hall light

bathroom light fan

1,0 0,0 0,0 0,0 0,0 0,0 40,0 0,0 0,0 0,01,0 0,0 0,0 0,0 1,0 0,0 40,0 0,0 0,0 0,01,0 0,0 0,0 0,0 1,0 0,0 40,0 1,0 0,0 0,01,0 0,0 0,0 1,0 1,0 0,0 40,0 1,0 0,0 0,01,0 0,0 0,0 1,0 0,0 1,0 40,0 1,0 0,0 0,01,0 0,0 0,0 1,0 0,0 1,0 40,0 1,0 1,0 0,01,0 0,0 0,0 1,0 1,0 0,0 40,0 0,0 1,0 0,01,0 0,0 0,0 0,0 0,0 1,0 40,0 0,0 1,0 0,01,0 0,0 0,0 0,0 0,0 1,0 40,0 0,0 1,0 0,01,0 0,0 0,0 1,0 0,0 1,0 40,0 0,0 1,0 0,01,0 0,0 0,0 1,0 1,0 0,0 40,0 1,0 1,0 0,01,0 0,0 0,0 1,0 0,0 1,0 40,0 1,0 0,0 0,01,0 0,0 0,0 0,0 1,0 0,0 40,0 1,0 0,0 0,01,0 0,0 0,0 0,0 1,0 0,0 40,0 0,0 0,0 0,01,0 0,0 0,0 0,0 0,0 0,0 40,0 0,0 0,0 0,00,0 1,0 0,0 0,0 0,0 0,0 40,0 0,0 0,0 0,00,0 1,0 0,0 0,0 1,0 0,0 40,0 0,0 0,0 0,00,0 1,0 0,0 1,0 1,0 0,0 40,0 0,0 0,0 0,00,0 1,0 0,0 1,0 0,0 1,0 40,0 0,0 0,0 0,00,0 1,0 0,0 1,0 0,0 1,0 40,0 0,0 1,0 0,00,0 1,0 0,0 0,0 0,0 1,0 40,0 0,0 1,0 0,00,0 1,0 0,0 0,0 0,0 1,0 40,0 0,0 1,0 0,00,0 1,0 0,0 1,0 0,0 1,0 40,0 0,0 1,0 0,00,0 1,0 0,0 1,0 0,0 1,0 40,0 0,0 0,0 0,00,0 1,0 0,0 0,0 1,0 0,0 40,0 0,0 0,0 0,00,0 1,0 0,0 0,0 0,0 0,0 40,0 0,0 0,0 0,00,0 0,0 1,0 0,0 0,0 0,0 40,0 0,0 0,0 0,00,0 0,0 1,0 0,0 1,0 0,0 40,0 0,0 0,0 0,00,0 0,0 1,0 1,0 1,0 0,0 40,0 0,0 0,0 0,00,0 0,0 1,0 1,0 0,0 1,0 40,0 0,0 0,0 0,00,0 0,0 1,0 1,0 0,0 1,0 40,0 0,0 1,0 0,00,0 0,0 1,0 0,0 0,0 1,0 40,0 0,0 1,0 0,00,0 0,0 1,0 0,0 0,0 1,0 40,0 0,0 1,0 0,00,0 0,0 1,0 1,0 0,0 1,0 40,0 0,0 1,0 0,00,0 0,0 1,0 1,0 0,0 1,0 40,0 0,0 0,0 0,00,0 0,0 1,0 0,0 1,0 0,0 40,0 0,0 0,0 0,00,0 0,0 1,0 0,0 0,0 0,0 40,0 0,0 0,0 0,01,0 0,0 0,0 0,0 0,0 1,0 80,0 0,0 1,0 1,01,0 0,0 0,0 0,0 0,0 0,0 80,0 0,0 0,0 1,01,0 0,0 0,0 0,0 0,0 0,0 40,0 0,0 0,0 0,00,0 1,0 0,0 0,0 0,0 1,0 80,0 0,0 1,0 1,00,0 1,0 0,0 0,0 0,0 0,0 80,0 0,0 0,0 1,00,0 1,0 0,0 0,0 0,0 0,0 40,0 0,0 0,0 0,00,0 0,0 1,0 0,0 0,0 1,0 80,0 0,0 1,0 1,00,0 0,0 1,0 0,0 0,0 0,0 80,0 0,0 0,0 1,00,0 0,0 1,0 0,0 0,0 0,0 40,0 0,0 0,0 0,0

Table 15: Bathroom Scenario from chapter 7.2.1. Raw input data

52

APPENDIX B GAME Training Input Data Sets

ambient light dark

ambient light normal

ambient light bright door hall

motionbathroom

motionbathroom humidity

hall light

bathroom light fan

1,0 0,0 0,0 0,0 0,0 0,0 40,0 0,0 0,0 0,01,0 0,0 0,0 0,0 1,0 0,0 40,0 1,0 0,0 0,01,0 0,0 0,0 1,0 1,0 0,0 40,0 1,0 0,0 0,01,0 0,0 0,0 1,0 0,0 1,0 40,0 1,0 1,0 0,01,0 0,0 0,0 0,0 0,0 1,0 40,0 0,0 1,0 0,01,0 0,0 0,0 0,0 0,0 1,0 40,0 0,0 1,0 0,01,0 0,0 0,0 1,0 0,0 1,0 40,0 1,0 1,0 0,01,0 0,0 0,0 0,0 1,0 0,0 40,0 1,0 0,0 0,01,0 0,0 0,0 0,0 0,0 0,0 40,0 0,0 0,0 0,00,0 1,0 0,0 0,0 0,0 0,0 40,0 0,0 0,0 0,00,0 1,0 0,0 0,0 1,0 0,0 40,0 0,0 0,0 0,00,0 1,0 0,0 1,0 1,0 0,0 40,0 0,0 0,0 0,00,0 1,0 0,0 1,0 0,0 1,0 40,0 0,0 1,0 0,00,0 1,0 0,0 0,0 0,0 1,0 40,0 0,0 1,0 0,00,0 1,0 0,0 0,0 0,0 1,0 40,0 0,0 1,0 0,00,0 1,0 0,0 1,0 0,0 1,0 40,0 0,0 1,0 0,00,0 1,0 0,0 0,0 1,0 0,0 40,0 0,0 0,0 0,00,0 1,0 0,0 0,0 0,0 0,0 40,0 0,0 0,0 0,00,0 0,0 1,0 0,0 0,0 0,0 40,0 0,0 0,0 0,00,0 0,0 1,0 0,0 1,0 0,0 40,0 0,0 0,0 0,00,0 0,0 1,0 1,0 1,0 0,0 40,0 0,0 0,0 0,00,0 0,0 1,0 1,0 0,0 1,0 40,0 0,0 1,0 0,00,0 0,0 1,0 0,0 0,0 1,0 40,0 0,0 1,0 0,00,0 0,0 1,0 0,0 0,0 1,0 40,0 0,0 1,0 0,00,0 0,0 1,0 1,0 0,0 1,0 40,0 0,0 1,0 0,00,0 0,0 1,0 0,0 1,0 0,0 40,0 0,0 0,0 0,00,0 0,0 1,0 0,0 0,0 0,0 40,0 0,0 0,0 0,01,0 0,0 0,0 0,0 0,0 1,0 80,0 0,0 1,0 1,01,0 0,0 0,0 0,0 0,0 0,0 80,0 0,0 0,0 1,01,0 0,0 0,0 0,0 0,0 0,0 40,0 0,0 0,0 0,00,0 1,0 0,0 0,0 0,0 1,0 80,0 0,0 1,0 1,00,0 1,0 0,0 0,0 0,0 0,0 80,0 0,0 0,0 1,00,0 1,0 0,0 0,0 0,0 0,0 40,0 0,0 0,0 0,00,0 0,0 1,0 0,0 0,0 1,0 80,0 0,0 1,0 1,00,0 0,0 1,0 0,0 0,0 0,0 80,0 0,0 0,0 1,00,0 0,0 1,0 0,0 0,0 0,0 40,0 0,0 0,0 0,0

Table 16: Bathroom Scenario from chapter 7.2.1. Prepared optimized Data

53

APPENDIX B GAME Training Input Data Sets

hall motion

livingroom motion

entrance door

!livingroom heating

!livingroom window !tv

0,0 0,0 0,0 15,0 0,0 0,00,0 1,0 0,0 25,0 1,0 1,00,0 1,0 0,0 25,0 1,0 1,01,0 0,0 0,0 15,0 1,0 1,00,0 1,0 0,0 25,0 1,0 1,00,0 1,0 0,0 25,0 1,0 1,01,0 0,0 0,0 15,0 1,0 1,00,0 1,0 0,0 25,0 1,0 1,00,0 1,0 0,0 25,0 1,0 1,01,0 0,0 0,0 15,0 1,0 1,00,0 1,0 0,0 25,0 1,0 1,00,0 1,0 0,0 25,0 1,0 1,01,0 0,0 0,0 15,0 1,0 1,00,0 1,0 0,0 25,0 1,0 1,00,0 1,0 0,0 25,0 1,0 1,01,0 0,0 0,0 15,0 0,0 0,01,0 0,0 1,0 15,0 0,0 0,00,0 0,0 0,0 15,0 0,0 0,0

Table 17: Leaving Home Scenario from chapter 7.2.2.

54

APPENDIX B GAME Training Input Data Sets

ambient light dark

hall motion

livingroom motion

entrance door

!livingroom heating

!livingroom window !tv

0,0 0,0 0,0 0,0 15,0 0,0 0,00,0 0,0 1,0 0,0 25,0 1,0 1,00,0 0,0 1,0 0,0 25,0 1,0 1,00,0 1,0 0,0 0,0 15,0 1,0 1,00,0 0,0 1,0 0,0 25,0 1,0 1,00,0 0,0 1,0 0,0 25,0 1,0 1,00,0 1,0 0,0 0,0 15,0 1,0 1,00,0 0,0 1,0 0,0 25,0 1,0 1,00,0 0,0 1,0 0,0 25,0 1,0 1,00,0 1,0 0,0 0,0 15,0 1,0 1,00,0 0,0 1,0 0,0 25,0 1,0 1,00,0 0,0 1,0 0,0 25,0 1,0 1,00,0 1,0 0,0 0,0 15,0 1,0 1,00,0 0,0 1,0 0,0 25,0 1,0 1,00,0 0,0 1,0 0,0 25,0 1,0 1,00,0 1,0 0,0 0,0 15,0 0,0 0,00,0 1,0 0,0 1,0 15,0 0,0 0,00,0 0,0 0,0 0,0 15,0 0,0 0,00,0 0,0 0,0 0,0 15,0 0,0 0,00,0 1,0 0,0 1,0 15,0 0,0 0,00,0 1,0 0,0 0,0 15,0 0,0 0,00,0 0,0 1,0 0,0 25,0 1,0 0,00,0 0,0 1,0 0,0 25,0 1,0 0,00,0 1,0 0,0 0,0 15,0 1,0 0,00,0 0,0 1,0 0,0 25,0 1,0 0,00,0 0,0 1,0 0,0 25,0 1,0 0,00,0 1,0 0,0 0,0 15,0 1,0 0,00,0 0,0 1,0 0,0 25,0 1,0 0,00,0 0,0 1,0 0,0 25,0 1,0 0,00,0 1,0 0,0 0,0 15,0 1,0 0,00,0 0,0 1,0 0,0 25,0 1,0 0,00,0 0,0 1,0 0,0 25,0 1,0 0,00,0 1,0 0,0 0,0 15,0 1,0 0,00,0 0,0 1,0 0,0 25,0 1,0 0,00,0 0,0 1,0 0,0 25,0 1,0 0,00,0 1,0 0,0 0,0 15,0 0,0 0,00,0 1,0 0,0 1,0 15,0 0,0 0,00,0 0,0 0,0 0,0 15,0 0,0 0,00,0 0,0 0,0 0,0 15,0 0,0 0,00,0 1,0 0,0 1,0 15,0 0,0 0,00,0 1,0 0,0 0,0 15,0 0,0 0,00,0 0,0 1,0 0,0 25,0 1,0 1,00,0 0,0 1,0 0,0 25,0 1,0 1,0

Table 18: Returning back Home Evening Scenario from chapter 7.2.3.

55

APPENDIX B GAME Training Input Data Sets

temperature motion humidity co2 !heating !window !fan

25,0 1,0 40,0 0,5 25,0 0,0 0,025,0 1,0 40,0 0,6 25,0 1,0 0,024,0 1,0 30,0 0,5 25,0 1,0 0,023,0 1,0 20,0 0,4 25,0 0,0 0,024,0 1,0 30,0 0,4 25,0 0,0 0,025,0 1,0 40,0 0,5 25,0 0,0 0,025,0 1,0 50,0 0,5 25,0 0,0 0,025,0 1,0 60,0 0,5 25,0 0,0 0,025,0 1,0 70,0 0,5 25,0 0,0 1,025,0 1,0 50,0 0,5 25,0 0,0 1,025,0 1,0 40,0 0,5 25,0 0,0 0,025,0 1,0 40,0 0,5 25,0 0,0 0,025,0 1,0 40,0 0,6 25,0 1,0 0,024,0 0,0 30,0 0,5 15,0 1,0 0,022,0 0,0 20,0 0,4 15,0 0,0 0,023,0 0,0 30,0 0,4 15,0 0,0 0,024,0 0,0 40,0 0,5 15,0 0,0 0,025,0 0,0 50,0 0,5 15,0 0,0 0,025,0 0,0 60,0 0,5 15,0 0,0 0,025,0 0,0 70,0 0,5 15,0 0,0 1,025,0 0,0 50,0 0,5 15,0 0,0 1,025,0 0,0 40,0 0,5 15,0 0,0 0,0

Table 19: Ventilation Scenario from chapter 7.2.4.

sunny cloudy rainy windy foggy storm humidity !heating

1,0 0,0 0,0 0,0 0,0 0,0 40,0 22,00,0 1,0 0,0 0,0 0,0 0,0 50,0 23,00,0 0,0 1,0 0,0 0,0 0,0 80,0 28,00,0 0,0 0,0 1,0 0,0 0,0 50,0 25,00,0 0,0 0,0 0,0 1,0 0,0 80,0 26,00,0 0,0 0,0 0,0 0,0 1,0 50,0 25,0

Table 20: Heating Scenario from chapter 7.2.5.

56

APPENDIX B GAME Training Input Data Sets

mother father !heating !light

0,0 0,0 15,0 0,01,0 0,0 30,0 1,00,0 0,0 15,0 0,01,0 0,0 30,0 1,00,0 0,0 15,0 0,00,0 1,0 25,0 0,80,0 0,0 15,0 0,00,0 1,0 25,0 0,80,0 0,0 15,0 0,01,0 0,0 30,0 1,01,0 1,0 28,0 1,00,0 1,0 25,0 0,80,0 0,0 15,0 0,0

Table 21: Priority Scenario from chapter 7.2.6.

tv_on music_on phone_on !tv_volume !music_volume

0,0 0,0 0,0 0,0 0,01,0 0,0 0,0 1,0 0,01,0 0,0 0,0 1,0 0,01,0 1,0 0,0 0,5 0,51,0 1,0 0,0 0,5 0,50,0 1,0 0,0 0,0 1,00,0 1,0 0,0 0,0 1,00,0 0,0 0,0 0,0 0,00,0 0,0 1,0 0,0 0,01,0 0,0 1,0 0,2 0,01,0 1,0 1,0 0,2 0,21,0 1,0 0,0 0,5 0,51,0 0,0 0,0 1,0 0,01,0 0,0 1,0 0,2 0,00,0 0,0 1,0 0,0 0,00,0 0,0 0,0 0,0 0,00,0 1,0 0,0 0,0 1,00,0 1,0 1,0 0,0 0,20,0 1,0 0,0 0,0 1,00,0 0,0 0,0 0,0 0,01,0 0,0 0,0 1,0 0,01,0 0,0 1,0 0,2 0,01,0 0,0 0,0 1,0 0,00,0 0,0 0,0 0,0 0,00,0 1,0 0,0 0,0 1,01,0 1,0 0,0 0,5 0,51,0 1,0 1,0 0,2 0,21,0 1,0 0,0 0,5 0,51,0 0,0 0,0 1,0 0,00,0 0,0 0,0 0,0 0,0

Table 22: Volume Control Scenario from chapter 7.2.7.

57

APPENDIX B GAME Training Input Data Sets

phone motion !recorder0,0 0,0 0,00,0 1,0 0,00,0 1,0 0,01,0 1,0 0,01,0 1,0 0,00,0 1,0 0,00,0 0,0 0,01,0 0,0 0,01,0 0,0 1,00,0 0,0 0,0

Table 23: Phone Recorder Scenario from chapter 7.2.8.

phone(t-1) phone(t-0) motion(t-1) motion(t-0)!recorder0,0 0,0 0,0 0,0 0,00,0 0,0 0,0 1,0 0,00,0 0,0 1,0 1,0 0,00,0 1,0 1,0 1,0 0,01,0 1,0 1,0 1,0 0,01,0 0,0 1,0 1,0 0,00,0 0,0 1,0 0,0 0,00,0 0,0 0,0 0,0 0,00,0 1,0 0,0 0,0 0,01,0 1,0 0,0 0,0 1,01,0 0,0 0,0 0,0 0,0

Table 24: Time-shifted Recorder Scenario from chapter 7.2.8.

58

APPENDIX B GAME Training Input Data Sets

moisture A moisture B !water A !water B80,0 80,0 0,0 0,070,0 70,0 0,0 0,060,0 60,0 0,0 0,050,0 50,0 1,0 0,060,0 40,0 1,0 1,070,0 50,0 1,0 1,080,0 60,0 0,0 1,080,0 70,0 0,0 1,070,0 80,0 0,0 0,060,0 80,0 0,0 0,050,0 70,0 1,0 0,060,0 60,0 1,0 0,070,0 50,0 1,0 0,080,0 40,0 0,0 1,080,0 50,0 0,0 1,070,0 60,0 0,0 1,060,0 70,0 0,0 1,050,0 80,0 1,0 0,060,0 80,0 1,0 0,070,0 70,0 1,0 0,080,0 60,0 0,0 0,080,0 50,0 0,0 0,070,0 40,0 0,0 1,060,0 50,0 0,0 1,050,0 60,0 1,0 1,060,0 70,0 1,0 1,070,0 80,0 1,0 0,080,0 80,0 0,0 0,080,0 70,0 0,0 0,070,0 60,0 0,0 0,060,0 50,0 0,0 0,050,0 40,0 1,0 1,060,0 50,0 1,0 1,070,0 60,0 1,0 1,080,0 70,0 0,0 1,080,0 80,0 0,0 0,0

Table 25: Plants Watering Scenario from chapter 7.2.9.

moisture_A(t-1) moisture_A(t-0) moisture_B(t-1) moisture_B(t-0) !water_A !water_B80,0 80,0 80,0 80,0 0,0 0,080,0 70,0 80,0 70,0 0,0 0,070,0 60,0 70,0 60,0 0,0 0,060,0 50,0 60,0 50,0 1,0 0,050,0 60,0 50,0 40,0 1,0 1,060,0 70,0 40,0 50,0 1,0 1,070,0 80,0 50,0 60,0 0,0 1,080,0 80,0 60,0 70,0 0,0 1,080,0 70,0 70,0 80,0 0,0 0,070,0 60,0 80,0 80,0 0,0 0,060,0 50,0 80,0 70,0 1,0 0,0

Tabulka 26: Time-shifted Plants Watering Scenario from chapter 7.2.9.

59

APPENDIX B GAME Training Input Data Sets

daytime morning room motion kitchen motion !coffee0,0 0,0 0,0 0,01,0 0,0 0,0 0,01,0 1,0 0,0 0,01,0 0,0 1,0 1,01,0 0,0 1,0 0,01,0 0,0 0,0 0,00,0 1,0 0,0 0,00,0 0,0 1,0 0,00,0 0,0 0,0 0,00,0 1,0 0,0 0,00,0 0,0 1,0 0,00,0 0,0 0,0 0,00,0 1,0 0,0 0,00,0 0,0 1,0 0,00,0 0,0 0,0 0,01,0 0,0 0,0 0,01,0 1,0 0,0 0,01,0 0,0 1,0 1,01,0 0,0 1,0 0,01,0 1,0 0,0 0,01,0 0,0 1,0 0,01,0 1,0 1,0 1,00,0 1,0 1,0 0,00,0 0,0 1,0 1,00,0 0,0 0,0 0,01,0 0,0 0,0 0,01,0 1,0 0,0 0,01,0 0,0 1,0 1,01,0 0,0 1,0 0,01,0 0,0 0,0 0,00,0 0,0 0,0 0,0

Table 27: Coffee Scenario from chapter 7.2.10.

daytime morning (t-2)

daytime morning (t-1)

daytime morning

room motion (t-2)

room motion (t-1)

room motion

kitchen motion (t-2)

kitchen motion (t-1)

kitchen motion !coffee

0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,00,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,00,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,00,0 0,0 1,0 0,0 0,0 0,0 0,0 0,0 0,0 0,00,0 1,0 1,0 0,0 0,0 1,0 0,0 0,0 0,0 0,01,0 1,0 1,0 0,0 1,0 0,0 0,0 0,0 1,0 1,01,0 1,0 1,0 1,0 0,0 0,0 0,0 1,0 1,0 0,01,0 1,0 1,0 0,0 0,0 0,0 1,0 1,0 0,0 0,01,0 1,0 0,0 0,0 0,0 1,0 1,0 0,0 0,0 0,01,0 0,0 0,0 0,0 1,0 0,0 0,0 0,0 1,0 0,00,0 0,0 0,0 1,0 0,0 0,0 0,0 1,0 0,0 0,00,0 0,0 0,0 0,0 0,0 1,0 1,0 0,0 0,0 0,00,0 0,0 0,0 0,0 1,0 0,0 0,0 0,0 1,0 0,00,0 0,0 0,0 1,0 0,0 0,0 0,0 1,0 0,0 0,00,0 0,0 0,0 0,0 0,0 1,0 1,0 0,0 0,0 0,00,0 0,0 0,0 0,0 1,0 0,0 0,0 0,0 1,0 0,0

Table 28: Time-shifted Coffee Scenario from chapter 7.2.10.

60

APPENDIX B GAME Training Input Data Sets

motion living room motion hall motion kitchen motion bedroom !tv0,0 0,0 0,0 0,0 0,00,0 1,0 0,0 0,0 0,01,0 0,0 0,0 0,0 0,01,0 0,0 0,0 0,0 1,01,0 0,0 0,0 0,0 1,00,0 1,0 0,0 0,0 1,00,0 0,0 1,0 0,0 1,01,0 0,0 0,0 0,0 1,01,0 0,0 0,0 0,0 0,00,0 1,0 0,0 0,0 0,00,0 0,0 0,0 1,0 0,00,0 0,0 0,0 0,0 0,00,0 0,0 0,0 1,0 0,00,0 1,0 0,0 0,0 0,01,0 0,0 0,0 0,0 1,00,0 0,0 1,0 0,0 1,01,0 0,0 0,0 0,0 1,00,0 1,0 0,0 0,0 0,00,0 0,0 0,0 0,0 0,0

Table 29: Multimedia Scenario from chapter 7.2.11.

61

APPENDIX B GAME Training Input Data Sets

ambient light dark

hall motion

bedroom motion

Living room motion

kitchen motion

bathroom motion

!hall light

!bedroom light

!living room light

!kitchen light

!bathroom light !tv

0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,00,0 1,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,00,0 0,0 0,0 1,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,00,0 0,0 0,0 0,0 1,0 0,0 0,0 0,0 0,0 0,0 0,0 0,00,0 0,0 0,0 1,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,00,0 1,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,00,0 0,0 0,0 0,0 0,0 1,0 0,0 0,0 0,0 0,0 1,0 0,00,0 1,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,00,0 0,0 1,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,00,0 1,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,00,0 0,0 0,0 1,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,01,0 0,0 0,0 1,0 0,0 0,0 0,0 0,0 1,0 0,0 0,0 0,01,0 0,0 0,0 1,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 1,01,0 0,0 0,0 1,0 0,0 0,0 0,0 0,0 1,0 0,0 0,0 0,01,0 1,0 0,0 0,0 0,0 0,0 1,0 0,0 0,0 0,0 0,0 0,01,0 0,0 1,0 0,0 0,0 0,0 0,0 1,0 0,0 0,0 0,0 0,01,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,01,0 0,0 1,0 0,0 0,0 0,0 0,0 1,0 0,0 0,0 0,0 0,01,0 1,0 0,0 0,0 0,0 0,0 1,0 0,0 0,0 0,0 0,0 0,01,0 0,0 0,0 0,0 0,0 1,0 0,0 0,0 0,0 0,0 1,0 0,01,0 1,0 0,0 0,0 0,0 0,0 1,0 0,0 0,0 0,0 0,0 0,01,0 0,0 0,0 1,0 0,0 0,0 0,0 0,0 1,0 0,0 0,0 0,01,0 0,0 0,0 0,0 1,0 0,0 0,0 0,0 0,0 1,0 0,0 0,01,0 0,0 0,0 1,0 0,0 0,0 0,0 0,0 1,0 0,0 0,0 0,01,0 1,0 0,0 0,0 0,0 0,0 1,0 0,0 0,0 0,0 0,0 0,01,0 0,0 1,0 0,0 0,0 0,0 0,0 1,0 0,0 0,0 0,0 0,01,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0

Table 30: Lights Scenario from chapter 7.2.12.

ambient light bright light intensity !sun blind

0,0 20,0 0,00,0 30,0 0,00,0 40,0 0,00,2 50,0 0,00,4 60,0 0,00,6 70,0 0,00,8 80,0 1,01,0 70,0 1,00,8 70,0 1,00,6 70,0 0,00,4 60,0 0,00,2 50,0 0,00,0 40,0 0,00,0 30,0 0,00,0 20,0 0,00,0 40,0 0,00,0 20,0 0,00,0 40,0 0,00,0 20,0 0,0

Table 31: Sun blinds Scenario from chapter 7.2.13.

62

APPENDIX B GAME Training Input Data Sets

butter camembert milk yoghurt !buy

1,0 1,0 1,0 1,0 0,00,9 1,0 0,5 0,8 0,00,8 0,4 0,5 0,8 0,00,7 0,4 0,0 0,6 1,00,7 1,0 1,0 1,0 0,00,6 0,4 1,0 1,0 0,00,5 0,4 0,5 0,8 0,00,4 0,0 0,0 0,6 1,01,0 1,0 1,0 1,0 0,0

Table 32: Fridge Scenario from chapter 7.2.14.

smoke motion !oven !fan !email

0,0 0,0 0,0 0,0 0,00,0 1,0 0,0 0,0 0,00,0 1,0 1,0 0,0 0,00,0 1,0 1,0 0,0 0,01,0 1,0 0,0 1,0 0,00,0 1,0 0,0 0,0 0,00,0 1,0 1,0 0,0 0,00,0 0,0 1,0 0,0 0,01,0 0,0 0,0 1,0 1,00,0 0,0 0,0 0,0 0,0

Table 33: Smoke Scenario from chapter 7.2.15.

63