Examples of attachSensor()


Examples of srsim.controller.HeatingController.attachSensor()

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

Examples of srsim.controller.HeatingController.attachSensor()

    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);
    room.addController(heatingController);
    simulator.startSimulation();
  }
View Full Code Here

Examples of srsim.controller.HeatingController.attachSensor()

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

Examples of srsim.controller.HeatingController.attachSensor()

    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);
    controller.attachActuator(actuator);
    Assert.assertTrue(actuator.getState() == IActuator.IDLE);
    room.addSensor(sensor);
    room.addController(controller);
    room.addActuator(actuator);
View Full Code Here

Examples of srsim.controller.LightingController.attachSensor()

    IActuator[] lights = new IActuator[10];
    simulation.addRoom(room);
    simulation.getContext().setBrightness(5999.0D);
    room.getLocalContext().setPreference("targetBrightness",
        String.valueOf(targetBrightness));
    controller.attachSensor(sensor);
    for (int i = 0; i < 10; i++) {
      lights[i] = new LightingActuator();
      controller.attachActuator(lights[i]);
      room.addActuator(lights[i]);
    }
View Full Code Here

Examples of srsim.domain.AbstractController.attachSensor()

    IActuator[] lights = new IActuator[10];
    simulation.addRoom(room);
    simulation.getContext().setBrightness(5999.0D);
    room.getLocalContext().setPreference("targetBrightness",
        String.valueOf(targetBrightness));
    controller.attachSensor(sensor);
    for (int i = 0; i < 10; i++) {
      lights[i] = new LightingActuator();
      controller.attachActuator(lights[i]);
      room.addActuator(lights[i]);
    }
View Full Code Here

Examples of srsim.domain.IController.attachSensor()

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

Examples of srsim.domain.IController.attachSensor()

        JsonArray sensorArray = controllerDescription
            .getJsonArray("sensors");
        if (sensorArray != null) {
          for (JsonNumber sensorId : sensorArray
              .getValuesAs(JsonNumber.class)) {
            controller.attachSensor(sensorMap.get(sensorId
                .intValue()));
          }
        }
        JsonArray actuatorArray = controllerDescription
            .getJsonArray("actuators");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.