Skip to main content

Posts

Android Development | Part 2 Architecture of the app After learning basics of android framework about activities, fragments and its states, we decided to create first version of an app. It consisted of several activities which were designed to communicate with each other (e.g. sending ids or string names of chosen items). As it turned out, there is no need of creating separate activity, especially for a simple app like planner. Moreover, switching between two activities is longer than two fragments. More detailed debate activities vs fragments described in this StackOverflow question. Thus, it was decided to leave ourselves with one activity (basically "main activity") and several fragments for each page(e.g. home screen with rooms, room fragment, addItem and AddRoom fragments). Along with fragments it was suggested to add view adapters to accommodate standard android LinearLayout and GridLayout Views, thus creating the following hierarchy: In both cases(fragment-...
Recent posts
Android Development | Part 1 Update: Android app already created and available via this link In this post series I will be describing my experience in learning Android development using Java. Me and my friend recently decided to develop some basic android application sort of TO-DO list/scheduler that will manage your cleaning work at home. The sample window of this app may look like this image bellow: So, how to begin? What I should learn first? That's kind of questions I am still asking myself :) Android Studio The most famous IDE fo Android development, however it is known to have some bugs. Android application consists of two parts: code and xmls. XML works as HTML for a web app, containing texts, buttons, image objects etc and located in res folder. The main notion in Android is Activity which as an atomic element of an app. Along with Activity android creates XML related to it. In order to relate objects on this XML layout use findViewById(R.id.some_id_fromXML) , wh...

Application of Reinforcement Learning in HVAC systems. Part 3

SARSA controller setup After we figured out the environment, it is important to understand how to apply RL concept on it. RL works in continuous as well as in discrete time state-space environments. MLE+ dictates the conditions in which we will operate: we will construct discrete state-space using variation of three parameters – temperature set point, actual temperature of a zone and electric heater. I did it in straightforward way – having the vectors of values that can be possible for each variable (e.g. heater can have loads between 0 and 12000KW); made combinations of all three vectors to define all state-spaces within which our building model can operate (more importantly we are trying to not define state-spaces that not possible for a real building systems). Along creation of states it creates Q matrix for three actions meaning increase, decrease and don't change temperature set point using reward function described bellow: As you may notice reward function appreciates...

Application of Reinforcement Learning in HVAC systems. Part 2

So, how to model an office building to simulate the work of our controller? In short, I have used the following list of programs: Matlab, EnergyPlus and MLE+ in tandem. First things first, EnergyPlus - is an building simulation engine that will allow you to modulate maybe not all but most of the physical phenomena running inside real physical structures, including heat transfer and temperature spread. Even though it is a quite a hard to understand how to use EnergyPlus if you are not expert (maybe even for civil engineers), you can always download already designed models of a buildings like I did), which can be found on energy.gov site. Therefore, I took one floor three office medium building EnergyPlus model that comes with and .idf and weather files. Basically, the building has three rooms with electric radiant heating floors and one window and some ventilation system. Simple schematics shown on a picture below: As you may guess, I want to be able to test some controllers on th...

Application of Reinforcement Learning in HVAC systems. Part 1

How Machine Learning and Reinforcement Learning applied for physical systems like building heating? Some intro ... Many civil engineering and computer science researchers are pushing forward the idea of applying new intelligent methods of control of energy consuming systems such as heating, ventilation and air conditioning(HVAC) in non-residential or commercial buildings. The motivation behind improvement of performance of these systems is evident, they account for almost 40% out of total building energy demand. Since this was a question of my university study I have already done some literature review on this topic and outline the main research directions. Even though some research directions may not be seem directly related, but they are have potential to used for our purpose. Thus, the following are main research topics related to the improvement of energy and comfort performance of HVAC systems: Statistical methods. Record previous loads, building statistical models trying ...

Machine Learning. Grid search

How to choose best fit parameters for your ANN or SVM model using scikit learn grid search ? (This topic refers to classification problem). As a beginner, after creating a couple of simple neural networks either via tensorflow or Matlab I was thinking about one question: How do I decide which network architecture (number of layers, neurons) and parameters (epoch number, batch size, optimization algorithms and initialization types) to choose? And actually, this question was answered via Grid Search scikit python library that automatizes process of the best parameters. In example below I tried cover all typical tuning parameters: # Since running GridSearch may be quite time/calculation consuming # I used GPU based tensorflow in order to speed-up calculation import tensorflow as tf from keras.backend.tensorflow_backend import set_session config = tf.ConfigProto() # Defining GPU usage limit to 75% config.gpu_options.per_process_gpu_memory_fraction = 0.75 ...

Machine Learning. Part III

Non-residential building occupancy modeling. Part III. Defining occupancy patterns. Recalling from the last part II we have got building occupancy data-set. In this part I will apply k-means cluster algorithm in order to identify typical occupancy patterns with daily resolution. To better visualize input data we have, see the following table below: Month Day Weekday Minutes Temperature Relative humidity Air Velocity Occupancy out of 24 7 31 3 779 23 89 1.3411 0 8 1 4 823 24 88 3.578 2 ... ... ... ... ... ... ... ... So I changed initial data by transforming Matlab absolute time readings into month, day, weekday(where 1 - Sunday,2 - Monday etc.), day time in minutes (with 15 min time step); temperature,velocity and humidity is general outdoor data; and finally total building occupancy. Original...