1. set-baseline: gathers energy consumed in hour intervals over a period of 24 hours to use as a baseline for further comparison
2. monitor-power: prints a timestamp and the current power continuously in user specified intervals
3. monitor-goal: this monitors the power and compares it to the baseline set from the first additional command. A user picks a percentage reduction which monitor-goal will use when comparing the current power to the baseline to see if the reduction is sufficient.
We were able to finish all the new commands and have them implemented, I believe as of this point, there are still a couple of bugs in the system but they are minor and can be fixed without much trouble (is what they always say right?) But overall, each command works and the system compiles. When looking at our enhancements with regards to the Three Prime Directives (you remember them from the previous post right?) it is my humble opinion that they still fulfill them. Our enhancements have an obvious benefit for the user, especially monitoring by goal. We continued to add comments and test cases for each new enhancement meaning development can be continued smoothly. Issues were created and fulfilled letting everyone know who to contact for what part of the system. The wiki pages were updated to reflect the enhancements.
One thing that I want to mention briefly is how surprisingly difficult it can be to work with someone else's code. In their design, an instance of each command is created every single time you type something in to the command prompt. Also, each command is supposed to return a boolean value determining whether or not the command ran successfully. This was fine for the previous commands, but once we had to add in set-baseline, which stored data somewhere, things had to chagne. At first I wanted to just use a normal hashtable to store the data by tower. But I realized first that under the current design, I couldn't return a hashtable or anything because it wanted a boolean. And then, because it remade each command every time, I was unable to store the hashtable in the command. In the end, I had to go a step above the commands and store the hashtable there. I wanted to just send the hashtable as a parameter to the command function, but I couldn't because then any command could access the inner content of the hashtable and mess with data. While it may be fine since I want to change the hashtable anyway, it's bad practice to allow such things and I had to change my own design. It turned out to be a simple matter of making an encapsulating class for hashtable and then passing it, along with some get/put methods in to work with the hashtable without actually having it.
While this seems like a simple problem at first, because I was working with someone else's code I was not immediately aware of the specifics of the system. Therefore, it took me a while to figure out what was wrong and why. Of course once I did, it seemed very obvious, but it still took longer than it would have had I been working with my own design the entire time. But learning to do these kinds of things I feel is very important because as systems get bigger and bigger, it becomes impractical for a single person to work on everything. So it's good practice for me to be working with someone else's system and learning to think like they do.