+//Create a class for relative humidity measurement
+package RelativeHumidityMeasurement
+import Timer.SimulatedTimer
+
+public class RelativeHumidityMeasurement {
+ private String id
+ private String label
+ private String displayName
+ private int humidity
+ private int currentHumidity
+
+ RelativeHumidityMeasurement(String id, String label, String displayName, int humidity) {
+ this.id = id
+ this.label = label
+ this.displayName = displayName
+ this.humidity = humidity
+ }
+
+ //By Model Checker
+ def setValue(String value) {
+ println("the humidity is changed to $value!")
+ this.humidity = value.toInteger()
+ this.currentHumidity = value.toInteger()
+ }
+
+ def currentValue(String deviceFeature) {
+ if (deviceFeature == "humidity") {
+ return humidity
+ }
+ }
+
+}