Examples of attachActuator()


Examples of srsim.controller.HeatingController.attachActuator()

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

Examples of srsim.controller.HeatingController.attachActuator()

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

Examples of srsim.controller.HeatingController.attachActuator()

  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 {
    Simulation simulation = new Simulation(new SystemTimeTimeSource());
View Full Code Here

Examples of srsim.controller.HeatingController.attachActuator()

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

Examples of srsim.controller.LightingController.attachActuator()

    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]);
    }
    room.addController(controller);
    room.addSensor(sensor);
    double brightness = room.getLocalContext().getBrightness();
View Full Code Here

Examples of srsim.domain.AbstractController.attachActuator()

    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]);
    }
    room.addController(controller);
    room.addSensor(sensor);
    double brightness = room.getLocalContext().getBrightness();
View Full Code Here

Examples of srsim.domain.IController.attachActuator()

  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 {
    Simulation simulation = new Simulation(new SystemTimeTimeSource());
View Full Code Here

Examples of srsim.domain.IController.attachActuator()

        JsonArray actuatorArray = controllerDescription
            .getJsonArray("actuators");
        if (actuatorArray != null) {
          for (JsonNumber actuatorId : actuatorArray
              .getValuesAs(JsonNumber.class)) {
            controller.attachActuator(actuatorMap.get(actuatorId
                .intValue()));
          }
        }
        room.addController(controller);
      }
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.