Question: For this assignment you will need to complete the following exercise. A Smart Home installations contractor Smart Builders needs to put together a small smart

For this assignment you will need to complete the following exercise. A Smart Home installations contractor Smart Builders needs to put together a small smart apartment using a Controller that they build. The apartment consists of two rooms:
A Kitchen, which contains two sensors OmniTempSensorXS3 by OmniTemp Inc.
A Bedroom, which contains one OmniTempSensorXS3 by the same brand.
An SSDCS-compliant driver for OmniTempSensorXS3 can be found here (JAR) and documentation here.
The apartment also has an SSDCS-compliant A/C by a very well reputed brand called ArcticCool GmbH. The specific model used is ArcticCool FA-15 and the driver can be found here (JAR) and documentation here.
The developers of Smart Builders have developed some starter code as follows:
Room.java, which they use to model the room, as well as keep track of all the devices that are installed there.
Building.java, which is a collection of Rooms and also includes the furnace.
Controller.java, which models the controller device which collects data from sensors and sends commands to actuators via the Room, Building classes, depending on where the devices are installed.
Main.java, in which the apartment in question is built.
QuickThermostat.java, which is a stub of a temperature preference sensor for running this exercise.
You will also need a Scenario.jar plug-in, provided to you by the instructor. Here is a temporary Scenario.jar to assist you with building your solution. Your final submission should operate under a scenario provided by the instructor at a later time [more in class].
The code unfortunately is missing some key parts. Your job is to put together the java files and the libraries in e.g. an Eclipse project, complete the missing parts. You will need to submit:
The missing code.
The output of your solution.
Class Diagrams and Sequence diagrams describing your solution.
public class Room {
private String name = "default";
private ArrayList<___________> tempSensors = new ArrayList<>();
/**
* The name of the Room (e.g. Living Room)
* @return The name of the room
*/
public String getName(){
return name;
}
/**
* The name of the Room (e.g. Living Room)
* @param name The name of the room.
*/
public void setName(String name){
this.name = name;
}
//
// ROOM SETUP
//
/**
* Use this function to install a temperature sensor to the room.
* @param t Reference to an object that implements [xxx].
*/
public void install(___________ t){
tempSensors.add(t);
}
//
// OFFER ROOM INFORMATION
//
/**
* Returns the average temperature readings of the sensors installed in the room.
* @return The average temperature of the room according to the sensors installed in it.
*/
public float getAvergeTemperature(){
float count =0;
float sum =0;
for (___________ s : tempSensors){
sum += s.getReading();
count++;
}
return(float)(sum/count);
}
/**
* Returns true if an object implementing a [xxx] interface is found in the room.
* @param s Reference to an object that implements [xxx].
* @return True if the object is installed in the room. Currently checks only the collection of temperature sensors.
*/
public boolean hasThing(___________ s){
boolean found = false;
for (___________ t : tempSensors){
if (t.equals(s)) found = true;
}
// Collection of other types can be added here.
return (found);
}
}
public class Building {
private ArrayList rooms = new ArrayList();
private ___________ ac = null;
private ITemperaturePreferenceSensor thermostat = null;
/**
* Returns the temperature desired by the inhabitants of the building.
* @return The desired temperature.
*/
public int getDesiredTemperature(){
return thermostat.___________();
}
/**
* Returns a reference to the cooling device installed in the building.
* @return A reference to the cooling device installed in the building.
*/
public ___________ getCoolingDevice(){
return ac;
}
/**
* "Installs" a cooling device in the building.
* @param clr A reference to the cooling device to be installed in the building.
*/
public void setCoolingDevice(___________ clr){
this.ac = clr;
}
/**
* Returns a reference to the temperature preference sensor (thermostat) installed in the building.
* @return A reference to the temperature preference sensor (thermostat) installed in the building.
*/
public ___________ getThermostat(){
return thermostat;
}
/**
* "Installs" the temperature preference sensor (thermostat) in the building
*

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!