RoomStatus.java 955 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package de.tu_darmstadt.tk.SmartHomeNetworkSim.core;
  2. import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.scheduler.Schedulable;
  3. /**
  4. * Class for storing attributes of a room, and sharing it between different devices
  5. *
  6. */
  7. public class RoomStatus implements Schedulable {
  8. /**
  9. * True if light is on
  10. */
  11. private boolean lightOn = false;
  12. /**
  13. * Average temperature of the room
  14. */
  15. private float temperature = 19;
  16. @Override
  17. public long getEventTime() {
  18. return Long.MAX_VALUE;
  19. }
  20. @Override
  21. public void simulateEvent(long time) {
  22. // TODO: Maybe simulation? e.g. sharing temperature with other rooms, outside etc.
  23. }
  24. public boolean isLightOn() {
  25. return lightOn;
  26. }
  27. public void setLightOn(boolean lightOn) {
  28. this.lightOn = lightOn;
  29. }
  30. public float getTemperature() {
  31. return temperature;
  32. }
  33. public void setTemperature(float temperature) {
  34. this.temperature = temperature;
  35. }
  36. }