Search space optimization
[smartthings-infrastructure.git] / ThreeAxis / ThreeAxises.groovy
index 6dd02b20cfc584e56d6d061a2121573c8aa517d2..7077514c973e425a67b6f96433372d1deaae8c42 100644 (file)
@@ -2,9 +2,6 @@
 package ThreeAxis
 import Timer.SimulatedTimer
 
-//JPF's Verify API
-import gov.nasa.jpf.vm.Verify
-
 public class ThreeAxises {
        private int deviceNumbers
        private List threeAxises
@@ -17,11 +14,16 @@ public class ThreeAxises {
        private LinkedHashMap threeAxis = [x:0, y:0, z:0]
        
                
-       ThreeAxises(Closure sendEvent, int deviceNumbers) {
+       ThreeAxises(Closure sendEvent, int deviceNumbers, boolean init) {
                this.sendEvent = sendEvent              
                this.deviceNumbers = deviceNumbers
                this.threeAxises = []
-
+               
+               if (init) {
+                       this.threeAxis = [x:0, y:0, z:0]
+               } else {
+                       this.threeAxis = [x:1, y:2, z:3]
+               }
                threeAxises.add(new ThreeAxis(id, label, displayName, threeAxis))
        }
 
@@ -50,7 +52,10 @@ public class ThreeAxises {
        def collect(Closure Input) {
                threeAxises.collect(Input)
        }
-
+       
+       def currentState(String deviceFeature) {
+               threeAxises[0].currentValue(deviceFeature)
+       }
 
        def currentValue(String deviceFeature) {
                threeAxises[0].currentValue(deviceFeature)