{"id":32046,"date":"2018-02-20T23:50:30","date_gmt":"2018-02-20T23:50:30","guid":{"rendered":"https:\/\/writemyessayfree.com\/energy-consumption-monitor"},"modified":"2017-08-16T06:05:13","modified_gmt":"2017-08-16T06:05:13","slug":"energy-consumption-monitor","status":"publish","type":"post","link":"https:\/\/www.benedictsol.com\/blogs\/energy-consumption-monitor\/","title":{"rendered":"\u201cEnergy Consumption Monitor\u201d"},"content":{"rendered":"<div class=\"the_content_wrapper\">\n<p>Basic C Project<\/p>\n<p>Page 1<br \/> Project Title: \u201cEnergy Consumption Monitor\u201d<br \/> CS 1325<br \/> Spring 2017<br \/> Deadline: April 23rd, 10:00 PM using e-Learning ONLY.<br \/> Every student is expected to submit their own, individual\/original work, and should be able<br \/> to explain and answer questions regarding the code and the way the code was written.<br \/> If your submission contains, any file obtained from internet (except the files provided as<br \/> input files), or other person (class mates, tutors, etc.), your submission will be discarded<br \/> and the grade will be 0 automatically.<br \/> Ask if you have any question.<br \/> 1. Project summary<br \/> Power consumption is a key parameter when designing new systems (software and hardware). In a single<br \/> system multiple modules may consume energy at a different rate, in different periods of time.<br \/> In this project, multiple modules (sensors) report the power consumption to a single server. The server<br \/> will read and process the information and obtain basic statistical parameters (min, max, average, etc.)<br \/> over a period of time.<br \/> In this project, all the sensor information is obtained through input files.<br \/> 2. Input parameters<br \/> The user should enter:<br \/> ? Number of sensors used,<br \/> ? File location (full path),<br \/> ? Time period (tinitial and tfinal).<br \/> After the previous information is provided, then the user can obtain the total power consumed between<br \/> tinitial and tfinal., as well as the sensor that consumed the most and the least amount of power.<br \/> 3. Input Files<br \/> The filename includes the prefix SENSOR_ and the sensor number: SENSOR&lt;sensor_id&gt;.txt.<br \/> For example SENSOR_1.txt is the file that contains the data collected by sensor 1.<br \/> ? Files have the following format:<br \/> &lt;time_stamp&gt; &lt;value&gt; &lt;units&gt;<br \/> For example:<br \/> 4534 97.4 mW<br \/> 4554 97.5 mW<br \/> 4574 97.6 mW<br \/> Notice that each sensor may have a different sample rate (e.g. time in between measurements),<br \/> and different units (i.e. some sensor may measure in mW while some other may use \u00b5W)<br \/> CS 1325 \u2013 Project Description Fall 2014<br \/> Page 2<br \/> 4. Power consumption per sensor<br \/> The power consumed by a sensor between [tinitial, tfinal] can be obtained by integrating the data as<br \/> follows. Assume that the sensor data is the one described in 3. Assume that the time interval is [4534,<br \/> 4574].<br \/> Figure 1: Power consumption per sensor<br \/> The power consumed is computed as the sum of the A1 and A2. These areas can be obtained as A1 =<br \/> (4554-4534)*97.4 = 20*97.4 and A2= (4574-4554)*97.5 = 20*97.5 mW<br \/> Q: What if the time interval was [4540, 4570]?<br \/> A: Then A1 = (4554-4540)*97.4 = 14*97.4 and A2= (4570-4554)*97.5 = 16*97.5 mW<br \/> Q: OK, what if the time interval was [4530, 4580]?<br \/> A: In this case there is no value for 4530 nor 4580. But, we can use the last \u201cknown\u201d value, such that<br \/> A1 = (4554-4530)*97.4 = 24*97.4 , A2= (4574-4554)*97.5 = 20*97.5 mW and A3 = (4580-<br \/> 4574)*97.6=6*97.6 mW<br \/> 5. Functional requirements<br \/> Roles:<br \/> User<br \/> USE CASE a: \u201c[Enter the number of sensors]\u201d (5 Points)<br \/> ? The user selects option a from the menu<br \/> ? The user is asked to enter the number of sensors<br \/> ? The number should be an integer &gt;0<br \/> ? The program display the main menu<br \/> USE CASE b: \u201c[Enter file location]\u201d (5 Points)<br \/> ? The user selects option b from the menu<br \/> ? The user is asked to enter the file location (full path: folder and filename with file<br \/> extension)<br \/> ? The program should warn the user if the file cannot be opened, or there is an error reading<br \/> the file(i.e. incomplete\/ incorrect data in the file)<br \/> ? The program displays the main menu<br \/> CS 1325 \u2013 Project Description Fall 2014<br \/> Page 3<br \/> USE CASE c: \u201c[Time interval t0 and tf]\u201d (5 Points)<br \/> ? The user selects option c from the menu<br \/> ? The user is asked to enter the values for tinitial and tfinal<br \/> ? Both (initial and final time) should be integers &gt; 0<br \/> ? tinitial should be smaller than tfinal<br \/> ? The program displays the main menu<br \/> USE CASE d: \u201c[Get Statistics]\u201d (40 Points)<br \/> ? The user selects option d from the menu<br \/> ? The program checks if the options a-c were already chosen.<br \/> ? If all the input (a-c) is available, then computes and display the table with the values for<br \/> min, max and average power consumed per sensor.<br \/> ? If (a-c) is not available the program should warn the user, indicating the missing<br \/> information and display the main menu.<br \/> ? The last row shows the total power consumed. Normalize the units to W.<br \/> ? The table indicates the sensor with the highest and lowest power consumption within<br \/> that period of time<br \/> ? The program displays the main menu<br \/> USE CASE a-d: \u201c[VALIDATION]\u201d (20 Points)<br \/> ? Input should be a valid data type:<br \/> o Integer, float, c-string, etc.<br \/> ? Range should be valid<br \/> o Based on entered parameters<br \/> ? If the input data is invalid, the user should be asked to enter the data again<br \/> ? File name and location (path) should be valid, as well as the file data (i.e. corrupted files,<br \/> incorrect format, etc.)<br \/> ? Option a to c can be selected on any order. Option d, can only be chosen once the user<br \/> entered all the information (a-c)<br \/> 6. Output Examples<br \/> The program should display<br \/> 1) A menu with the following options(a to e) ( 5 points )<br \/> a).- Enter the number of sensors<br \/> b).- Enter file location<br \/> c).- Time interval t0 and tf<br \/> d).- Get statistical values<br \/> e).- Exit<br \/> 2) If option d) is chosen, the program displays a table with the statistical values. For example:<br \/> Sensor<br \/> \u2014\u2014\u2014\u2014\u2014-<br \/> Min<br \/> \u2014\u2014\u2014\u2014\u2014-<br \/> Max<br \/> \u2014\u2014\u2014\u2014\u2014-<br \/> Average<br \/> \u2014\u2014\u2014\u2014\u2014-<br \/> 0 0.0954 W 0.0966 W 0.096 W<br \/> 1 0.0554 W 0.106.3 W 0.0808 W<br \/> 2 0.0689 W 0.1044 W 0.0866 W<br \/> 3 0.0781 W 0.0926 W 0.0853 W<br \/> \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2013<br \/> The total power consumption between [2301,5698] was = 1184.534 W<br \/> Sensor 0 consumed the highest amount of energy =326.112 W<br \/> CS 1325 \u2013 Project Description Fall 2014<br \/> Page 4<br \/> Sensor 1 consumed the lowest amount of energy =274.477 W<br \/> \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2013<br \/> 7. Environment<br \/> The computer program should comply with the commenting and formatting rules. For example, there<br \/> should be a header for the whole program that gives the author\u2019s name, class name, date, and<br \/> description. End braces should be commented, and alignment and indenting requirements as<br \/> discussed. Please ask if you have any questions.<br \/> 8. Test cases (10 Points)<br \/> For each USE CASE in 5, define a set of values as input data to test the correctness of your program.<br \/> 9. Other requirements (non-functional and system) (10 points)<br \/> Report:<br \/> ? Include requirements(this document)<br \/> ? Flow chart for the complete program<br \/> ? Test Cases<br \/> ? Source code (.c files) with comments<br \/> ? Assumptions clearly explained (i.e. time is always integer)<br \/> ? Comments and future work (what would you do, should you have more time?)<br \/> 10. Deliverables(Mandatory):<br \/> A zip file per team, with:<br \/> ? Report document (with examples of the input\/output data), either word file or pdf<br \/> ? C source file<br \/> ? Executable<br \/> 11. Topics covered<br \/> ? File Processing, Flow Control, Operators and Expressions, Pointers, Arrays and Functions.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Basic C Project Page 1 Project Title: \u201cEnergy Consumption Monitor\u201d CS 1325 Spring 2017 Deadline: April 23rd, 10:00 PM using e-Learning ONLY. Every student is expected to submit their own, individual\/original work, and should be able to explain and answer <a href=\"https:\/\/www.benedictsol.com\/blogs\/energy-consumption-monitor\/\" class=\"read-more\">Read More &#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-32046","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/posts\/32046","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/comments?post=32046"}],"version-history":[{"count":0,"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/posts\/32046\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/media?parent=32046"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/categories?post=32046"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/tags?post=32046"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}