Question: Please fill in blanks * / public class Controller implements IController { / * * * Reference to a building model. * / protected Building

Please fill in blanks
*/
public class Controller implements IController {
/**
* Reference to a building model.
*/
protected Building house = new Building();
/**
* Set the building model which the Controller controls
* @param bld
*/
public void setBuildingModel(Building bld){
house = bld;
}
/**
*(See SSDCS documentation)
*/
@Override
public void changeDetected(___________ s){
this.update();
}
/**
* Function that is called by the controller every time a change has been communicated by a {@linkplain ISmartObject}, i.e., the smart object has called {@linkplain IController#changeDetected(ISmartObject)}
*/
private void update(){
// See if you need to turn on heating
if (house.getAvergeTemperature()> house.getDesiredTemperature() && !___________().isOn()){
System.out.println("Average house temperature is now: "+ house.getAvergeTemperature()+" while desired is "+ house.getDesiredTemperature()+". Turning A/C on.");
turnCoolingOn();
}
// See if you need to turn heating off
if (house.getAvergeTemperature()<= house.getDesiredTemperature() && ___________().isOn()){
System.out.println("Average house temperature is now: "+ house.getAvergeTemperature()+" while desired is "+ house.getDesiredTemperature()+". Turning A/C off.");
turnCoolingOff();
}
}
/**
* Turns cooling on.
*/
private void turnCoolingOff(){
___________;
}
/**
* Turns cooling off.
*/
private void turnCoolingOn(){
___________;
}
}
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].

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!