throws SimulationContextException, InterruptedException {
double targetTemperature = 21.5D;
Simulation simulation = new Simulation(new SystemTimeTimeSource());
simulation.setResolution(0);
Room room = new Room();
HeatingController controller = new HeatingController();
ISensor sensor = new TemperatureSensor();
IActuator actuator = new HeatingActuator();
simulation.addRoom(room);
room.getLocalContext().setTemperature(20.0D);
room.getLocalContext().setPreference("targetTemperature", "21.5D");
controller.attachSensor(sensor);
controller.attachActuator(actuator);
room.addActuator(actuator);
room.addController(controller);
room.addSensor(sensor);
double temperature = room.getLocalContext().getTemperature();
double previousTemperature = temperature;