Package srsim.sensors

Examples of srsim.sensors.TemperatureSensor


    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);
View Full Code Here


  @Test
  public void testAddingSensors() throws SimulationContextException {
    Room room = new Room();
    room.setContext(new SimulationContext(new SystemTimeTimeSource()));
    TemperatureSensor sensor = new TemperatureSensor();
    room.addSensor(sensor);
    List<ISensor> sensors = room.getSensors();
    Assert.assertSame(sensor, sensors.get(0));
  }
View Full Code Here

  public void testSetupAndRunSimulation() {
    SmartRoomSimulator simulator = new SmartRoomSimulator();
    Room room = new Room();
    simulator.addRoom(room);
    HeatingActuator heatingActuator = new HeatingActuator();
    TemperatureSensor temperatureSensor = new TemperatureSensor();
    HeatingController heatingController = new HeatingController();
    heatingController.attachActuator(heatingActuator);
    heatingController.attachSensor(temperatureSensor);
    room.addActuator(heatingActuator);
    room.addSensor(temperatureSensor);
View Full Code Here

public class ControllerTest {

  @Test
  public void testAttachingSensors() throws SimulationConfigurationException {
    IController controller = new HeatingController();
    ISensor sensor = new TemperatureSensor();
    IActuator actuator = new HeatingActuator();
    controller.attachSensor(sensor);
    controller.attachActuator(actuator);
  }
View Full Code Here

  @Test
  public void testInitiatingActuatorChangeFromSensorUpdate() throws SimulationContextException {
    Simulation simulation = new Simulation(new SystemTimeTimeSource());
    Room room = new Room();
    HeatingController controller = new HeatingController();
    ISensor sensor = new TemperatureSensor();
    IActuator actuator = new HeatingActuator();
    room.setContext(simulation.getContext());
    simulation.getContext().setTemperature(0.0D);
    simulation.getContext().setPreference("targetTemperature","21.5D");
    controller.attachSensor(sensor);
View Full Code Here

TOP

Related Classes of srsim.sensors.TemperatureSensor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.