WattDepot Command Line Applications

In November to December 2011, I worked with Eldon Visitacion and Christopher Foo to design these two applications as the final team project of a Software Engineering I course (ICS 314) taught by Philip Johnson.

The applications used the Java-based WattDepot API, which allowed them to pull data from a server set up to collect data from the University of Hawaii at Manoa’s four Hale Aloha freshman residential towers (Lokelani, Mokihana, Lehua, and Ilima) for the Fall 2011 Kukui Cup competition. Data could be retrieved for an entire tower or for one of its five lounges (A through E).

Each project was placed under continuous integration using a Jenkins server. Distributions were built using Apache Ant and Ivy. Downloadable distributions were placed on a Google Code site. Running the unit tests requires JUnit. The project was originally designed under Java 1.6. Jar files provided were compiled on Windows and may need to be rebuilt from the source using Ant.

The progress of the project was recorded in a class blog that is no longer being maintained.

Code written for these projects was released under an Apache 2.0 license.

Phase 1: hale-aloha-cli-jcev

This project required the implementation of four data-requesting functions. Each project member designed one or more classes and their test cases, and all members tested the application’s handling of input. I designed the RankTowers, TestRankTowers, EnergySince, and TestEnergySince classes.

  • The current-power command (CurrentPower.java) retrieves the newest available power consumption data for a
    tower or lounge source on the current day.
  • The daily-energy command (DailyEnergy.java) retrieves the newest available total energy consumption recorded
    by a tower or lounge source on a given date
  • The energy-since command (EnergySince.java) retrieves the total energy consumed by a tower or lounge source on
    a given date.
  • The rank-towers command (RankTowers.java) retrieves the total energy consumed by each of the four Hale Aloha
    towers from a given start date to a given end date.

After the completion of the project, this project and its Google Code site were handed over to another project team as part of the class requirements for Phase 2.

Final version before handover (December 2011): Dropbox.

Blog entry: http://jktakayama.blogspot.com/2011/11/putting-it-all-together-software-tools.htm

Google Code site: http://code.google.com/p/hale-aloha-cli-jcev/

Phase 2: hale-aloha-cli-kmj

This project required the addition of four data-requesting functions to another team’s project; the objective was to design the new classes while following the other team’s package hierarchy and documentation specifications. The commands for the new classes were added to the existing command-line interface.


  • I designed the set-baseline command, which is implemented using the Baseline.java and SetBaseline.java classes. The set-baseline command retrieves and stores baseline energy consumption for each hour of a given day other than the current day; it defaults to yesterday if no date is given. It is tested using TestBaseline and TestSetBaseline.java.
  • The monitor-goal command (MonitorGoal.java) retrieves the current energy being consumed by the tower or lounge and determines whether or not it is meeting a user-defined energy consumption reduction goal, as measured against the data retrieved by set-baseline. It continues to retrieve data at user-defined time intervals until the Enter button is pressed. It is tested with TestMonitorGoal.java.
  • The monitor-power command (MonitorPower.java) retrieves the current power being consumed by the tower or lounge. It continues to retrieve data at user-defined time intervals until the Enter button is pressed. It is tested with TestMonitorPower.java.

Final version (December 2011): Google Code.

Blog entries:
  1. Software review of the state of the kmj project under its original project team:
  2. Reflections on the second phase of the project: