Creating new directory for all Java benchmarks
authorrtrimana <rtrimana@uci.edu>
Tue, 10 Jan 2017 23:12:51 +0000 (15:12 -0800)
committerrtrimana <rtrimana@uci.edu>
Tue, 10 Jan 2017 23:12:51 +0000 (15:12 -0800)
128 files changed:
benchmarks/HomeSecurityController/AlarmSmart_Stub.java [deleted file]
benchmarks/HomeSecurityController/CameraCallback_CallbackSkeleton.java [deleted file]
benchmarks/HomeSecurityController/CameraSmart_Stub.java [deleted file]
benchmarks/HomeSecurityController/HomeSecurityController.config [deleted file]
benchmarks/HomeSecurityController/HomeSecurityController.java [deleted file]
benchmarks/HomeSecurityController/Makefile [deleted file]
benchmarks/HomeSecurityController/MotionDetection.java [deleted file]
benchmarks/HomeSecurityController/MotionDetectionCallback.java [deleted file]
benchmarks/HomeSecurityController/RoomSmart_Stub.java [deleted file]
benchmarks/HomeSecurityController/SmartthingsSensorCallback_CallbackSkeleton.java [deleted file]
benchmarks/HomeSecurityController/SmartthingsSensorSmart_Stub.java [deleted file]
benchmarks/IrrigationController/CameraCallback_CallbackSkeleton.java [deleted file]
benchmarks/IrrigationController/CameraSmart_Stub.java [deleted file]
benchmarks/IrrigationController/DayWeather.java [deleted file]
benchmarks/IrrigationController/IrrigationController.config [deleted file]
benchmarks/IrrigationController/IrrigationController.java [deleted file]
benchmarks/IrrigationController/LawnSmart_Stub.java [deleted file]
benchmarks/IrrigationController/LawnState.java [deleted file]
benchmarks/IrrigationController/MANIFEST.MF [deleted file]
benchmarks/IrrigationController/Makefile [deleted file]
benchmarks/IrrigationController/MoistureSensorCallback_CallbackSkeleton.java [deleted file]
benchmarks/IrrigationController/MoistureSensorSmart_Stub.java [deleted file]
benchmarks/IrrigationController/MotionDetection.java [deleted file]
benchmarks/IrrigationController/MotionDetectionCallback.java [deleted file]
benchmarks/IrrigationController/SprinklerSmart_Stub.java [deleted file]
benchmarks/IrrigationController/Tuple.java [deleted file]
benchmarks/IrrigationController/WeatherGatewayCallback_CallbackSkeleton.java [deleted file]
benchmarks/IrrigationController/WeatherGatewaySmart_Stub.java [deleted file]
benchmarks/IrrigationController/WeatherGrabber.java [deleted file]
benchmarks/IrrigationController/help_files/city_list_us.json [deleted file]
benchmarks/IrrigationController/help_files/html_files/error.html [deleted file]
benchmarks/IrrigationController/help_files/html_files/state0.html [deleted file]
benchmarks/IrrigationController/help_files/html_files/state1A.html [deleted file]
benchmarks/IrrigationController/help_files/html_files/state1B.html [deleted file]
benchmarks/IrrigationController/help_files/html_files/state2.html [deleted file]
benchmarks/IrrigationController/help_files/html_files/state4.html [deleted file]
benchmarks/IrrigationController/help_files/html_files/state5.html [deleted file]
benchmarks/IrrigationController/resources/area_codes.csv [deleted file]
benchmarks/IrrigationController/resources/zipcode.csv [deleted file]
benchmarks/Java/HomeSecurityController/AlarmSmart_Stub.java [new file with mode: 0644]
benchmarks/Java/HomeSecurityController/CameraCallback_CallbackSkeleton.java [new file with mode: 0644]
benchmarks/Java/HomeSecurityController/CameraSmart_Stub.java [new file with mode: 0644]
benchmarks/Java/HomeSecurityController/HomeSecurityController.config [new file with mode: 0644]
benchmarks/Java/HomeSecurityController/HomeSecurityController.java [new file with mode: 0644]
benchmarks/Java/HomeSecurityController/Makefile [new file with mode: 0644]
benchmarks/Java/HomeSecurityController/MotionDetection.java [new file with mode: 0644]
benchmarks/Java/HomeSecurityController/MotionDetectionCallback.java [new file with mode: 0644]
benchmarks/Java/HomeSecurityController/RoomSmart_Stub.java [new file with mode: 0644]
benchmarks/Java/HomeSecurityController/SmartthingsSensorCallback_CallbackSkeleton.java [new file with mode: 0644]
benchmarks/Java/HomeSecurityController/SmartthingsSensorSmart_Stub.java [new file with mode: 0644]
benchmarks/Java/IrrigationController/CameraCallback_CallbackSkeleton.java [new file with mode: 0644]
benchmarks/Java/IrrigationController/CameraSmart_Stub.java [new file with mode: 0644]
benchmarks/Java/IrrigationController/DayWeather.java [new file with mode: 0644]
benchmarks/Java/IrrigationController/IrrigationController.config [new file with mode: 0644]
benchmarks/Java/IrrigationController/IrrigationController.java [new file with mode: 0644]
benchmarks/Java/IrrigationController/LawnSmart_Stub.java [new file with mode: 0644]
benchmarks/Java/IrrigationController/LawnState.java [new file with mode: 0644]
benchmarks/Java/IrrigationController/MANIFEST.MF [new file with mode: 0644]
benchmarks/Java/IrrigationController/Makefile [new file with mode: 0644]
benchmarks/Java/IrrigationController/MoistureSensorCallback_CallbackSkeleton.java [new file with mode: 0644]
benchmarks/Java/IrrigationController/MoistureSensorSmart_Stub.java [new file with mode: 0644]
benchmarks/Java/IrrigationController/MotionDetection.java [new file with mode: 0644]
benchmarks/Java/IrrigationController/MotionDetectionCallback.java [new file with mode: 0644]
benchmarks/Java/IrrigationController/SprinklerSmart_Stub.java [new file with mode: 0644]
benchmarks/Java/IrrigationController/Tuple.java [new file with mode: 0644]
benchmarks/Java/IrrigationController/WeatherGatewayCallback_CallbackSkeleton.java [new file with mode: 0644]
benchmarks/Java/IrrigationController/WeatherGatewaySmart_Stub.java [new file with mode: 0644]
benchmarks/Java/IrrigationController/WeatherGrabber.java [new file with mode: 0644]
benchmarks/Java/IrrigationController/help_files/city_list_us.json [new file with mode: 0644]
benchmarks/Java/IrrigationController/help_files/html_files/error.html [new file with mode: 0644]
benchmarks/Java/IrrigationController/help_files/html_files/state0.html [new file with mode: 0644]
benchmarks/Java/IrrigationController/help_files/html_files/state1A.html [new file with mode: 0644]
benchmarks/Java/IrrigationController/help_files/html_files/state1B.html [new file with mode: 0644]
benchmarks/Java/IrrigationController/help_files/html_files/state2.html [new file with mode: 0644]
benchmarks/Java/IrrigationController/help_files/html_files/state4.html [new file with mode: 0644]
benchmarks/Java/IrrigationController/help_files/html_files/state5.html [new file with mode: 0644]
benchmarks/Java/IrrigationController/resources/area_codes.csv [new file with mode: 0644]
benchmarks/Java/IrrigationController/resources/zipcode.csv [new file with mode: 0644]
benchmarks/Java/Lifxtest/Lifxtest.config [new file with mode: 0644]
benchmarks/Java/Lifxtest/Lifxtest.java [new file with mode: 0644]
benchmarks/Java/Lifxtest/LightBulbTest_Stub.java [new file with mode: 0644]
benchmarks/Java/Lifxtest/Makefile [new file with mode: 0755]
benchmarks/Java/SmartLightsController/CameraCallback_CallbackSkeleton.java [new file with mode: 0644]
benchmarks/Java/SmartLightsController/CameraSmart_Stub.java [new file with mode: 0644]
benchmarks/Java/SmartLightsController/ColorTemperature.java [new file with mode: 0644]
benchmarks/Java/SmartLightsController/LightBulbSmart_Stub.java [new file with mode: 0644]
benchmarks/Java/SmartLightsController/Makefile [new file with mode: 0644]
benchmarks/Java/SmartLightsController/Makefile~ [new file with mode: 0644]
benchmarks/Java/SmartLightsController/MotionDetection.java [new file with mode: 0644]
benchmarks/Java/SmartLightsController/MotionDetectionCallback.java [new file with mode: 0644]
benchmarks/Java/SmartLightsController/RoomSmart_Stub.java [new file with mode: 0644]
benchmarks/Java/SmartLightsController/SmartLightsController.config [new file with mode: 0644]
benchmarks/Java/SmartLightsController/SmartLightsController.java [new file with mode: 0644]
benchmarks/Java/SpeakerController/GPSGatewayCallback_CallbackSkeleton.java [new file with mode: 0644]
benchmarks/Java/SpeakerController/GPSGatewaySmart_Stub.java [new file with mode: 0644]
benchmarks/Java/SpeakerController/MP3Decoder.java [new file with mode: 0644]
benchmarks/Java/SpeakerController/Makefile [new file with mode: 0644]
benchmarks/Java/SpeakerController/RoomSmart_Stub.java [new file with mode: 0644]
benchmarks/Java/SpeakerController/SpeakerCallback_CallbackSkeleton.java [new file with mode: 0644]
benchmarks/Java/SpeakerController/SpeakerController.config [new file with mode: 0644]
benchmarks/Java/SpeakerController/SpeakerController.java [new file with mode: 0644]
benchmarks/Java/SpeakerController/SpeakerSmart_Stub.java [new file with mode: 0644]
benchmarks/Java/SpeakerController/music/cool.mp3 [new file with mode: 0644]
benchmarks/Lifxtest/Lifxtest.config [deleted file]
benchmarks/Lifxtest/Lifxtest.java [deleted file]
benchmarks/Lifxtest/LightBulbTest_Stub.java [deleted file]
benchmarks/Lifxtest/Makefile [deleted file]
benchmarks/Makefile
benchmarks/SmartLightsController/CameraCallback_CallbackSkeleton.java [deleted file]
benchmarks/SmartLightsController/CameraSmart_Stub.java [deleted file]
benchmarks/SmartLightsController/ColorTemperature.java [deleted file]
benchmarks/SmartLightsController/LightBulbSmart_Stub.java [deleted file]
benchmarks/SmartLightsController/Makefile [deleted file]
benchmarks/SmartLightsController/MotionDetection.java [deleted file]
benchmarks/SmartLightsController/MotionDetectionCallback.java [deleted file]
benchmarks/SmartLightsController/RoomSmart_Stub.java [deleted file]
benchmarks/SmartLightsController/SmartLightsController.config [deleted file]
benchmarks/SmartLightsController/SmartLightsController.java [deleted file]
benchmarks/SpeakerController/GPSGatewayCallback_CallbackSkeleton.java [deleted file]
benchmarks/SpeakerController/GPSGatewaySmart_Stub.java [deleted file]
benchmarks/SpeakerController/MP3Decoder.java [deleted file]
benchmarks/SpeakerController/Makefile [deleted file]
benchmarks/SpeakerController/RoomSmart_Stub.java [deleted file]
benchmarks/SpeakerController/SpeakerCallback_CallbackSkeleton.java [deleted file]
benchmarks/SpeakerController/SpeakerController.config [deleted file]
benchmarks/SpeakerController/SpeakerController.java [deleted file]
benchmarks/SpeakerController/SpeakerSmart_Stub.java [deleted file]
benchmarks/SpeakerController/music/cool.mp3 [deleted file]

diff --git a/benchmarks/HomeSecurityController/AlarmSmart_Stub.java b/benchmarks/HomeSecurityController/AlarmSmart_Stub.java
deleted file mode 100644 (file)
index 3dc3500..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-package HomeSecurityController;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Arrays;
-import iotrmi.Java.IoTRMICall;
-import iotrmi.Java.IoTRMIObject;
-
-import iotcode.interfaces.*;
-
-public class AlarmSmart_Stub implements AlarmSmart {
-
-       private IoTRMICall rmiCall;
-       private String callbackAddress;
-       private int[] ports;
-
-       private final static int objectId = 0;
-       
-
-       public AlarmSmart_Stub(int _port, String _skeletonAddress, String _callbackAddress, int _rev, int[] _ports) throws Exception {
-               callbackAddress = _callbackAddress;
-               ports = _ports;
-               rmiCall = new IoTRMICall(_port, _skeletonAddress, _rev);
-       }
-
-       public boolean doesHaveZoneTimers() {
-               int methodId = 4;
-               Class<?> retType = boolean.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               return (boolean)retObj;
-       }
-
-       public List<ZoneState> getZoneStates() {
-               int methodId = 2;
-               Class<?> retType = int.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               Object retLenObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               int retLen = (int) retLenObj;
-               Class<?>[] retCls = new Class<?>[3*retLen];
-               Class<?>[] retClsVal = new Class<?>[3*retLen];
-               int retPos = 0;
-               for(int i = 0; i < retLen; i++) {
-                       retCls[retPos] = int.class;
-                       retClsVal[retPos++] = null;
-                       retCls[retPos] = boolean.class;
-                       retClsVal[retPos++] = null;
-                       retCls[retPos] = int.class;
-                       retClsVal[retPos++] = null;
-               }
-               Object[] retObj = rmiCall.getStructObjects(retCls, retClsVal);
-               List<ZoneState> structRet = new ArrayList<ZoneState>();
-               int retObjPos = 0;
-               for(int i = 0; i < retLen; i++) {
-                       ZoneState structRetMem = new ZoneState();
-                       structRetMem.zoneNumber = (int) retObj[retObjPos++];
-                       structRetMem.onOffState = (boolean) retObj[retObjPos++];
-                       structRetMem.duration = (int) retObj[retObjPos++];
-                       structRet.add(structRetMem);
-               }
-               return structRet;
-       }
-
-       public void init() {
-               int methodId = 0;
-               Class<?> retType = void.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-       }
-
-       public void setZone(int _zone, boolean _onOff, int _onDurationSeconds) {
-               int methodId = 1;
-               Class<?> retType = void.class;
-               Class<?>[] paramCls = new Class<?>[] { int.class, boolean.class, int.class };
-               Object[] paramObj = new Object[] { _zone, _onOff, _onDurationSeconds };
-               rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-       }
-
-       public int getNumberOfZones() {
-               int methodId = 3;
-               Class<?> retType = int.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               return (int)retObj;
-       }
-
-}
diff --git a/benchmarks/HomeSecurityController/CameraCallback_CallbackSkeleton.java b/benchmarks/HomeSecurityController/CameraCallback_CallbackSkeleton.java
deleted file mode 100644 (file)
index a980927..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-package HomeSecurityController;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Arrays;
-import iotrmi.Java.IoTRMICall;
-import iotrmi.Java.IoTRMIObject;
-
-import iotcode.interfaces.*;
-
-public class CameraCallback_CallbackSkeleton implements CameraCallback {
-
-       private CameraCallback mainObj;
-       private int objectId = 0;
-       private String callbackAddress;
-       
-
-       public CameraCallback_CallbackSkeleton(CameraCallback _mainObj, String _callbackAddress, int _objectId) throws Exception {
-               callbackAddress = _callbackAddress;
-               mainObj = _mainObj;
-               objectId = _objectId;
-       }
-
-       public void newCameraFrameAvailable(byte latestFrame[], long timeStamp) {
-               mainObj.newCameraFrameAvailable(latestFrame, timeStamp);
-       }
-
-       public void ___newCameraFrameAvailable(IoTRMIObject rmiObj) {
-               Object[] paramObj = rmiObj.getMethodParams(new Class<?>[] { byte[].class, long.class }, 
-               new Class<?>[] { null, null });
-               newCameraFrameAvailable((byte[]) paramObj[0], (long) paramObj[1]);
-       }
-
-       public void invokeMethod(IoTRMIObject rmiObj) throws IOException {
-               int methodId = rmiObj.getMethodId();
-               switch (methodId) {
-                       case 0: ___newCameraFrameAvailable(rmiObj); break;
-                       default: 
-                       throw new Error("Method Id " + methodId + " not recognized!");
-               }
-       }
-
-}
diff --git a/benchmarks/HomeSecurityController/CameraSmart_Stub.java b/benchmarks/HomeSecurityController/CameraSmart_Stub.java
deleted file mode 100644 (file)
index d58dfba..0000000
+++ /dev/null
@@ -1,184 +0,0 @@
-package HomeSecurityController;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Arrays;
-import iotrmi.Java.IoTRMICall;
-import iotrmi.Java.IoTRMIObject;
-
-import iotcode.interfaces.*;
-
-public class CameraSmart_Stub implements CameraSmart {
-
-       private IoTRMICall rmiCall;
-       private String callbackAddress;
-       private int[] ports;
-
-       private final static int objectId = 0;
-       // Callback properties
-       private IoTRMIObject rmiObj;
-       List<CameraCallback> listCallbackObj;
-       private static int objIdCnt = 0;
-       private final static int object0Id = 0; //CameraSmartCallback
-       private static Integer[] object0Permission = { 0 };
-       private static List<Integer> set0Allowed;
-       
-
-       public CameraSmart_Stub(int _port, String _skeletonAddress, String _callbackAddress, int _rev, int[] _ports) throws Exception {
-               callbackAddress = _callbackAddress;
-               ports = _ports;
-               rmiCall = new IoTRMICall(_port, _skeletonAddress, _rev);
-               set0Allowed = new ArrayList<Integer>(Arrays.asList(object0Permission));
-               listCallbackObj = new ArrayList<CameraCallback>();
-               set0Allowed.add(-9999);
-               ___initCallBack();
-       }
-
-       public int getMaxFPS() {
-               int methodId = 8;
-               Class<?> retType = int.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               return (int)retObj;
-       }
-
-       public boolean setFPS(int _fps) {
-               int methodId = 7;
-               Class<?> retType = boolean.class;
-               Class<?>[] paramCls = new Class<?>[] { int.class };
-               Object[] paramObj = new Object[] { _fps };
-               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               return (boolean)retObj;
-       }
-
-       public int getMinFPS() {
-               int methodId = 9;
-               Class<?> retType = int.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               return (int)retObj;
-       }
-
-       public boolean setResolution(Resolution _res) {
-               int methodId = 6;
-               Class<?> retType = boolean.class;
-               int paramEnum0[] = new int[1];
-               paramEnum0[0] = _res.ordinal();
-               Class<?>[] paramCls = new Class<?>[] { int[].class };
-               Object[] paramObj = new Object[] { paramEnum0 };
-               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               return (boolean)retObj;
-       }
-
-       public void stop() {
-               int methodId = 2;
-               Class<?> retType = void.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-       }
-
-       public void start() {
-               int methodId = 1;
-               Class<?> retType = void.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-       }
-
-       public long getTimestamp() {
-               int methodId = 4;
-               Class<?> retType = long.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               return (long)retObj;
-       }
-
-       public byte[] getLatestFrame() {
-               int methodId = 3;
-               Class<?> retType = byte[].class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               return (byte[])retObj;
-       }
-
-       public void init() {
-               int methodId = 0;
-               Class<?> retType = void.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-       }
-
-       public void registerCallback(CameraCallback _callbackTo) {
-               try {
-                       CameraCallback_CallbackSkeleton skel0 = new CameraCallback_CallbackSkeleton(_callbackTo, callbackAddress, objIdCnt++);
-                       listCallbackObj.add(skel0);
-               } catch (Exception ex) {
-                       ex.printStackTrace();
-                       throw new Error("Exception when generating skeleton objects!");
-               }
-
-               int methodId = 10;
-               Class<?> retType = void.class;
-               Class<?>[] paramCls = new Class<?>[] { int.class };
-               Object[] paramObj = new Object[] { new Integer(1) };
-               rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-       }
-
-       public void ___initCallBack() {
-               Thread thread = new Thread() {
-                       public void run() {
-                               try {
-                                       rmiObj = new IoTRMIObject(ports[0]);
-                                       while (true) {
-                                               byte[] method = rmiObj.getMethodBytes();
-                                               int objId = IoTRMIObject.getObjectId(method);
-                                               CameraCallback_CallbackSkeleton skel = (CameraCallback_CallbackSkeleton) listCallbackObj.get(objId);
-                                               if (skel != null) {
-                                                       int methodId = IoTRMIObject.getMethodId(method);
-                                                       if (!set0Allowed.contains(methodId)) {
-                                                               throw new Error("Callback object for CameraCallback is not allowed to access method: " + methodId);
-                                                       }
-                                                       skel.invokeMethod(rmiObj);
-                                               } else {
-                                                       throw new Error("CameraCallback: Object with Id " + objId + " not found!");
-                                               }
-                                       }
-                               } catch (Exception ex) {
-                                       ex.printStackTrace();
-                                       throw new Error("Error instantiating class CameraCallback_CallbackSkeleton!");
-                               }
-                       }
-               };
-               thread.start();
-
-               int methodId = -9998;
-               Class<?> retType = void.class;
-               Class<?>[] paramCls = new Class<?>[] { int[].class, String.class, int.class };
-               Object[] paramObj = new Object[] { ports, callbackAddress, 0 };
-               rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-       }
-
-       public List<Resolution> getSupportedResolutions() {
-               int methodId = 5;
-               Class<?> retType = int[].class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               int[] retEnum = (int[]) retObj;
-               Resolution[] enumVals = Resolution.values();
-               int retLen = retEnum.length;
-               List<Resolution> enumRetVal = new ArrayList<Resolution>();
-               for (int i = 0; i < retLen; i++) {
-                       enumRetVal.add(enumVals[retEnum[i]]);
-               }
-               return enumRetVal;
-       }
-
-}
diff --git a/benchmarks/HomeSecurityController/HomeSecurityController.config b/benchmarks/HomeSecurityController/HomeSecurityController.config
deleted file mode 100644 (file)
index 5a44766..0000000
+++ /dev/null
@@ -1 +0,0 @@
-ADDITIONAL_ZIP_FILE=No
diff --git a/benchmarks/HomeSecurityController/HomeSecurityController.java b/benchmarks/HomeSecurityController/HomeSecurityController.java
deleted file mode 100644 (file)
index 8647f2e..0000000
+++ /dev/null
@@ -1,580 +0,0 @@
-package HomeSecurityController;
-
-// Standard Java Packages
-import java.util.Date;
-import java.util.Iterator;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import java.util.HashSet;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.ConcurrentHashMap;
-
-// RMI packages
-import java.rmi.RemoteException;
-import java.rmi.server.UnicastRemoteObject;
-
-// IoT Runtime Packages
-import iotruntime.slave.IoTSet;
-import iotruntime.slave.IoTRelation;
-import iotcode.annotation.*;
-
-// IoT Driver Packages
-import iotcode.interfaces.*;
-
-// Checker annotations
-//import iotchecker.qual.*;
-
-/** Class Home Security Controller for the home security application benchmark
- *
- * @author      Rahmadi Trimananda <rtrimana @ uci.edu>
- * @version     1.0
- * @since       2016-12-14
- */
-public class HomeSecurityController implements SmartthingsSensorCallback {
-
-       /*
-        *  Constants
-        */
-       private static final int MOTION_TIME_THRESHOLD = 60;    // in seconds
-       private static final int CAMERA_FPS = 15;
-       private static final int CHECK_TIME_WAIT = 1;                   // in seconds
-       private static final int SECOND_TO_TURN_ON = 60;                // in seconds
-       private static final int SECOND_TO_TURN_OFF = 1;                // in seconds
-
-       /**
-        *  IoT Sets and Relations
-        *  <p>
-        *  Devices involved:
-        *  1) Multipurpose sensor (detect windows open/close) - Smartthings sensor
-        *  2) Motion sensor (detect motion in certain radius) - Smartthings sensor
-        *  3) Water leak sensor (detect leakage) - Smartthings sensor
-        *  4) Camera (detect motion)
-        *  5) Alarm (using ESP board) - assuming 1 house alarm
-        *  6) Room (object as place of device)
-        *
-        *  Additionals (for more extensive home management)
-        *  7) Doorlock (detect open/locked)
-        *  8) Power outlet (detect on/off, monitor watt)
-        */
-       // This comprises multipurpose, motion, and water leak sensors
-       // TODO: Per 01/2017, doorlock and outlet are not ready, ESP board will be used for alarm
-       @config private IoTSet<SmartthingsSensorSmart> smartSensorsSet;
-       @config private IoTSet<CameraSmart> camSet;
-       @config private IoTSet<AlarmSmart> alarmSet;
-       @config private IoTSet<RoomSmart> roomSet;
-       //@config private IoTSet<DoorLock> doorlockSet;
-       //@config private IoTSet<Outlet> outletSet;
-
-       @config private IoTRelation<RoomSmart, SmartthingsSensorSmart> roomSensorRelation;
-       @config private IoTRelation<RoomSmart, CameraSmart> roomCameraRelation;
-       //@config private IoTRelation<RoomSmart, DoorLock> roomDoorLockRelation;
-       //@config private IoTRelation<RoomSmart, Outlet> roomOutletRelation;
-
-       /*******************************************************************************************************************************************
-       **
-       **  Variables
-       **
-       *******************************************************************************************************************************************/
-       long lastTimeChecked = 0;
-
-       private static int sensorId = 0;
-
-       /*******************************************************************************************************************************************
-       **
-       **  States data structures
-       **
-       *******************************************************************************************************************************************/
-       // Camera and motion detection
-       private Map<CameraSmart, MotionDetection> camMotionDetect =
-               new HashMap<CameraSmart, MotionDetection>();
-       // Smartthings sensors (true = motion, leakage, etc.)
-       private Map<Integer, Boolean> senDetectStatus =
-               new ConcurrentHashMap<Integer, Boolean>();
-       // Camera (true = motion)
-       private Map<CameraSmart, Boolean> camDetectStatus =
-               new HashMap<CameraSmart, Boolean>();
-       // Doorlock (true = open - not locked)
-       //private Map<DoorLock, Boolean> doorlockStatus =
-       //      new HashMap<DoorLock, Boolean>();
-       // Outlet (true = on - outlet is used)
-       //private Map<Outlet, Boolean> outletStatus =
-       //      new HashMap<Outlet, Boolean>();
-
-       // Alarm status
-       private Map<Integer, Boolean> alarmStatus =
-               new HashMap<Integer, Boolean>();
-
-       public HomeSecurityController() {
-
-       }
-
-
-       /*******************************************************************************************************************************************
-       **
-       **  Helper Methods
-       **
-       *******************************************************************************************************************************************/
-
-
-       /** Method to initialize Smartthings sensors
-        *
-        *   @return [void] None.
-        */
-       private void initSmartthingsSensors(RoomSmart rm) {
-
-               // Get and init the IAS sensors for this specific room
-               HashSet<SmartthingsSensorSmart> sensors = roomSensorRelation.get(rm);
-               for (SmartthingsSensorSmart sen : sensors) {
-       
-                       try {
-                               // Initialize sensors
-                               sen.init();
-                               System.out.println("DEBUG: Initialized smartthings sensor! ID: " + sensorId + " Room ID: " + rm.getRoomID());
-                               senDetectStatus.put(sensorId, false);
-                               System.out.println("DEBUG: Initialized sensor detection to false!");
-                               sen.setId(sensorId++);
-                               sen.registerCallback(this);
-                               System.out.println("DEBUG: Registered sensor callback!");
-                       } catch (Exception e) {
-                               e.printStackTrace();
-                       }
-               }
-       }
-
-
-       /** Method to initialize cameras
-        *
-        *   @return [void] None.
-        */
-       private void initCameras(RoomSmart rm) {
-
-               // Get and init the IAS sensors for this specific room
-               HashSet<CameraSmart> cameras = roomCameraRelation.get(rm);
-               // Setup the cameras, start them all and assign each one a motion detector
-               for (CameraSmart cam : cameras) {
-
-                       // Each camera will have a motion detector unique to it since the motion detection has state
-                       MotionDetection mo = new MotionDetection(12, 0.5f, 10, 10);
-
-                       // initialize the camera, might need to setup some stuff internally
-                       cam.init();
-
-                       // set the camera parameters.
-                       cam.setFPS(CAMERA_FPS);
-                       cam.setResolution(Resolution.RES_VGA);
-
-                       // camera will call the motion detector directly with data not this controller
-                       cam.registerCallback(mo);
-
-                       // Start the camera (example is start the HTTP stream if it is a network camera)
-                       cam.start();
-                       System.out.println("DEBUG: Initialized camera!");
-
-                       // Remember which motion detector is for what camera
-                       camMotionDetect.put(cam, mo);
-
-                       // Initialize detection to false
-                       camDetectStatus.put(cam, false);
-               }
-       }
-
-
-       /** Method to initialize alarms
-        *
-        *   @return [void] None.
-        */
-       private void initAlarms() {
-
-               // Get and init the alarm (this single alarm set can serve multiple zones / rooms)
-               Iterator alarmIt = alarmSet.iterator();
-               AlarmSmart alm = (AlarmSmart) alarmIt.next();
-               // init the alarm controller, do it here since it only needs to be done once per controller
-               try {
-                       alm.init();
-                       System.out.println("DEBUG: Initialized alarm!");
-                       // TODO: Check that this initialization works for multiple times - might be that setZone() only works once!
-                       //for (RoomSmart room : roomSet.values()) {
-                       //      turnOffAlarms(room.getRoomID());
-                       //      System.out.println("DEBUG: Initialized alarm for room (turn off): " + room.getRoomID());
-                       //}
-               } catch (Exception e) {
-                       e.printStackTrace();
-               }
-       }
-
-
-       /** Method to initialize doorlocks
-        *
-        *   @return [void] None.
-        */
-       private void initDoorLocks(RoomSmart rm) {
-
-               // Get and init the doorlocks for this specific room
-               /*HashSet<DoorLock> doorlocks = roomDoorLockRelation.get(rm);
-               for (DoorLock doorlock : doorlocks) {
-       
-                       try {
-                               // Initialize doorlocks
-                               doorlock.init();
-                               System.out.println("DEBUG: Initialized doorlock!");
-                       } catch (Exception e) {
-                               e.printStackTrace();
-                       }
-               }*/
-       }
-
-
-       /** Method to initialize power outlets
-        *
-        *   @return [void] None.
-        */
-       private void initOutlets(RoomSmart rm) {
-
-               // Get and init the outlets for this specific room
-               /*HashSet<Outlet> outlets = roomOutletRelation.get(rm);
-               for (Outlet outlet : outlets) {
-       
-                       try {
-                               // Initialize outlets
-                               outlet.init();
-                               System.out.println("DEBUG: Initialized outlet!");
-                       } catch (Exception e) {
-                               e.printStackTrace();
-                       }
-               }*/
-       }
-
-
-       /** Method to detect if a room has seen motion within the last few seconds (time specified as parameter).
-        *   Checks all the motion detectors for the given room
-        *
-        *   @param _room            [RoomSmart] , Room of interest.
-        *   @param _numberOfSeconds [int]  , Number of seconds in the past that we consider recent.
-        *   @param _upperThreshold  [int]  , Number of seconds as an upper bound before we turn off.
-        *
-        *   @return [boolean] None.
-        */
-       private boolean roomDidHaveMotionRecently(RoomSmart _room, int _numberOfSeconds) {
-               long currentTimeSeconds = (new Date()).getTime() / 1000;
-
-               // Loop through all the cameras in the room
-               for (CameraSmart cam : roomCameraRelation.get(_room)) {
-                       long lastDetectedMotionSeconds = currentTimeSeconds;
-
-                       Date motionTime = ((MotionDetection)camMotionDetect.get(cam)).getTimestampOfLastMotion();
-
-                       // Motion was detected at least once
-                       if (motionTime != null) {
-                               lastDetectedMotionSeconds = motionTime.getTime() / 1000;
-                       } else {
-                               // motionTime == null means this is the initialization phase
-                               // so we put false
-                               return false;
-                       }
-
-                       // Did detect motion recently
-                       if (Math.abs(currentTimeSeconds - lastDetectedMotionSeconds) < _numberOfSeconds) {
-                               return true;
-                       }
-               }
-
-               return false;
-       }
-
-
-       /** Method to update state data structures for Smartthings sensors
-        *
-        *   @return [void] None.
-        */
-       public void newReadingAvailable(int _sensorId, int _value, boolean _activeValue) {
-
-               System.out.println("DEBUG: Sensor reading value: " + _value);
-               if(_activeValue) {
-                       System.out.println("DEBUG: Sensor is detecting something: " + _activeValue);
-                       senDetectStatus.put(_sensorId, true);
-
-               } else {
-                       //System.out.println("DEBUG: Sensor is not detecting something: " + _activeValue);
-                       senDetectStatus.put(_sensorId, false);
-               } 
-       }
-
-
-       /** Method to update state data structures for doorlocks
-        *
-        *   @return [void] None.
-        */
-       private void updateDoorLockStatus(RoomSmart rm) {
-
-               // Get and init the outlets for this specific room
-               /*HashSet<DoorLock> doorlocks = roomDoorLockRelation.get(rm);
-               for (DoorLock doorlock : doorlocks) {
-       
-                       // Change is detected! Set to true for report...
-                       if(isChangeDetected()) {
-
-                               doorlockStatus.put(doorlock, true);
-                       } else {
-
-                               doorlockStatus.put(doorlock, false);
-                       }
-               }*/
-       }
-
-
-       /** Method to update state data structures for outlets
-        *
-        *   @return [void] None.
-        */
-       private void updateOutletStatus(RoomSmart rm) {
-
-               // Get and init the outlets for this specific room
-               /*HashSet<Outlet> outlets = roomOutletRelation.get(rm);
-               for (Outlet outlet : outlets) {
-       
-                       // Change is detected! Set to true for report...
-                       if(isChangeDetected()) {
-
-                               outletStatus.put(outlet, true);
-                       } else {
-
-                               outletStatus.put(outlet, false);
-                       }
-               }*/
-       }
-
-
-       /** Update the status of all devices
-        *
-        *   @return [void] None.
-        */
-       private void updateUniversalStatus() {
-
-               // Check for motion in rooms and if there is motion then report
-               for (RoomSmart room : roomSet.values()) {
-
-                       // Update status of camera
-                       updateCameraStatus(room);
-
-                       // Update status of doorlocks
-                       //updateDoorLockStatus(room);
-
-                       // Update status of outlets
-                       //updateOutletStatus(room);
-               }
-       }
-
-
-       /** Update the status of all devices
-        *
-        *   @return [void] None.
-        */
-       private void updateCameraStatus(RoomSmart room) {
-
-               HashSet<CameraSmart> cameras = roomCameraRelation.get(room);
-               if (roomDidHaveMotionRecently(room, MOTION_TIME_THRESHOLD)) {
-
-                       // Motion was detected
-                       System.out.println("DEBUG: Camera detected something!");
-                       for(CameraSmart cam : cameras)
-                               camDetectStatus.put(cam, true);
-               } else {
-
-                       // No motion was detected
-                       //System.out.println("DEBUG: Camera didn't detect anything!");
-                       for(CameraSmart cam : cameras)
-                               camDetectStatus.put(cam, false);
-               }
-       }
-
-       /** Method to turn on alarms
-        *
-        *   @return [void] None.
-        */
-       private void turnOnAlarms(int zoneId) {
-
-               // Get and init the alarm (this single alarm set can serve multiple zones / rooms)
-               Iterator alarmIt = alarmSet.iterator();
-               AlarmSmart alm = (AlarmSmart) alarmIt.next();
-               alm.setZone(zoneId, true, SECOND_TO_TURN_OFF);
-       }
-
-
-       /** Method to turn off alarms
-        *
-        *   @return [void] None.
-        */
-       private void turnOffAlarms(int zoneId) {
-
-               // Get and init the alarm (this single alarm set can serve multiple zones / rooms)
-               Iterator alarmIt = alarmSet.iterator();
-               AlarmSmart alm = (AlarmSmart) alarmIt.next();
-               // Turn this alarm off indefinitely
-               alm.setZone(zoneId, false, SECOND_TO_TURN_ON);
-       }
-
-
-       /** Check status of devices and turn on alarm accordingly
-        *  <p>
-        *  Simple rule is whenever any sensor or camera detect something unusual
-        *      (sensor/camera becomes active) then we sound the corresponding alarm.
-        *  This means we send the signal to the right zone in the EspAlarm
-        *
-        *   @return [void] None.
-        */
-       private void decideToTurnOnAlarm() {
-
-               int zoneId = 0;
-
-               // Check for motion in rooms and if there is motion then report
-               for (RoomSmart room : roomSet.values()) {
-
-                       // Loop through all the cameras in the room
-                       for (CameraSmart cam : roomCameraRelation.get(room)) {
-
-                               // Get the right camera and the right detection status (true or false)
-                               if (camDetectStatus.get(cam)) {
-                                       zoneId = room.getRoomID();
-                                       turnOnAlarms(zoneId);
-                                       System.out.println("DETECTION: Camera active in room: " + zoneId);
-                               }
-                       }
-
-                       // Loop through all the cameras in the room
-                       for (SmartthingsSensorSmart sensor : roomSensorRelation.get(room)) {
-
-                               // Get the right sensor and the right detection status (true or false)
-                               //System.out.println("ABOUT TO DETECT: Reading sensor: " + sensor.getId());
-                               if (senDetectStatus.get(sensor.getId())) {
-                                       zoneId = room.getRoomID();
-                                       turnOnAlarms(zoneId);
-                                       System.out.println("DETECTION: Sensor active in room: " + zoneId);
-                                       System.out.println("DETECTION: Detection by sensor: " + sensor.getId());
-                               }
-                       }
-               }
-       }
-
-
-       /** Check status of devices and turn off alarm accordingly
-        *  <p>
-        *  If everything (camera and sensors) is set back to normal
-        *  then the system will turn off the alarm
-        *
-        *   @return [void] None.
-        */
-       // TODO: Need to fix this part later
-       // TODO: Perhaps we should use a phone app to turn off the alarm
-       /*private void decideToTurnOffAlarm() {
-
-               // Check for motion in rooms and if there is motion then report
-               for (RoomSmart room : roomSet.values()) {
-
-                       int zoneId = room.getRoomID();
-                       // Loop through all the cameras in the room
-                       for (CameraSmart cam : roomCameraRelation.get(room)) {
-
-                               // Get the right camera and the right detection status (true or false)
-                               if (camDetectStatus.get(cam))   // Camera still active so alarm is still on, so false for off-alarm status
-
-                                       alarmStatus.put(zoneId, false);
-
-                               else
-
-                                       alarmStatus.put(zoneId, true);
-                               
-                       }
-
-                       // Loop through all the cameras in the room
-                       for (SmartthingsSensor sensor : roomSensorRelation.get(room)) {
-
-                               // Get the right sensor and the right detection status (true or false)
-                               if (senDetectStatus.get(sensor.getId()))        // Sensor still active so alarm is still on, so false for off-alarm status
-
-                                       alarmStatus.put(zoneId, false);
-
-                               else
-
-                                       alarmStatus.put(zoneId, true);
-                       }
-               }
-
-               // Turn on alarm in the right zone
-               for (Map.Entry<Integer, Boolean> alEnt : alarmStatus.entrySet()) {
-                       if (alEnt.getValue())   // if this zone is true, that means we need to turn off its alarm
-                               turnOffAlarms(alEnt.getKey());
-               }
-       }*/
-
-
-       /*******************************************************************************************************************************************
-       **
-       **  Public Methods
-       **
-       *******************************************************************************************************************************************/
-
-       /** Initialization method, called by the runtime (effectively the main of the controller)
-        *   This method runs a continuous loop and is blocking
-        *
-        *   @return [void] None;
-        */
-       public void init() {
-
-               // Iterate over the set of rooms
-               for (RoomSmart rm : roomSet.values()) {
-
-                       // Init all Smartthings sensors
-                       initSmartthingsSensors(rm);
-
-                       // Init all cameras
-                       initCameras(rm);
-
-                       // Init all doorlocks
-                       //initDoorLocks();
-
-                       // Init all outlets
-                       //initOutlets();
-               }
-
-               // Init all alarms
-               initAlarms();
-
-               System.out.println("DEBUG: Initialized all devices! Now starting detection loop!");
-
-               // Run the main loop that will keep checking the sensors and cameras periodically
-               while (true) {
-
-                       // Run this code every <specified time>
-                       long currentTimeSeconds = (new Date()).getTime() / 1000;
-                       if ((currentTimeSeconds - lastTimeChecked) > CHECK_TIME_WAIT) {
-                               lastTimeChecked = currentTimeSeconds;
-
-                               // Update the status of all devices
-                               updateUniversalStatus();
-
-                               // Decide to turn on alarm if any of the sensor/camera detects something unusual
-                               decideToTurnOnAlarm();
-
-                               // Decide to turn off alarm if every sensor/camera goes back to normal
-                               //decideToTurnOffAlarm();
-
-                       } else {
-
-                               try {
-
-                                       Thread.sleep(CHECK_TIME_WAIT * 100); // sleep for a tenth of the time
-
-                               } catch (Exception e) {
-
-                                       e.printStackTrace();
-                               }
-                       }
-
-               }
-       }
-}
-
-
diff --git a/benchmarks/HomeSecurityController/Makefile b/benchmarks/HomeSecurityController/Makefile
deleted file mode 100644 (file)
index 16ca57a..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-BASE = ../..
-
-include $(BASE)/common.mk
-
-BOOFDIR := ../libs/boofcv_libs
-BOOFJARS := $(BOOFDIR)/BoofCV-feature-0.21.jar:$(BOOFDIR)/BoofCV-io-0.21.jar:$(BOOFDIR)/BoofCV-visualize-0.21.jar:$(BOOFDIR)/BoofCV-ip-0.21.jar:$(CHECKERJARS)
-
-JFLAGS = -d $(BIN_DIR) -cp $(BOOFJARS):$(BIN_DIR):.
-JARFLAGS = cf 
-
-all: homesecurity
-
-PHONY += homesecurity
-homesecurity:
-       $(JAVAC) $(JFLAGS) *.java
-       cp HomeSecurityController.config $(BIN_DIR)/HomeSecurityController
-       cd $(BIN_DIR)/HomeSecurityController; $(JAR) $(JARFLAGS) HomeSecurityController.jar ../HomeSecurityController/HomeSecurityController*.class ../HomeSecurityController/MotionDetection*.class ../iotcode/interfaces/SmartthingsSensor*.class ../iotcode/interfaces/Camera*.class ../iotcode/interfaces/Alarm*.class ../iotcode/interfaces/Room*.class  ../iotcode/interfaces/ZoneState*.class
-
-.PHONY: $(PHONY)
diff --git a/benchmarks/HomeSecurityController/MotionDetection.java b/benchmarks/HomeSecurityController/MotionDetection.java
deleted file mode 100644 (file)
index dceeb7f..0000000
+++ /dev/null
@@ -1,463 +0,0 @@
-package HomeSecurityController;
-
-// IoT packages
-import iotcode.annotation.*;
-import iotcode.interfaces.*;
-
-// BoofCv packages
-import boofcv.alg.background.BackgroundModelStationary;
-import boofcv.factory.background.ConfigBackgroundGaussian;
-import boofcv.factory.background.FactoryBackgroundModel;
-import boofcv.gui.binary.VisualizeBinaryData;
-import boofcv.gui.image.ImageGridPanel;
-import boofcv.gui.image.ShowImages;
-import boofcv.io.MediaManager;
-import boofcv.io.UtilIO;
-import boofcv.io.image.SimpleImageSequence;
-import boofcv.io.image.ConvertBufferedImage;
-import boofcv.io.wrapper.DefaultMediaManager;
-import boofcv.struct.image.ImageBase;
-import boofcv.struct.image.ImageFloat32;
-import boofcv.struct.image.ImageType;
-import boofcv.struct.image.ImageUInt8;
-import boofcv.alg.filter.blur.BlurImageOps;
-
-
-// Standard Java Packages
-import java.awt.image.BufferedImage;
-import java.util.Date;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReadWriteLock;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.awt.image.ColorModel;
-import java.awt.image.WritableRaster;
-import java.util.List;
-import java.util.ArrayList;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import javax.imageio.ImageIO;
-
-// RMI Packages
-import java.rmi.RemoteException;
-
-// For testing
-import java.net.*;
-
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
-import java.util.Iterator;
-
-// Checker annotations
-//import iotchecker.qual.*;
-
-/** Class MotionDetection to do motion detection using images
- *
- *
- * @author      Ali Younis <ayounis @ uci.edu>
- * @version     1.0
- * @since       2016-03-21
- */
-class MotionDetection implements CameraCallback {
-
-       // Define Like variables
-       private static boolean DO_GRAPHICAL_USER_INTERFACE = false;
-
-       /*******************************************************************************************************************************************
-       **
-       **  Constants
-       **
-       *******************************************************************************************************************************************/
-       private final float MOTION_DETECTED_THRESHOLD_PERCENTAGE = 15;
-
-
-       /*******************************************************************************************************************************************
-       **
-       **  Variables
-       **
-       *******************************************************************************************************************************************/
-
-       // Timestamp buffer and locks needed for that safety on that buffer
-       // This is the buffer for post-detection algorithm use
-       private Date timestampOfLastMotion = null;
-       private ReadWriteLock timestampReadWriteLock = new ReentrantReadWriteLock();
-       private Lock timestampReadLock = timestampReadWriteLock.readLock();
-       private Lock timestampWriteLock = timestampReadWriteLock.writeLock();
-
-       // Flag for when new data is available and ready for processing
-       private AtomicBoolean newFrameAvailable = new AtomicBoolean(false);
-
-       // Flag for determining if motion has been detected and therefore
-       // the callbacks should be issued
-       private AtomicBoolean motionDetected = new AtomicBoolean(false);
-
-       // Image and timestamp buffers and  locks needed for that safety on those buffers
-       // Timestamp buffer for pre-detection algorithm use
-       private BufferedImage latestImage = null;
-       private Date possibleDate = null;
-       private ReadWriteLock imageReadWriteLock = new ReentrantReadWriteLock();
-       private Lock imageReadLock = imageReadWriteLock.readLock();
-       private Lock imageWriteLock = imageReadWriteLock.writeLock();
-
-       // List of objects wishing to receive callbacks from this class.
-       private List<MotionDetectionCallback>
-       callbackList = new ArrayList<MotionDetectionCallback>();
-
-       // Variables to help with motion detection
-       private ConfigBackgroundGaussian configGaussian = null;
-       private BackgroundModelStationary backgroundDetector = null;
-       private ImageUInt8 segmented = null;
-       private ImageFloat32 newFrameFloat = null;
-
-       // counts the number of frames since a background image is added to algorithm
-       private int frameCounter = 0;
-
-       private CameraSmart _camera;
-
-       /*******************************************************************************************************************************************
-       **
-       **  Threads
-       **
-       *******************************************************************************************************************************************/
-       private Thread workThread = null;
-       private Thread callBackThread = null;
-
-       /*******************************************************************************************************************************************
-       **
-       **  GUI Stuff (Used Only for Testing)
-       **
-       *******************************************************************************************************************************************/
-       ImageGridPanel gui;
-
-       /** Constructor
-        *
-        *   @param _threshold       [float], Variable for gaussian background detector.
-        *   @param _learnSpeed      [float], Variable for gaussian background detector.
-        *   @param _initialVariance [float], Variable for gaussian background detector.
-        *   @param _minDifference   [float], Variable for gaussian background detector.
-        *
-        */
-       public MotionDetection(float _threshold, float _learnSpeed, float _initialVariance, float _minDifference) {
-
-               // Configure the Gaussian model used for background detection
-               configGaussian = new ConfigBackgroundGaussian(_threshold, _learnSpeed);
-               configGaussian.initialVariance = _initialVariance;
-               configGaussian.minimumDifference = _minDifference;
-
-               // setup the background detector
-               ImageType imageType = ImageType.single(ImageFloat32.class);
-               backgroundDetector = FactoryBackgroundModel.stationaryGaussian(configGaussian, imageType);
-
-               // setup the gui if we are going to use it
-               if (DO_GRAPHICAL_USER_INTERFACE) {
-
-                       // create an image grid for images to place on, tile fashion
-                       gui = new ImageGridPanel(1, 2);
-
-                       // make the window large so we dont have to manually resize with the mouse
-                       gui.setSize(1920, 1080);
-
-                       // Make the window visible and set the title
-                       ShowImages.showWindow(gui, "Static Scene: Background Segmentation", true);
-               }
-
-               // Launch the worker thread
-               workThread = new Thread(new Runnable() {
-                       public void run() {
-
-                               while (true) {
-                                       runMotionDetection();
-                               }
-                       }
-               });
-               workThread.start();
-
-
-               // Launch the callback thread
-               callBackThread = new Thread(new Runnable() {
-                       public void run() {
-
-                               while (true) {
-                                       doCallbacks();
-                               }
-                       }
-               });
-               callBackThread.start();
-       }
-
-
-       /*******************************************************************************************************************************************
-       **
-       **  Public Methods
-       **
-       *******************************************************************************************************************************************/
-
-       /** Method to add a new frame to the motion detector.
-        *
-        *   @param _newFrame  [byte[]], Frame data of new frame.
-        *   @param _timestamp [Date]  , Timestamp of new frame.
-        *
-        *   @return [void] None.
-        */
-       public void addFrame(byte[]  _newFrame, Date _timestamp) {
-               BufferedImage img = null;
-
-               try {
-                       // Parse the byte array into a Buffered Image
-                       InputStream in = new ByteArrayInputStream(_newFrame);
-                       img = ImageIO.read(in);
-
-               } catch (Exception e) {
-                       e.printStackTrace();
-                       return;
-               }
-
-               // Save the image and timestamp for use later
-               imageWriteLock.lock();// lock the image and timestamp buffers since multithread
-               latestImage = img;// image into image buffer
-               possibleDate = _timestamp;// timestamp into timestamp buffer
-               imageWriteLock.unlock();// Never forget to unlock
-
-               // flag the worker thread that there is new data ready for processing
-               newFrameAvailable.set(true);
-       }
-
-       /** Method to get the timestamp of the last time motion was detected
-        *
-        *   @return [Date] timestamp of last motion or null if no motion was ever detected.
-        */
-       public Date getTimestampOfLastMotion() {
-               Date ret = null;
-
-               // Be safe because multithread
-               timestampReadLock.lock();
-
-               // Checks if there was ever motion, if not then timestampOfLastMotion
-               // will be null
-               if (timestampOfLastMotion != null) {
-                       // Clone since we don't know what the other person is going to do
-                       // with the timestamp
-                       ret = (Date)timestampOfLastMotion.clone();
-               }
-
-               timestampReadLock.unlock();
-
-               return ret;
-       }
-
-
-       /** Method to add a new frame to the motion detector from a camera
-        *
-        *   @param _camera  [Camera], Camera that has the new data.
-        *
-        *   @return [void] None.
-        */
-       public void newCameraFrameAvailable(byte[] latestFrame, long timeStamp) {
-               BufferedImage img = null;
-
-               try {
-                       // Parse the byte array into a Buffered Image
-                       //InputStream in = new ByteArrayInputStream(_camera.getLatestFrame());
-                       InputStream in = new ByteArrayInputStream(latestFrame);
-                       img = ImageIO.read(in);
-
-               } catch (RemoteException e) {
-                       e.printStackTrace();
-                       return;
-
-               } catch (Exception e) {
-                       e.printStackTrace();
-                       return;
-
-               }
-
-               // Save the image and timestamp for use later
-               imageWriteLock.lock();  // lock the image and timestamp buffers since multithread
-               latestImage = img;              // image into image buffer
-
-               // timestamp from camera into timestamp buffer
-               long dateLong = timeStamp;
-               possibleDate = new Date(dateLong);
-
-               imageWriteLock.unlock();        // Never forget to unlock
-
-               // flag the worker thread that there is new data ready for processing
-               newFrameAvailable.set(true);
-       }
-
-       /** Method to register an object to recieve callbacks from this motion detector
-        *
-        *   @param _mdc  [MotionDetectionCallback], object to recieve callbacks.
-        *
-        *   @return [void] None.
-        */
-       public void registerCallback(MotionDetectionCallback _mdc) {
-               callbackList.add(_mdc);
-       }
-
-       /*******************************************************************************************************************************************
-       **
-       **  Helper Methods
-       **
-       *******************************************************************************************************************************************/
-
-       /** Method that constantly loops checking if new data is available.  If there is
-        *   new data, it is processed.
-        *   This method should be run on a separate thread.
-        *
-        *   @return [void] None.
-        */
-       private void runMotionDetection() {
-
-               // check if there is a new frame availble, only runs detection if there is new data to save
-               // computation time
-               if (!newFrameAvailable.get()) {
-                       return;
-               }
-
-               // Lock since we are accessing the data buffers
-               imageReadLock.lock();
-
-               // processing data so now the buffered data is old
-               newFrameAvailable.set(false);
-
-               // copy from buffer to local for processing
-               Date tmpDate = possibleDate;
-
-               // Allocate space for the segmented image based on the first image we received
-               // cannot pre-allocate this since we do not know what the size of the images is
-               // before the first image arrives
-               if (segmented == null) {
-                       segmented = new ImageUInt8(latestImage.getWidth(), latestImage.getHeight());
-               }
-
-               // copy from data buffers and convert into correct data type for BoofCv libraries
-               newFrameFloat = ConvertBufferedImage.convertFrom(latestImage, newFrameFloat);
-
-               // All done accessing the data buffers
-               imageReadLock.unlock();
-
-               // Run background detection
-               backgroundDetector.segment(newFrameFloat, segmented);
-
-               // Update the background baseline every 10 frames, helps the algorithm
-               frameCounter++;
-               if (frameCounter > 10) {
-                       backgroundDetector.updateBackground(newFrameFloat);
-                       frameCounter = 0;
-               }
-
-               // get the raw pixel data, gray-scale image
-               byte[] frameData = segmented.getData();
-
-               // count the number of pixels of the image that was deemed as "motion"
-               double count = 0;
-               double countMotion = 0;
-               for (byte b : frameData) {
-                       count++;
-                       if (b > 0) {
-                               countMotion++;
-                       }
-               }
-
-               // calculate the percentage of the image that was in motion
-               double percentMotion = (countMotion / count) * 100.0;
-
-               // Check if a high enough percentage of the image was in motion to say that there was motion in this frame of data
-               if (percentMotion > MOTION_DETECTED_THRESHOLD_PERCENTAGE) {
-
-                       // Motion detected so save timestamp of this frame to another buffer
-                       timestampWriteLock.lock();
-                       timestampOfLastMotion = (Date)tmpDate.clone();                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          // clone to a different buffer
-                       timestampWriteLock.unlock();
-
-                       System.out.println("Motion Detected (with percentage: " + Double.toString(percentMotion) + "%)");
-               }
-
-               // Do output to the screen if we are using gui mode
-               if (DO_GRAPHICAL_USER_INTERFACE) {
-
-                       // change image data unto correct type for rendering
-                       BufferedImage visualized1 = new BufferedImage(segmented.width, segmented.height, BufferedImage.TYPE_INT_RGB);
-                       VisualizeBinaryData.renderBinary(segmented, false, visualized1);
-
-                       // change image data unto correct type for rendering
-                       BufferedImage visualized2 = null;
-                       visualized2 = ConvertBufferedImage.convertTo(newFrameFloat, visualized2, true);
-
-                       // place the images into the image grid
-                       gui.setImage(0, 1, visualized1);
-                       gui.setImage(0, 2, visualized2);
-
-                       // trigger rendering
-                       gui.repaint();
-               }
-       }
-
-       /** Method that constantly loops checking if the callbacks should be issues and
-        *   issues the callbacks if they should be issues.
-        *   This method should be run on a separate thread.
-        *
-        *   @return [void] None.
-        */
-       private void doCallbacks() {
-
-               // Keep looping forever for callback
-               while (true) {
-
-                       // If motion detected
-                       if (motionDetected.compareAndSet(true, false)) {
-
-                               // Motion was detected so issue callbacks to all objects that registered
-                               // to receive callback from this class.
-                               for (MotionDetectionCallback c : callbackList) {
-                                       //try {
-                                               c.motionDetected(this);
-                                       //} catch (RemoteException re) {
-                                       //}
-                               }
-
-                       } else {
-
-                               // Sleep for 15 millisec to give time for new frame to arrive
-                               try {
-                                       Thread.sleep(15);
-                               } catch (InterruptedException ie) {
-                               }
-                       }
-               }
-       }
-
-
-
-
-       // /*******************************************************************************************************************************************
-       // **  Main Method used for testing
-       // *******************************************************************************************************************************************/
-       // public static void main(String[] args) {
-       //     MotionDetection mo = new MotionDetection(12, 0.5f, 10, 10);
-
-       //     AmcrestCamera cam = null;
-       //     try {
-
-       //         InetAddress addr = InetAddress.getByName("192.168.1.29");
-       //         cam = new AmcrestCamera(addr, "admin", "55779CatSoundz32");
-       //         cam.registerCallback(mo);
-       //         cam.start();
-       //         // cam.streamDisconnect();
-
-       //     } catch (Exception e) {
-
-       //     }
-
-       //     while (true) {
-
-       //     }
-
-       // }
-}
-
diff --git a/benchmarks/HomeSecurityController/MotionDetectionCallback.java b/benchmarks/HomeSecurityController/MotionDetectionCallback.java
deleted file mode 100644 (file)
index 9ee6906..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-package HomeSecurityController;
-
-/** Interface MotionDetectionCallback for allowing callbacks from the MotionDetection class.
- *
- *
- * @author      Ali Younis <ayounis @ uci.edu>
- * @version     1.0
- * @since       2016-03-21
- */
-
-public interface MotionDetectionCallback {
-
-       /** Callback method for when motion is detected.
-        *
-        *   @param _md [MotionDetection].
-        *
-        *   @return [void] None.
-        */
-       public void motionDetected(MotionDetection _md);
-}
diff --git a/benchmarks/HomeSecurityController/RoomSmart_Stub.java b/benchmarks/HomeSecurityController/RoomSmart_Stub.java
deleted file mode 100644 (file)
index 0c04049..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-package HomeSecurityController;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Arrays;
-import iotrmi.Java.IoTRMICall;
-import iotrmi.Java.IoTRMIObject;
-
-import iotcode.interfaces.RoomSmart;
-
-public class RoomSmart_Stub implements RoomSmart {
-
-       private IoTRMICall rmiCall;
-       private String callbackAddress;
-       private int[] ports;
-
-       private final static int objectId = 0;
-       
-
-       public RoomSmart_Stub(int _port, String _skeletonAddress, String _callbackAddress, int _rev, int[] _ports) throws Exception {
-               callbackAddress = _callbackAddress;
-               ports = _ports;
-               rmiCall = new IoTRMICall(_port, _skeletonAddress, _rev);
-       }
-
-       public int getRoomID() {
-               int methodId = 0;
-               Class<?> retType = int.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               return (int)retObj;
-       }
-
-}
diff --git a/benchmarks/HomeSecurityController/SmartthingsSensorCallback_CallbackSkeleton.java b/benchmarks/HomeSecurityController/SmartthingsSensorCallback_CallbackSkeleton.java
deleted file mode 100644 (file)
index 6e09471..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-package HomeSecurityController;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Arrays;
-import iotrmi.Java.IoTRMICall;
-import iotrmi.Java.IoTRMIObject;
-
-import iotcode.interfaces.*;
-
-public class SmartthingsSensorCallback_CallbackSkeleton implements SmartthingsSensorCallback {
-
-       private SmartthingsSensorCallback mainObj;
-       private int objectId = 0;
-       private String callbackAddress;
-       
-
-       public SmartthingsSensorCallback_CallbackSkeleton(SmartthingsSensorCallback _mainObj, String _callbackAddress, int _objectId) throws Exception {
-               callbackAddress = _callbackAddress;
-               mainObj = _mainObj;
-               objectId = _objectId;
-       }
-
-       public void newReadingAvailable(int _sensorId, int _value, boolean _activeValue) {
-               mainObj.newReadingAvailable(_sensorId, _value, _activeValue);
-       }
-
-       public void ___newReadingAvailable(IoTRMIObject rmiObj) {
-               Object[] paramObj = rmiObj.getMethodParams(new Class<?>[] { int.class, int.class, boolean.class }, 
-               new Class<?>[] { null, null, null });
-               newReadingAvailable((int) paramObj[0], (int) paramObj[1], (boolean) paramObj[2]);
-       }
-
-       public void invokeMethod(IoTRMIObject rmiObj) throws IOException {
-               int methodId = rmiObj.getMethodId();
-               switch (methodId) {
-                       case 0: ___newReadingAvailable(rmiObj); break;
-                       default: 
-                       throw new Error("Method Id " + methodId + " not recognized!");
-               }
-       }
-
-}
diff --git a/benchmarks/HomeSecurityController/SmartthingsSensorSmart_Stub.java b/benchmarks/HomeSecurityController/SmartthingsSensorSmart_Stub.java
deleted file mode 100644 (file)
index 87eff75..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-package HomeSecurityController;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Arrays;
-import iotrmi.Java.IoTRMICall;
-import iotrmi.Java.IoTRMIObject;
-
-import iotcode.interfaces.*;
-
-public class SmartthingsSensorSmart_Stub implements SmartthingsSensorSmart {
-
-       private IoTRMICall rmiCall;
-       private String callbackAddress;
-       private int[] ports;
-
-       private final static int objectId = 0;
-       // Callback properties
-       private IoTRMIObject rmiObj;
-       List<SmartthingsSensorCallback> listCallbackObj;
-       private int objIdCnt = 0;
-       private final static int object0Id = 0; //SmartthingsSensorSmartCallback
-       private static Integer[] object0Permission = { 0 };
-       private static List<Integer> set0Allowed;
-       
-
-       public SmartthingsSensorSmart_Stub(int _port, String _skeletonAddress, String _callbackAddress, int _rev, int[] _ports) throws Exception {
-               callbackAddress = _callbackAddress;
-               ports = _ports;
-               rmiCall = new IoTRMICall(_port, _skeletonAddress, _rev);
-               set0Allowed = new ArrayList<Integer>(Arrays.asList(object0Permission));
-               listCallbackObj = new ArrayList<SmartthingsSensorCallback>();
-               set0Allowed.add(-9999);
-               ___initCallBack();
-       }
-
-       public long getTimestampOfLastReading() {
-               int methodId = 3;
-               Class<?> retType = long.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               return (long)retObj;
-       }
-
-       public boolean isActiveValue() {
-               int methodId = 2;
-               Class<?> retType = boolean.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               return (boolean)retObj;
-       }
-
-       public int getId() {
-               int methodId = 5;
-               Class<?> retType = int.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               return (int)retObj;
-       }
-
-       public void registerCallback(SmartthingsSensorCallback _callbackTo) {
-               try {
-                       SmartthingsSensorCallback_CallbackSkeleton skel0 = new SmartthingsSensorCallback_CallbackSkeleton(_callbackTo, callbackAddress, objIdCnt++);
-                       listCallbackObj.add(skel0);
-               } catch (Exception ex) {
-                       ex.printStackTrace();
-                       throw new Error("Exception when generating skeleton objects!");
-               }
-
-               int methodId = 6;
-               Class<?> retType = void.class;
-               Class<?>[] paramCls = new Class<?>[] { int.class };
-               Object[] paramObj = new Object[] { new Integer(1) };
-               rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-       }
-
-       public void ___initCallBack() {
-               Thread thread = new Thread() {
-                       public void run() {
-                               try {
-                                       rmiObj = new IoTRMIObject(ports[0]);
-                                       while (true) {
-                                               byte[] method = rmiObj.getMethodBytes();
-                                               int objId = IoTRMIObject.getObjectId(method);
-                                               SmartthingsSensorCallback_CallbackSkeleton skel = (SmartthingsSensorCallback_CallbackSkeleton) listCallbackObj.get(objId);
-                                               if (skel != null) {
-                                                       int methodId = IoTRMIObject.getMethodId(method);
-                                                       if (!set0Allowed.contains(methodId)) {
-                                                               throw new Error("Callback object for SmartthingsSensorCallback is not allowed to access method: " + methodId);
-                                                       }
-                                                       skel.invokeMethod(rmiObj);
-                                               } else {
-                                                       throw new Error("SmartthingsSensorCallback: Object with Id " + objId + " not found!");
-                                               }
-                                       }
-                               } catch (Exception ex) {
-                                       ex.printStackTrace();
-                                       throw new Error("Error instantiating class SmartthingsSensorCallback_CallbackSkeleton!");
-                               }
-                       }
-               };
-               thread.start();
-
-               int methodId = -9998;
-               Class<?> retType = void.class;
-               Class<?>[] paramCls = new Class<?>[] { int[].class, String.class, int.class };
-               Object[] paramObj = new Object[] { ports, callbackAddress, 0 };
-               rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-       }
-
-       public int getValue() {
-               int methodId = 1;
-               Class<?> retType = int.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               return (int)retObj;
-       }
-
-       public void setId(int id) {
-               int methodId = 4;
-               Class<?> retType = void.class;
-               Class<?>[] paramCls = new Class<?>[] { int.class };
-               Object[] paramObj = new Object[] { id };
-               rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-       }
-
-       public void init() {
-               int methodId = 0;
-               Class<?> retType = void.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-       }
-
-}
diff --git a/benchmarks/IrrigationController/CameraCallback_CallbackSkeleton.java b/benchmarks/IrrigationController/CameraCallback_CallbackSkeleton.java
deleted file mode 100644 (file)
index afe1048..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-package IrrigationController;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Arrays;
-import iotrmi.Java.IoTRMICall;
-import iotrmi.Java.IoTRMIObject;
-
-import iotcode.interfaces.*;
-
-public class CameraCallback_CallbackSkeleton implements CameraCallback {
-
-       private CameraCallback mainObj;
-       private int objectId = 0;
-       private String callbackAddress;
-       
-
-       public CameraCallback_CallbackSkeleton(CameraCallback _mainObj, String _callbackAddress, int _objectId) throws Exception {
-               callbackAddress = _callbackAddress;
-               mainObj = _mainObj;
-               objectId = _objectId;
-       }
-
-       public void newCameraFrameAvailable(byte latestFrame[], long timeStamp) {
-               mainObj.newCameraFrameAvailable(latestFrame, timeStamp);
-       }
-
-       public void ___newCameraFrameAvailable(IoTRMIObject rmiObj) {
-               Object[] paramObj = rmiObj.getMethodParams(new Class<?>[] { byte[].class, long.class }, 
-               new Class<?>[] { null, null });
-               newCameraFrameAvailable((byte[]) paramObj[0], (long) paramObj[1]);
-       }
-
-       public void invokeMethod(IoTRMIObject rmiObj) throws IOException {
-               int methodId = rmiObj.getMethodId();
-               switch (methodId) {
-                       case 0: ___newCameraFrameAvailable(rmiObj); break;
-                       default: 
-                       throw new Error("Method Id " + methodId + " not recognized!");
-               }
-       }
-
-}
diff --git a/benchmarks/IrrigationController/CameraSmart_Stub.java b/benchmarks/IrrigationController/CameraSmart_Stub.java
deleted file mode 100644 (file)
index 7c1783b..0000000
+++ /dev/null
@@ -1,184 +0,0 @@
-package IrrigationController;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Arrays;
-import iotrmi.Java.IoTRMICall;
-import iotrmi.Java.IoTRMIObject;
-
-import iotcode.interfaces.*;
-
-public class CameraSmart_Stub implements CameraSmart {
-
-       private IoTRMICall rmiCall;
-       private String callbackAddress;
-       private int[] ports;
-
-       private final static int objectId = 0;
-       // Callback properties
-       private IoTRMIObject rmiObj;
-       List<CameraCallback> listCallbackObj;
-       private static int objIdCnt = 0;
-       private final static int object0Id = 0; //CameraSmartCallback
-       private static Integer[] object0Permission = { 0 };
-       private static List<Integer> set0Allowed;
-       
-
-       public CameraSmart_Stub(int _port, String _skeletonAddress, String _callbackAddress, int _rev, int[] _ports) throws Exception {
-               callbackAddress = _callbackAddress;
-               ports = _ports;
-               rmiCall = new IoTRMICall(_port, _skeletonAddress, _rev);
-               set0Allowed = new ArrayList<Integer>(Arrays.asList(object0Permission));
-               listCallbackObj = new ArrayList<CameraCallback>();
-               set0Allowed.add(-9999);
-               ___initCallBack();
-       }
-
-       public int getMaxFPS() {
-               int methodId = 8;
-               Class<?> retType = int.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               return (int)retObj;
-       }
-
-       public boolean setFPS(int _fps) {
-               int methodId = 7;
-               Class<?> retType = boolean.class;
-               Class<?>[] paramCls = new Class<?>[] { int.class };
-               Object[] paramObj = new Object[] { _fps };
-               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               return (boolean)retObj;
-       }
-
-       public int getMinFPS() {
-               int methodId = 9;
-               Class<?> retType = int.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               return (int)retObj;
-       }
-
-       public boolean setResolution(Resolution _res) {
-               int methodId = 6;
-               Class<?> retType = boolean.class;
-               int paramEnum0[] = new int[1];
-               paramEnum0[0] = _res.ordinal();
-               Class<?>[] paramCls = new Class<?>[] { int[].class };
-               Object[] paramObj = new Object[] { paramEnum0 };
-               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               return (boolean)retObj;
-       }
-
-       public void stop() {
-               int methodId = 2;
-               Class<?> retType = void.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-       }
-
-       public void start() {
-               int methodId = 1;
-               Class<?> retType = void.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-       }
-
-       public long getTimestamp() {
-               int methodId = 4;
-               Class<?> retType = long.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               return (long)retObj;
-       }
-
-       public byte[] getLatestFrame() {
-               int methodId = 3;
-               Class<?> retType = byte[].class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               return (byte[])retObj;
-       }
-
-       public void init() {
-               int methodId = 0;
-               Class<?> retType = void.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-       }
-
-       public void registerCallback(CameraCallback _callbackTo) {
-               try {
-                       CameraCallback_CallbackSkeleton skel0 = new CameraCallback_CallbackSkeleton(_callbackTo, callbackAddress, objIdCnt++);
-                       listCallbackObj.add(skel0);
-               } catch (Exception ex) {
-                       ex.printStackTrace();
-                       throw new Error("Exception when generating skeleton objects!");
-               }
-
-               int methodId = 10;
-               Class<?> retType = void.class;
-               Class<?>[] paramCls = new Class<?>[] { int.class };
-               Object[] paramObj = new Object[] { new Integer(1) };
-               rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-       }
-
-       public void ___initCallBack() {
-               Thread thread = new Thread() {
-                       public void run() {
-                               try {
-                                       rmiObj = new IoTRMIObject(ports[0]);
-                                       while (true) {
-                                               byte[] method = rmiObj.getMethodBytes();
-                                               int objId = IoTRMIObject.getObjectId(method);
-                                               CameraCallback_CallbackSkeleton skel = (CameraCallback_CallbackSkeleton) listCallbackObj.get(objId);
-                                               if (skel != null) {
-                                                       int methodId = IoTRMIObject.getMethodId(method);
-                                                       if (!set0Allowed.contains(methodId)) {
-                                                               throw new Error("Callback object for CameraCallback is not allowed to access method: " + methodId);
-                                                       }
-                                                       skel.invokeMethod(rmiObj);
-                                               } else {
-                                                       throw new Error("CameraCallback: Object with Id " + objId + " not found!");
-                                               }
-                                       }
-                               } catch (Exception ex) {
-                                       ex.printStackTrace();
-                                       throw new Error("Error instantiating class CameraCallback_CallbackSkeleton!");
-                               }
-                       }
-               };
-               thread.start();
-
-               int methodId = -9998;
-               Class<?> retType = void.class;
-               Class<?>[] paramCls = new Class<?>[] { int[].class, String.class, int.class };
-               Object[] paramObj = new Object[] { ports, callbackAddress, 0 };
-               rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-       }
-
-       public List<Resolution> getSupportedResolutions() {
-               int methodId = 5;
-               Class<?> retType = int[].class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               int[] retEnum = (int[]) retObj;
-               Resolution[] enumVals = Resolution.values();
-               int retLen = retEnum.length;
-               List<Resolution> enumRetVal = new ArrayList<Resolution>();
-               for (int i = 0; i < retLen; i++) {
-                       enumRetVal.add(enumVals[retEnum[i]]);
-               }
-               return enumRetVal;
-       }
-
-}
diff --git a/benchmarks/IrrigationController/DayWeather.java b/benchmarks/IrrigationController/DayWeather.java
deleted file mode 100644 (file)
index 90e0f1e..0000000
+++ /dev/null
@@ -1,852 +0,0 @@
-package IrrigationController;
-
-// Standard Java Packages
-import java.text.SimpleDateFormat;
-import java.text.ParseException;
-import java.util.Date;
-
-/** Class DayWeather to represent the parsed weather data as a compact object.
- *
- * @author      Ali Younis <ayounis @ uci.edu>
- * @version     1.0
- * @since       2016-03-24
- */
-public class DayWeather {
-
-       // enumeration representing the weather conditions
-       public enum WeatherConditions {
-               THUNDERSTORM_WITH_LIGHT_RAIN,
-               THUNDERSTORM_WITH_RAIN,
-               THUNDERSTORM_WITH_HEAVY_RAIN,
-               LIGHT_THUNDERSTORM,
-               THUNDERSTORM,
-               HEAVY_THUNDERSTORM,
-               RAGGED_THUNDERSTORM,
-               THUNDERSTORM_WITH_LIGHT_DRIZZLE,
-               THUNDERSTORM_WITH_DRIZZLE,
-               THUNDERSTORM_WITH_HEAVY_DRIZZLE,
-               LIGHT_INTENSITY_DRIZZLE,
-               DRIZZLE,
-               HEAVY_INTENSITY_DRIZZLE,
-               LIGHT_INTENSITY_DRIZZLE_RAIN,
-               DRIZZLE_RAIN,
-               HEAVY_INTENSITY_DRIZZLE_RAIN,
-               SHOWER_RAIN_AND_DRIZZLE,
-               HEAVY_SHOWER_RAIN_AND_DRIZZLE,
-               SHOWER_DRIZZLE,
-               LIGHT_RAIN,
-               MODERATE_RAIN,
-               HEAVY_INTENSITY_RAIN,
-               VERY_HEAVY_RAIN,
-               EXTREME_RAIN,
-               FREEZING_RAIN,
-               LIGHT_INTENSITY_SHOWER_RAIN,
-               SHOWER_RAIN,
-               HEAVY_INTENSITY_SHOWER_RAIN,
-               RAGGED_SHOWER_RAIN,
-               LIGHT_SNOW,
-               SNOW,
-               HEAVY_SNOW,
-               SLEET,
-               SHOWER_SLEET,
-               LIGHT_RAIN_AND_SNOW,
-               RAIN_AND_SNOW,
-               LIGHT_SHOWER_SNOW,
-               SHOWER_SNOW,
-               HEAVY_SHOWER_SNOW,
-               MIST,
-               SMOKE,
-               HAZE,
-               SAND_DUST_WHIRLS,
-               FOG,
-               SAND,
-               DUST,
-               VOLCANIC_ASH,
-               SQUALLS,
-               TORNADO,
-               CLEAR_SKY,
-               FEW_CLOUDS,
-               SCATTERED_CLOUDS,
-               BROKEN_CLOUDS,
-               OVERCAST_CLOUDS,
-               TROPICAL_STORM,
-               COLD,
-               HOT,
-               WINDY,
-               HAIL,
-               CALM,
-               LIGHT_BREEZE,
-               GENTLE_BREEZE,
-               MODERATE_BREEZE,
-               FRESH_BREEZE,
-               STRONG_BREEZE,
-               HIGH_WIND_NEAR_GALE,
-               GALE,
-               SEVERE_GALE,
-               STORM,
-               VIOLENT_STORM,
-               HURRICANE,
-               UNKNOWN
-       };
-
-
-       /*******************************************************************************************************************************************
-       **
-       **  Variables
-       **
-       *******************************************************************************************************************************************/
-       private Date date = null;
-       private WeatherConditions weatherCondition = WeatherConditions.UNKNOWN;
-
-       // Wind Information
-       private String windDirection = "";
-       private int windDirectionDegrees = 0;                   // In degrees
-       private float windSpeed = 0;                                                    // In Miles per hour
-
-       // Temperature Information
-       private float dayTemperature = 0;                                       // In degrees F
-       private float eveningTemperature = 0;                   // In degrees F
-       private float morningTemperature = 0;                   // In degrees F
-       private float nightTemperature = 0;                             // In degrees F
-       private float maxTemperature = 0;                                       // In degrees F
-       private float minTemperature = 0;                                       // In degrees F
-
-       // Other Information
-       private float pressure = 0;                                             // In hPa
-       private float humidity = 0;                                             // In percent
-       private float cloudPercentage = 0;              // In percent
-
-
-       /** Constructor.
-        *
-        *  @param _date                  [String], String representing the date information for this days weather.
-        *  @param _weatherCondition      [String], String representing the weather condition code information for this days weather.
-        *  @param _windDirection         [String], String representing the wind direction in text format information for this days weather.
-        *  @param _windDirectionDegrees  [String], String representing the wind direction in degrees information for this days weather.
-        *  @param _windSpeed             [String], String representing the wind speed information for this days weather.
-        *  @param _dayTemperature        [String], String representing the day temperature information for this days weather.
-        *  @param _eveningTemperature    [String], String representing the evening temperature information for this days weather.
-        *  @param _morningTemperature    [String], String representing the morning temperature information for this days weather.
-        *  @param _nighttemperature      [String], String representing the night temperature information for this days weather.
-        *  @param _maxTemperature        [String], String representing the max temperature information for this days weather.
-        *  @param _minTemperature        [String], String representing the min temperature information for this days weather.
-        *  @param _pressure              [String], String representing the pressure information for this days weather.
-        *  @param _humidity              [String], String representing the humidity percentage information for this days weather.
-        *  @param _cloudPercentage       [String], String representing the cloud coverage percentage information for this days weather.
-        *
-        */
-       public DayWeather(String _date,
-                                                                               String _weatherCondition,
-                                                                               String _windDirection,
-                                                                               String _windDirectionDegrees,
-                                                                               String _windSpeed,
-                                                                               String _dayTemperature,
-                                                                               String _eveningTemperature,
-                                                                               String _morningTemperature,
-                                                                               String _nighttemperature,
-                                                                               String _maxTemperature,
-                                                                               String _minTemperature,
-                                                                               String _pressure,
-                                                                               String _humidity,
-                                                                               String _cloudPercentage) {
-
-               SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
-               try {
-                       date = formatter.parse(_date);
-               } catch (ParseException e) {
-                       e.printStackTrace();
-               }
-
-               weatherCondition = getWeatherConditionForCode(Integer.parseInt(_weatherCondition));
-
-               // Wind Variable
-               windDirection = _windDirection;
-               windDirectionDegrees = Integer.parseInt(_windDirectionDegrees);
-               windSpeed = Float.parseFloat(_windSpeed);
-
-               // Temperature Information
-               dayTemperature = Float.parseFloat(_dayTemperature);
-               eveningTemperature = Float.parseFloat(_eveningTemperature);
-               morningTemperature = Float.parseFloat(_morningTemperature);
-               nightTemperature = Float.parseFloat(_nighttemperature);
-               maxTemperature = Float.parseFloat(_maxTemperature);
-               minTemperature = Float.parseFloat(_minTemperature);
-
-               // Other Information
-               pressure = Float.parseFloat(_pressure);
-               humidity = Float.parseFloat(_humidity);
-               cloudPercentage = Float.parseFloat(_cloudPercentage);
-       }
-
-
-       /** Method to get the date for this weather object.
-        *
-        *   @return [Date] Date and time for this weather object.
-        */
-       public Date getDate() {
-               return date;
-       }
-
-
-       /** Method to get the wind direction text (N,NE,S,EXT).
-        *
-        *   @return [String] Wind direction in compass text.
-        */
-       public String getWindDirection() {
-               return windDirection;
-       }
-
-
-       /** Method to get the wind direction in degrees.
-        *
-        *   @return [int] Wind direction in degrees.
-        */
-       public int getWindDirectionDegrees() {
-               return windDirectionDegrees;
-       }
-
-
-       /** Method to get the wind speed in miles per hour.
-        *
-        *   @return [float] Wind speed in miles per hour.
-        */
-       public float getWindSpeed() {
-               return windSpeed;
-       }
-
-
-       /** Method to get the temperature during the day.
-        *
-        *   @return [float] Temperature in degrees F.
-        */
-       public float getDayTemperature() {
-               return dayTemperature;
-       }
-
-       /** Method to get the temperature during the evening.
-        *
-        *   @return [float] Temperature in degrees F.
-        */
-       public float getEveningTemperature() {
-               return eveningTemperature;
-       }
-
-
-       /** Method to get the temperature during the morning.
-        *
-        *   @return [float] Temperature in degrees F.
-        */
-       public float getMorningTemperature() {
-               return morningTemperature;
-       }
-
-
-       /** Method to get the temperature during the night.
-        *
-        *   @return [float] Temperature in degrees F.
-        */
-       public float getNighttemperature() {
-               return nightTemperature;
-       }
-
-
-       /** Method to get the max temperature.
-        *
-        *   @return [float] Temperature in degrees F.
-        */
-       public float getMaxTemperature() {
-               return maxTemperature;
-       }
-
-
-       /** Method to get the min temperature.
-        *
-        *   @return [float] Temperature in degrees F.
-        */
-       public float getMinTemperature() {
-               return minTemperature;
-       }
-
-
-       /** Method to get the pressure.
-        *
-        *   @return [float] Pressure in hPa.
-        */
-       public float getPressure() {
-               return pressure;
-       }
-
-
-       /** Method to get the humidity.
-        *
-        *   @return [float] Humidity percentage.
-        */
-       public float getHumidity() {
-               return humidity;
-       }
-
-
-       /** Method to get the cloud coverage percentage.
-        *
-        *   @return [float] Cloud coverage percentage.
-        */
-       public float getCloudPercentage() {
-               return cloudPercentage;
-       }
-
-
-       /** Method to check if this day is a wet day such as rain or something
-        *
-        *   @return [float] Cloud coverage percentage.
-        */
-       public boolean getIsWetDay() {
-               if ((weatherCondition == WeatherConditions.THUNDERSTORM_WITH_LIGHT_RAIN) ||
-                               (weatherCondition == WeatherConditions.THUNDERSTORM_WITH_RAIN) ||
-                               (weatherCondition == WeatherConditions.THUNDERSTORM_WITH_HEAVY_RAIN) ||
-                               (weatherCondition == WeatherConditions.LIGHT_THUNDERSTORM) ||
-                               (weatherCondition == WeatherConditions.THUNDERSTORM) ||
-                               (weatherCondition == WeatherConditions.HEAVY_THUNDERSTORM) ||
-                               (weatherCondition == WeatherConditions.RAGGED_THUNDERSTORM) ||
-                               (weatherCondition == WeatherConditions.THUNDERSTORM_WITH_LIGHT_DRIZZLE) ||
-                               (weatherCondition == WeatherConditions.THUNDERSTORM_WITH_DRIZZLE) ||
-                               (weatherCondition == WeatherConditions.THUNDERSTORM_WITH_HEAVY_DRIZZLE) ||
-                               (weatherCondition == WeatherConditions.LIGHT_INTENSITY_DRIZZLE) ||
-                               (weatherCondition == WeatherConditions.DRIZZLE) ||
-                               (weatherCondition == WeatherConditions.HEAVY_INTENSITY_DRIZZLE) ||
-                               (weatherCondition == WeatherConditions.LIGHT_INTENSITY_DRIZZLE_RAIN) ||
-                               (weatherCondition == WeatherConditions.DRIZZLE_RAIN) ||
-                               (weatherCondition == WeatherConditions.HEAVY_INTENSITY_DRIZZLE_RAIN) ||
-                               (weatherCondition == WeatherConditions.SHOWER_RAIN_AND_DRIZZLE) ||
-                               (weatherCondition == WeatherConditions.HEAVY_SHOWER_RAIN_AND_DRIZZLE) ||
-                               (weatherCondition == WeatherConditions.SHOWER_DRIZZLE) ||
-                               (weatherCondition == WeatherConditions.LIGHT_RAIN) ||
-                               (weatherCondition == WeatherConditions.MODERATE_RAIN) ||
-                               (weatherCondition == WeatherConditions.HEAVY_INTENSITY_RAIN) ||
-                               (weatherCondition == WeatherConditions.VERY_HEAVY_RAIN) ||
-                               (weatherCondition == WeatherConditions.EXTREME_RAIN) ||
-                               (weatherCondition == WeatherConditions.FREEZING_RAIN) ||
-                               (weatherCondition == WeatherConditions.LIGHT_INTENSITY_SHOWER_RAIN) ||
-                               (weatherCondition == WeatherConditions.SHOWER_RAIN) ||
-                               (weatherCondition == WeatherConditions.HEAVY_INTENSITY_SHOWER_RAIN) ||
-                               (weatherCondition == WeatherConditions.RAGGED_SHOWER_RAIN) ||
-                               (weatherCondition == WeatherConditions.SHOWER_SLEET) ||
-                               (weatherCondition == WeatherConditions.LIGHT_RAIN_AND_SNOW) ||
-                               (weatherCondition == WeatherConditions.RAIN_AND_SNOW) ||
-                               (weatherCondition == WeatherConditions.LIGHT_SHOWER_SNOW) ||
-                               (weatherCondition == WeatherConditions.SHOWER_SNOW) ||
-                               (weatherCondition == WeatherConditions.HEAVY_SHOWER_SNOW) ||
-                               (weatherCondition == WeatherConditions.TORNADO) ||
-                               (weatherCondition == WeatherConditions.TROPICAL_STORM) ||
-                               (weatherCondition == WeatherConditions.WINDY) ||
-                               (weatherCondition == WeatherConditions.HAIL) ||
-                               (weatherCondition == WeatherConditions.STORM) ||
-                               (weatherCondition == WeatherConditions.VIOLENT_STORM) ||
-                               (weatherCondition == WeatherConditions.HURRICANE)) {
-                       return true;
-               }
-               return false;
-       }
-
-
-       /** Method to get the string representation of this object.
-        *
-        *   @return [String] String representation of this object.
-        */
-       public String toString() {
-               String retString = "";
-               SimpleDateFormat df = new SimpleDateFormat("MM/dd/yyyy");
-               retString += "Forcast for day: " + df.format(date) + "\n";
-               retString += "\t" + "Weather Condition:" + "\n";
-               retString += "\t\t" + "Weather Condition: " + getStringforWeatherCondition(weatherCondition) + "\n";
-
-               // Wind information to string
-               retString += "\t" + "Wind Information:" + "\n";
-               retString += "\t\t" + "Wind Direction (Text)   : " + windDirection + "\n";
-               retString += "\t\t" + "Wind Direction (Degrees): " + Integer.toString(windDirectionDegrees) + "\n";
-               retString += "\t\t" + "Wind Speed (mph)        : " + Float.toString(windSpeed) + "\n";
-
-               // Temperature information to string
-               retString += "\t" + "Temperature Information:" + "\n";
-               retString += "\t\t" + "Day Temperature (Degrees F)     : " + Float.toString(dayTemperature) + "\n";
-               retString += "\t\t" + "Evening Temperature (Degrees F) : " + Float.toString(eveningTemperature) + "\n";
-               retString += "\t\t" + "Morning Temperature (Degrees F) : " + Float.toString(morningTemperature) + "\n";
-               retString += "\t\t" + "Night Temperature (Degrees F)   : " + Float.toString(nightTemperature) + "\n";
-               retString += "\t\t" + "Max Temperature (Degrees F)     : " + Float.toString(maxTemperature) + "\n";
-               retString += "\t\t" + "Min Temperature (Degrees F)     : " + Float.toString(minTemperature) + "\n";
-
-               // Other information to string
-               retString += "\t" + "Other Information:" + "\n";
-               retString += "\t\t" + "Pressure (hPa)     : " + Float.toString(pressure) + "\n";
-               retString += "\t\t" + "Humidity (Percentage)     : " + Float.toString(humidity) + "\n";
-               retString += "\t\t" + "Cloud Coverage (Percentage)     : " + Float.toString(cloudPercentage) + "\n";
-
-
-               return retString;
-       }
-
-
-       /*******************************************************************************************************************************************
-       **
-       **  Helper Methods
-       **
-       *******************************************************************************************************************************************/
-
-       /** Method get the string representation of the weather condition for display.
-        *
-        *   @param cond [WeatherConditions], weather condition code.
-        *
-        *   @return [String] String representation of the weather condition.
-        */
-       private String getStringforWeatherCondition(WeatherConditions cond) {
-               switch (cond) {
-               case THUNDERSTORM_WITH_LIGHT_RAIN:
-                       return "THUNDERSTORM_WITH_LIGHT_RAIN";
-
-               case THUNDERSTORM_WITH_RAIN:
-                       return "THUNDERSTORM_WITH_RAIN";
-
-               case THUNDERSTORM_WITH_HEAVY_RAIN:
-                       return "THUNDERSTORM_WITH_HEAVY_RAIN";
-
-               case LIGHT_THUNDERSTORM:
-                       return "LIGHT_THUNDERSTORM";
-
-               case THUNDERSTORM:
-                       return "THUNDERSTORM";
-
-               case HEAVY_THUNDERSTORM:
-                       return "HEAVY_THUNDERSTORM";
-
-               case RAGGED_THUNDERSTORM:
-                       return "RAGGED_THUNDERSTORM";
-
-               case THUNDERSTORM_WITH_LIGHT_DRIZZLE:
-                       return "THUNDERSTORM_WITH_LIGHT_DRIZZLE";
-
-               case THUNDERSTORM_WITH_DRIZZLE:
-                       return "THUNDERSTORM_WITH_DRIZZLE";
-
-               case THUNDERSTORM_WITH_HEAVY_DRIZZLE:
-                       return "THUNDERSTORM_WITH_HEAVY_DRIZZLE";
-
-               case LIGHT_INTENSITY_DRIZZLE:
-                       return "LIGHT_INTENSITY_DRIZZLE";
-
-               case DRIZZLE:
-                       return "DRIZZLE";
-
-               case HEAVY_INTENSITY_DRIZZLE:
-                       return "HEAVY_INTENSITY_DRIZZLE";
-
-               case LIGHT_INTENSITY_DRIZZLE_RAIN:
-                       return "LIGHT_INTENSITY_DRIZZLE_RAIN";
-
-               case DRIZZLE_RAIN:
-                       return "DRIZZLE_RAIN";
-
-               case HEAVY_INTENSITY_DRIZZLE_RAIN:
-                       return "HEAVY_INTENSITY_DRIZZLE_RAIN";
-
-               case SHOWER_RAIN_AND_DRIZZLE:
-                       return "SHOWER_RAIN_AND_DRIZZLE";
-
-               case HEAVY_SHOWER_RAIN_AND_DRIZZLE:
-                       return "HEAVY_SHOWER_RAIN_AND_DRIZZLE";
-
-               case SHOWER_DRIZZLE:
-                       return "SHOWER_DRIZZLE";
-
-               case LIGHT_RAIN:
-                       return "LIGHT_RAIN";
-
-               case MODERATE_RAIN:
-                       return "MODERATE_RAIN";
-
-               case HEAVY_INTENSITY_RAIN:
-                       return "HEAVY_INTENSITY_RAIN";
-
-               case VERY_HEAVY_RAIN:
-                       return "VERY_HEAVY_RAIN";
-
-               case EXTREME_RAIN:
-                       return "EXTREME_RAIN";
-
-               case FREEZING_RAIN:
-                       return "FREEZING_RAIN";
-
-               case LIGHT_INTENSITY_SHOWER_RAIN:
-                       return "LIGHT_INTENSITY_SHOWER_RAIN";
-
-               case SHOWER_RAIN:
-                       return "SHOWER_RAIN";
-
-               case HEAVY_INTENSITY_SHOWER_RAIN:
-                       return "HEAVY_INTENSITY_SHOWER_RAIN";
-
-               case RAGGED_SHOWER_RAIN:
-                       return "RAGGED_SHOWER_RAIN";
-
-               case LIGHT_SNOW:
-                       return "LIGHT_SNOW";
-
-               case SNOW:
-                       return "SNOW";
-
-               case HEAVY_SNOW:
-                       return "HEAVY_SNOW";
-
-               case SLEET:
-                       return "SLEET";
-
-               case SHOWER_SLEET:
-                       return "SHOWER_SLEET";
-
-               case LIGHT_RAIN_AND_SNOW:
-                       return "LIGHT_RAIN_AND_SNOW";
-
-               case RAIN_AND_SNOW:
-                       return "RAIN_AND_SNOW";
-
-               case LIGHT_SHOWER_SNOW:
-                       return "LIGHT_SHOWER_SNOW";
-
-               case SHOWER_SNOW:
-                       return "SHOWER_SNOW";
-
-               case HEAVY_SHOWER_SNOW:
-                       return "HEAVY_SHOWER_SNOW";
-
-               case MIST:
-                       return "MIST";
-
-               case SMOKE:
-                       return "SMOKE";
-
-               case HAZE:
-                       return "HAZE";
-
-               case SAND_DUST_WHIRLS:
-                       return "SAND_DUST_WHIRLS";
-
-               case FOG:
-                       return "FOG";
-
-               case SAND:
-                       return "SAND";
-
-               case DUST:
-                       return "DUST";
-
-               case VOLCANIC_ASH:
-                       return "VOLCANIC_ASH";
-
-               case SQUALLS:
-                       return "SQUALLS";
-
-               case TORNADO:
-                       return "TORNADO";
-
-               case CLEAR_SKY:
-                       return "CLEAR_SKY";
-
-               case FEW_CLOUDS:
-                       return "FEW_CLOUDS";
-
-               case SCATTERED_CLOUDS:
-                       return "SCATTERED_CLOUDS";
-
-               case BROKEN_CLOUDS:
-                       return "BROKEN_CLOUDS";
-
-               case OVERCAST_CLOUDS:
-                       return "OVERCAST_CLOUDS";
-
-               case TROPICAL_STORM:
-                       return "TROPICAL_STORM";
-
-               case HURRICANE:
-                       return "HURRICANE";
-
-               case COLD:
-                       return "COLD";
-
-               case HOT:
-                       return "HOT";
-
-               case WINDY:
-                       return "WINDY";
-
-               case HAIL:
-                       return "HAIL";
-
-               case CALM:
-                       return "CALM";
-
-               case LIGHT_BREEZE:
-                       return "LIGHT_BREEZE";
-
-               case GENTLE_BREEZE:
-                       return "GENTLE_BREEZE";
-
-               case MODERATE_BREEZE:
-                       return "MODERATE_BREEZE";
-
-               case FRESH_BREEZE:
-                       return "FRESH_BREEZE";
-
-               case STRONG_BREEZE:
-                       return "STRONG_BREEZE";
-
-               case HIGH_WIND_NEAR_GALE:
-                       return "HIGH_WIND_NEAR_GALE";
-
-               case GALE:
-                       return "GALE";
-
-               case SEVERE_GALE:
-                       return "SEVERE_GALE";
-
-               case STORM:
-                       return "STORM";
-
-               case VIOLENT_STORM:
-                       return "VIOLENT_STORM";
-
-               default:
-                       return "UNKNOWN";
-               }
-       }
-
-
-       /** Method to change the weather condition code into a WeatherConditions enum type
-        *
-        *   @param cond [int], weather condition code.
-        *
-        *   @return [WeatherConditions] weather conditions enum type.
-        */
-       private WeatherConditions getWeatherConditionForCode(int code) {
-               switch (code) {
-               case 200:
-                       return WeatherConditions.THUNDERSTORM_WITH_LIGHT_RAIN;
-
-               case 201:
-                       return WeatherConditions.THUNDERSTORM_WITH_RAIN;
-
-               case 202:
-                       return WeatherConditions.THUNDERSTORM_WITH_HEAVY_RAIN;
-
-               case 210:
-                       return WeatherConditions.LIGHT_THUNDERSTORM;
-
-               case 211:
-                       return WeatherConditions.THUNDERSTORM;
-
-               case 212:
-                       return WeatherConditions.HEAVY_THUNDERSTORM;
-
-               case 221:
-                       return WeatherConditions.RAGGED_THUNDERSTORM;
-
-               case 230:
-                       return WeatherConditions.THUNDERSTORM_WITH_LIGHT_DRIZZLE;
-
-               case 231:
-                       return WeatherConditions.THUNDERSTORM_WITH_DRIZZLE;
-
-               case 232:
-                       return WeatherConditions.THUNDERSTORM_WITH_HEAVY_DRIZZLE;
-
-               case 300:
-                       return WeatherConditions.LIGHT_INTENSITY_DRIZZLE;
-
-               case 301:
-                       return WeatherConditions.DRIZZLE;
-
-               case 302:
-                       return WeatherConditions.HEAVY_INTENSITY_DRIZZLE;
-
-               case 310:
-                       return WeatherConditions.LIGHT_INTENSITY_DRIZZLE_RAIN;
-
-               case 311:
-                       return WeatherConditions.DRIZZLE_RAIN;
-
-               case 312:
-                       return WeatherConditions.HEAVY_INTENSITY_DRIZZLE_RAIN;
-
-               case 313:
-                       return WeatherConditions.SHOWER_RAIN_AND_DRIZZLE;
-
-               case 314:
-                       return WeatherConditions.HEAVY_SHOWER_RAIN_AND_DRIZZLE;
-
-               case 321:
-                       return WeatherConditions.SHOWER_DRIZZLE;
-
-               case 500:
-                       return WeatherConditions.LIGHT_RAIN;
-
-               case 501:
-                       return WeatherConditions.MODERATE_RAIN;
-
-               case 502:
-                       return WeatherConditions.HEAVY_INTENSITY_RAIN;
-
-               case 503:
-                       return WeatherConditions.VERY_HEAVY_RAIN;
-
-               case 504:
-                       return WeatherConditions.EXTREME_RAIN;
-
-               case 511:
-                       return WeatherConditions.FREEZING_RAIN;
-
-               case 520:
-                       return WeatherConditions.LIGHT_INTENSITY_SHOWER_RAIN;
-
-               case 521:
-                       return WeatherConditions.SHOWER_RAIN;
-
-               case 522:
-                       return WeatherConditions.HEAVY_INTENSITY_SHOWER_RAIN;
-
-               case 531:
-                       return WeatherConditions.RAGGED_SHOWER_RAIN;
-
-               case 600:
-                       return WeatherConditions.LIGHT_SNOW;
-
-               case 601:
-                       return WeatherConditions.SNOW;
-
-               case 602:
-                       return WeatherConditions.HEAVY_SNOW;
-
-               case 611:
-                       return WeatherConditions.SLEET;
-
-               case 612:
-                       return WeatherConditions.SHOWER_SLEET;
-
-               case 615:
-                       return WeatherConditions.LIGHT_RAIN_AND_SNOW;
-
-               case 616:
-                       return WeatherConditions.RAIN_AND_SNOW;
-
-               case 620:
-                       return WeatherConditions.LIGHT_SHOWER_SNOW;
-
-               case 621:
-                       return WeatherConditions.SHOWER_SNOW;
-
-               case 622:
-                       return WeatherConditions.HEAVY_SHOWER_SNOW;
-
-               case 701:
-                       return WeatherConditions.MIST;
-
-               case 711:
-                       return WeatherConditions.SMOKE;
-
-               case 721:
-                       return WeatherConditions.HAZE;
-
-               case 731:
-                       return WeatherConditions.SAND_DUST_WHIRLS;
-
-               case 741:
-                       return WeatherConditions.FOG;
-
-               case 751:
-                       return WeatherConditions.SAND;
-
-               case 761:
-                       return WeatherConditions.DUST;
-
-               case 762:
-                       return WeatherConditions.VOLCANIC_ASH;
-
-               case 771:
-                       return WeatherConditions.SQUALLS;
-
-               case 781:
-                       return WeatherConditions.TORNADO;
-
-               case 800:
-                       return WeatherConditions.CLEAR_SKY;
-
-               case 801:
-                       return WeatherConditions.FEW_CLOUDS;
-
-               case 802:
-                       return WeatherConditions.SCATTERED_CLOUDS;
-
-               case 803:
-                       return WeatherConditions.BROKEN_CLOUDS;
-
-               case 804:
-                       return WeatherConditions.OVERCAST_CLOUDS;
-
-               case 900:
-                       return WeatherConditions.TORNADO;
-
-               case 901:
-                       return WeatherConditions.TROPICAL_STORM;
-
-               case 902:
-                       return WeatherConditions.HURRICANE;
-
-               case 903:
-                       return WeatherConditions.COLD;
-
-               case 904:
-                       return WeatherConditions.HOT;
-
-               case 905:
-                       return WeatherConditions.WINDY;
-
-               case 906:
-                       return WeatherConditions.HAIL;
-
-               case 951:
-                       return WeatherConditions.CALM;
-
-               case 952:
-                       return WeatherConditions.LIGHT_BREEZE;
-
-               case 953:
-                       return WeatherConditions.GENTLE_BREEZE;
-
-               case 954:
-                       return WeatherConditions.MODERATE_BREEZE;
-
-               case 955:
-                       return WeatherConditions.FRESH_BREEZE;
-
-               case 956:
-                       return WeatherConditions.STRONG_BREEZE;
-
-               case 957:
-                       return WeatherConditions.HIGH_WIND_NEAR_GALE;
-
-               case 958:
-                       return WeatherConditions.GALE;
-
-               case 959:
-                       return WeatherConditions.SEVERE_GALE;
-
-               case 960:
-                       return WeatherConditions.STORM;
-
-               case 961:
-                       return WeatherConditions.VIOLENT_STORM;
-
-               case 962:
-                       return WeatherConditions.HURRICANE;
-
-               default:
-                       return WeatherConditions.UNKNOWN;
-               }
-       }
-}
\ No newline at end of file
diff --git a/benchmarks/IrrigationController/IrrigationController.config b/benchmarks/IrrigationController/IrrigationController.config
deleted file mode 100644 (file)
index a53b2c1..0000000
+++ /dev/null
@@ -1 +0,0 @@
-ADDITIONAL_ZIP_FILE=Yes
diff --git a/benchmarks/IrrigationController/IrrigationController.java b/benchmarks/IrrigationController/IrrigationController.java
deleted file mode 100644 (file)
index c06646f..0000000
+++ /dev/null
@@ -1,528 +0,0 @@
-package IrrigationController;
-// Standard Java Packages
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-
-// RMI packages
-import java.rmi.RemoteException;
-import java.rmi.server.UnicastRemoteObject;
-
-// IoT Runtime Packages
-import iotruntime.slave.IoTSet;
-import iotruntime.slave.IoTRelation;
-import iotruntime.slave.IoTAddress;
-import iotcode.annotation.*;
-
-// IoT Driver Packages
-import iotcode.interfaces.*;
-import iotcode.WeatherPhoneGateway.*;
-
-public class IrrigationController extends UnicastRemoteObject implements WeatherGatewayCallback {
-
-
-       /*******************************************************************************************************************************************
-       **
-       **  Constants
-       **
-       *******************************************************************************************************************************************/
-       // private static final int NUMBER_OF_TIMES_PER_WEEK_TO_WATER = 2;
-       //TODO: Change these back to normal - this is just for testing to make it awake all the time
-//     private static final int TIME_HOURS_TO_WATER_GRASS = 7;         // 7 am
-       private static final int TIME_HOURS_TO_WATER_GRASS = 3;
-//     private static final int TIME_MINUTES_TO_WATER_GRASS = 30;      // 30 minutes
-       private static final int TIME_MINUTES_TO_WATER_GRASS = 30;
-//     private static final int TIME_TO_RECOVER_GRASS_FOR = 8 * 24 * 60 * 60;  // 8 days
-       private static final int TIME_TO_RECOVER_GRASS_FOR = 10;
-//     private static final int TIME_TO_HIBERNATE_GRASS_FOR = 30 * 24 * 60 * 60;               // 30 days
-       private static final int TIME_TO_HIBERNATE_GRASS_FOR = 10;
-       public static final int CAMERA_FPS = 15;                                                                                                        // In frames per second
-
-
-       /*******************************************************************************************************************************************
-       **
-       **  Variables
-       **
-       *******************************************************************************************************************************************/
-       private int dayOfLastCheck = -1;
-       private int monthOfLastCheck = -1;
-       private boolean isInHibernationRecoveryMode = false;
-       private Date hibernationRecoveryModeStartDate = null;
-       private boolean isHibernationMode = false;
-       private Date hibernationModeStartDate = null;
-       private List<LawnState> lawns = new ArrayList<LawnState>();
-       private WeatherGrabber weatherGrabber = null;
-
-       // used to block until gui is done and the settings are ready to be polled
-       private AtomicBoolean waitingForInterface = new AtomicBoolean(true);
-
-       // the settings from the interface, used to setup the system
-       private double inchesPerWeek = 0;
-       private int weatherZipCode = 0;
-       private int daysToWaterOn = 0;
-       private List<Double> inchesPerMinute;
-
-       private static int sensorId = 0;
-
-       /*******************************************************************************************************************************************
-       **
-       **  IoT Sets and Relations
-       **
-       *******************************************************************************************************************************************/
-       @config private IoTSet<IoTAddress> weatherDataAddresses;
-       @config private IoTSet<IoTAddress> weatherDataAddressMain;
-       @config private IoTSet<WeatherGatewaySmart> gwSet;
-       @config private IoTSet<LawnSmart> lawnSet;
-       @config private IoTSet<MoistureSensorSmart> moistureSensorsSet;
-       @config private IoTSet<CameraSmart> cameraSet;
-       @config private IoTRelation<LawnSmart, CameraSmart> lawnCameraRelation;
-       @config private IoTRelation<LawnSmart, SprinklerSmart> lawnSprinklerRelation;
-       @config private IoTRelation<LawnSmart, MoistureSensorSmart> lawnMoistureSensorRelation;
-
-
-       public IrrigationController() throws RemoteException {
-
-       }
-
-       /*******************************************************************************************************************************************
-       **
-       **  Public Methods
-       **
-       *******************************************************************************************************************************************/
-
-
-       /** Method to set whether the controller should maintain the lawns in hibernation mode
-        *   or in normal mode.  Lawns should be put in hibernation mode in drought conditions
-        *
-        *   @param _hibMode [boolean] set the hibernation mode for this lawn controllers (true = hibernation)
-        *
-        *   @return [void] None.
-        */
-       public void setHibernationMode(boolean _hibMode) {
-
-               // change hibernation mode status
-               isHibernationMode = _hibMode;
-
-               // set the start date for when we started this hibernation mode
-               if (_hibMode) {
-
-                       // make sure we dont reset this cycle
-                       if (!isHibernationMode) {
-                               hibernationModeStartDate = new Date();
-                       }
-               } else {
-                       // reset all hibernation stuff
-                       hibernationModeStartDate = null;
-                       isInHibernationRecoveryMode = false;
-                       hibernationRecoveryModeStartDate = null;
-               }
-       }
-
-       /** Method to start the controller and run the main control loop
-        *
-        *   @return [void] None.
-        */
-       public void init() throws RemoteException {
-
-               // initialize the controller
-               initController();
-               System.out.println("Initialized controller!");
-
-               // Main Loop
-               while (true) {
-
-                       // get the current time of day (date and time)
-                       Date currentDate = new Date();
-
-                       // get the epoch time till the beginning of the day
-                       Date beginingOfToday = new Date(currentDate.getYear(), currentDate.getMonth(), currentDate.getDate());
-
-                       // calculate the seconds since the start of the day.
-                       long secondsSinceStartOfDay = (currentDate.getTime() - beginingOfToday.getTime()) / 1000;
-
-                       // Seconds since the start of the day to start the watering
-                       long secondsForWateringStart = (TIME_HOURS_TO_WATER_GRASS * 3600) + (TIME_MINUTES_TO_WATER_GRASS * 60);
-
-//                     System.out.println("beginingOfToday " + beginingOfToday);
-//                     System.out.println("secondsSinceStartOfDay " + secondsSinceStartOfDay);
-//                     System.out.println("secondsForWateringStart " + secondsForWateringStart);
-
-                       // check if the current time is within the start watering interval
-                       /*if ((secondsSinceStartOfDay < secondsForWateringStart) || (secondsSinceStartOfDay > (secondsForWateringStart + (60 * 60)))) {
-                               System.out.println("Sleep for 10 minutes.. ");
-                               try {
-                                       //Thread.sleep(10 * 60 * 1000);                                         // sleep for 10 minutes
-                                       Thread.sleep(10);                                               // sleep for 10 seconds
-                               } catch (Exception e) {
-                                       e.printStackTrace();
-                               }
-
-                               continue;
-                       }*/
-
-                       // check if we already checked if we should water today
-                       // we only need to do this once per day
-                       /*if ((dayOfLastCheck == currentDate.getDate()) && (monthOfLastCheck == currentDate.getMonth())) {
-                               System.out.println("Sleep for 1 hour...");
-                               try {
-                                       Thread.sleep(60 * 60 * 1000);                                           // sleep for an hour
-                               } catch (Exception e) {
-                                       e.printStackTrace();
-                               }
-
-                               continue;
-                       }*/
-
-                       // we decided to check if we should water today so save the fact that we chose to water on this day
-                       dayOfLastCheck = currentDate.getDate();
-                       monthOfLastCheck = currentDate.getMonth();
-
-                       // update the lawn states everyday
-                       for (LawnState ls : lawns) {
-                               ls.updateLawn(currentDate);
-                       }
-                       // check if we are in hibernation mode and do the correct loop action
-                       if (isHibernationMode) {
-//                             System.out.println("Hibernation mode!");
-                               // If we are in hibernation mode then use the hibernation loop code
-                               wateringHibernationLoop(currentDate);
-                       } else {
-//                             System.out.println("Normal mode!");
-                               // Using the normal watering loop code
-                               wateringNormalLoop(currentDate);
-                       }
-               }
-       }
-
-
-       /** Callback method for when the information is retrieved.
-        *
-        * @param _inchesPerWeek [double].
-        * @param _weatherZipCode [int].
-        * @param _daysToWaterOn [int].
-        * @param _inchesPerMinute [double].
-        * @return [void] None.
-        */
-       public void informationRetrieved(double _inchesPerWeek, int _weatherZipCode, int _daysToWaterOn, double _inchesPerMinute) {
-
-               System.out.println("DEBUG: Information is retrieved from phone!!!");
-               /*try {
-                       // get the parameters that the interface (phone app) reads from the user
-                       inchesPerWeek = _wgw.getInchesPerWeek();
-                       weatherZipCode = _wgw.getWeatherZipCode();
-                       daysToWaterOn = _wgw.getDaysToWaterOn();
-                       inchesPerMinute.add(_wgw.getInchesPerMinute());
-               } catch(RemoteException ex) {
-                       ex.printStackTrace();
-               }*/
-
-               inchesPerWeek = _inchesPerWeek;
-               weatherZipCode = _weatherZipCode;
-               daysToWaterOn = _daysToWaterOn;
-               inchesPerMinute.add(_inchesPerMinute);
-
-               // the gui is done so release the spin wait that was waiting for the gui
-               waitingForInterface.set(false);
-       }
-
-       /*******************************************************************************************************************************************
-       **
-       **  Helper Methods
-       **
-       *******************************************************************************************************************************************/
-
-
-       /** Method to initialize the controller variables and all the drivers and such
-        *
-        *   @return [void] None.
-        */
-       private void initController() throws RemoteException {
-
-               // Setup the weather grabber object with the correct address of the weather api
-               Iterator it = weatherDataAddresses.iterator();
-               weatherGrabber = new WeatherGrabber((IoTAddress)it.next());
-
-               // Initialize inchesPerMinute
-               inchesPerMinute = new ArrayList<Double>();
-
-               // We setup a Gateway object to get information from the phone app
-               for (WeatherGatewaySmart gw : gwSet.values()) {
-                       gw.init();
-                       gw.registerCallback(this);
-                       gw.start();
-               }
-
-               System.out.println("DEBUG: Waiting for phone to send weather information");
-               while (waitingForInterface.get()) {
-                       try {
-                               Thread.sleep(1000);
-                       } catch (Exception e) {
-                               e.printStackTrace();
-                       }
-               }
-               // TODO: Use a phone input interface later
-               //inchesPerWeek = 20.00;
-               //weatherZipCode = 92612;
-               //daysToWaterOn = 255;
-               //inchesPerMinute.add(1.50);
-
-               System.out.println("DEBUG: inchesPerWeek: " + inchesPerWeek);
-               System.out.println("DEBUG: weatherZipCode: " + weatherZipCode);
-               System.out.println("DEBUG: daysToWaterOn: " + daysToWaterOn);
-               System.out.println("DEBUG: inchesPerMinute: " + inchesPerMinute.get(0));
-
-               // set the zip code and the the number of days of the weather grabber
-               // here the number of days is set to the max that the grabber supports
-               weatherGrabber.setZipcode(weatherZipCode);
-               weatherGrabber.setNumberOfDays(16);
-
-               // Setup the cameras, start them all and assign each one a motion detector
-               for (CameraSmart cam : cameraSet.values()) {
-                       //try {
-                               // initialize the camera, might need to setup some stuff internally
-                               cam.init();
-
-                               // set the camera parameters.
-                               cam.setFPS(CAMERA_FPS);
-                               cam.setResolution(Resolution.RES_VGA);
-
-                               // Start the camera (example is start the HTTP stream if it is a network camera)
-                               cam.start();
-                               System.out.println("DEBUG: Init camera! " + cam.toString());
-                       //} catch (RemoteException e) {
-                       //      e.printStackTrace();
-                       //}
-
-               }
-
-               // counter so that we can match the lawn inches per min data with the specific lawn
-               int counter = 0;
-               for (LawnSmart l : lawnSet.values()) {
-                       // create a motionDetector for each lawn object
-                       MotionDetection mo = new MotionDetection(12, 0.5f, 10, 10);
-
-                       // for 1 camera, if there are any then register the camera for that lawn
-                       HashSet<CameraSmart> cameras = lawnCameraRelation.get(l);
-                       System.out.println("DEBUG: Camera.size(): " + cameras.size());
-                       if (cameras.size() >= 1) {
-
-                               // we only need 1 camera per lawn so get the first one in the list
-                               Iterator camIt = cameras.iterator();
-                               CameraSmart cam = (CameraSmart)camIt.next();
-                               System.out.println("DEBUG: Registering callback to camera: " + cam.toString());
-                               //try {
-                                       // setup the callback
-                                       cam.registerCallback(mo);
-                               //} catch (RemoteException e) {
-                               //      e.printStackTrace();
-                               //}
-                       }
-
-                       // we also only need 1 sprinkler controller per lawn so grab the first one
-                       HashSet<SprinklerSmart> sprinklers = lawnSprinklerRelation.get(l);
-                       Iterator sprinklersIt = sprinklers.iterator();
-                       SprinklerSmart spr = (SprinklerSmart)sprinklersIt.next();
-
-                       // init the sprinkler controller, do it here since it only needs to be done once per controller
-                       try {
-                               spr.init();
-                       } catch (Exception e) {
-                               e.printStackTrace();
-                       }
-                       System.out.println("DEBUG: Init sprinkler: " + spr.toString());
-
-                       // get and init the moisture sensors for this specific lawn
-                       HashSet<MoistureSensorSmart> sensors = lawnMoistureSensorRelation.get(l);
-                       for (MoistureSensorSmart sen : sensors) {
-                               System.out.println("DEBUG: Init sensors: " + sen.toString());
-                               try {
-                                       sen.init();
-                                       sen.setId(sensorId++);
-                               } catch (Exception e) {
-                                       e.printStackTrace();
-                               }
-                       }
-
-                       // create the lawn objects
-                       System.out.println("DEBUG: Creating a LawnState object");
-                       LawnState ls = 
-                               new LawnState(l, daysToWaterOn, mo, inchesPerMinute.get(counter), inchesPerWeek, spr, counter, sensors);
-                       lawns.add(ls);
-
-                       // dont forget to increment the counter
-                       counter++;
-               }
-       }
-
-       /** Main loop for when the controller is watering the lawns under normal conditions, not in hibernation mode
-        *
-        *   @param _currentDate [Date] current date
-        *
-        *   @return [void] None.
-        */
-       private void wateringNormalLoop(Date _currentDate) {
-
-               // get the weather data for the next little bit
-               List<DayWeather> weatherData = weatherGrabber.getWeatherData();
-               // TODO: Replace this with the WeatherGrabber.getWeatherData() above
-//             List<DayWeather> weatherData = new ArrayList<DayWeather>();
-
-               // Go through each lawn and check if we should water it and if we should, water it
-               for (LawnState ls : lawns) {
-
-                       // water for specific lawn
-                       waterLawn(ls, _currentDate, weatherData);
-               }
-       }
-
-       /** Main loop for when the controller is watering the lawns in hibernation mode
-        *
-        *   @param _currentDate [Date] current date
-        *
-        *   @return [void] None.
-        */
-       private void wateringHibernationLoop(Date _currentDate) {
-
-               // if we are in recovery mode then run the recovery action
-               // we are still in hibernation mode but we need to recover the grass
-               if (isInHibernationRecoveryMode) {
-//                     System.out.println("DEBUG: Recovery mode!");
-                       hibernationRecoveryLoop(_currentDate);
-                       return;
-               }
-
-               // check if we should enter recovery mode
-               long elapsedTime = (_currentDate.getTime() - hibernationModeStartDate.getTime()) / 1000;
-               if (elapsedTime >= TIME_TO_HIBERNATE_GRASS_FOR) {
-
-                       // start recovery mode
-                       isInHibernationRecoveryMode = true;
-                       hibernationRecoveryModeStartDate = null;
-//                     System.out.println("DEBUG: We enter recovery mode for the first time!");
-                       // first cycle of recovery
-                       hibernationRecoveryLoop(_currentDate);
-                       return;
-               }
-
-               // get the weather data for the next little bit
-               List<DayWeather> weatherData = weatherGrabber.getWeatherData();
-
-               // Go through each lawn and check if we should water it and if we should, water it
-               for (LawnState ls : lawns) {
-
-                       boolean lawnHasMotion = ls.lawnHasSufficientMotion();
-
-                       // there is no motion on the lawn so no need to water it
-                       if (!lawnHasMotion) {
-                               continue;
-                       }
-//                     System.out.println("DEBUG: We water the lawn! (wateringHibernationLoop)");
-                       // water specific lawn since it has motion
-                       waterLawn(ls, _currentDate, weatherData);
-               }
-       }
-
-
-       /** Main loop for when the controller is watering the lawns in hibernation mode
-        *
-        *   @param _currentDate [Date] current date
-        *
-        *   @return [void] None.
-        */
-       private void hibernationRecoveryLoop(Date _currentDate) {
-
-               // start recovery mode if it wasnt started yet
-               if (hibernationRecoveryModeStartDate == null) {
-                       hibernationRecoveryModeStartDate = _currentDate;
-               }
-
-               // time since this mode was started
-               long elapsedTime = (_currentDate.getTime() - hibernationRecoveryModeStartDate.getTime()) / 1000;
-
-               // we have been in recovery mode long enough
-               if (elapsedTime >= TIME_TO_RECOVER_GRASS_FOR) {
-
-//                     System.out.println("DEBUG: We have been in recovery mode long enough!");
-                       // reset the recovery mode
-                       isInHibernationRecoveryMode = false;
-                       hibernationRecoveryModeStartDate = null;
-
-                       // revived grass so restart the grass hibernation cycle
-                       hibernationModeStartDate = _currentDate;
-
-                       // do the hibernation loop since we are no longer in recovery mode
-                       wateringHibernationLoop(_currentDate);
-                       return;
-               }
-
-
-               // if we got here then we are trying to recover the grass
-
-               // get the weather data for the next little bit
-               List<DayWeather> weatherData = weatherGrabber.getWeatherData();
-
-               // Go through each lawn and check if we should water it and if we should, water it
-               for (LawnState ls : lawns) {
-
-//                     System.out.println("DEBUG: We water the lawn! (hibernationRecoveryLoop)");
-                       // water specific lawn since it has motion
-                       waterLawn(ls, _currentDate, weatherData);
-               }
-
-       }
-
-
-       /** Method for watering a specific lawn if it needs to be watered
-        *
-        *   @param _ls [LawnState] lawn to water
-        *   @param _currentDate [Date] current date
-        *   @param _weatherData [List<DayWeather>] latest weather data
-        *
-        *   @return [void] None.
-        */
-       private void waterLawn(LawnState _ls, Date _currentDate,  List<DayWeather> _weatherData) {
-
-               // check if today or tomorrow is a wet day
-               boolean todayIsWetDay = _weatherData.get(0).getIsWetDay();
-               boolean tomorrowIsWetDay = _weatherData.get(1).getIsWetDay();
-               // TODO: Remove this later - hack the values for now!!!
-//             boolean todayIsWetDay = false;
-//             boolean tomorrowIsWetDay = false;
-
-               // lawn cannot wait anymore for water so water not
-               boolean lawnNeedsWaterNow = _ls.needsWateringUrgently(_currentDate);
-               if (lawnNeedsWaterNow) {
-                       System.out.println("DEBUG: Need water now!!!");
-                       System.out.println("DEBUG: Is wet day? " + todayIsWetDay);
-                       System.out.println("DEBUG: Tomorrow is wet day? " + tomorrowIsWetDay);
-                       // if it is not going to rain today then water the lawn
-                       // TODO: Put this back to uncommented!!! Only for testing!!!
-//                     if (!todayIsWetDay) {
-                               _ls.waterLawn(_currentDate);
-//                     }
-                       return;
-               }
-
-               // check if this lawn needs watering based on watering algoritm/sensors/ext
-               boolean shouldWaterLawn = _ls.needsWatering(_currentDate);
-
-               // should not water this lawn then just skip to the next lawn
-               if (!shouldWaterLawn) {
-                       return;
-               }
-
-               // it is going to rain soon so wait it out.
-               // Grass is not in critical condition so it can wait a bit.
-               if (todayIsWetDay || tomorrowIsWetDay) {
-                       return;
-               }
-
-               // if we got here then we need to water the lawn
-               _ls.waterLawn(_currentDate);
-       }
-}
-
diff --git a/benchmarks/IrrigationController/LawnSmart_Stub.java b/benchmarks/IrrigationController/LawnSmart_Stub.java
deleted file mode 100644 (file)
index 3e2043b..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-package IrrigationController;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Arrays;
-import iotrmi.Java.IoTRMICall;
-import iotrmi.Java.IoTRMIObject;
-
-import iotcode.interfaces.*;
-
-public class LawnSmart_Stub implements LawnSmart {
-
-       private IoTRMICall rmiCall;
-       private String callbackAddress;
-       private int[] ports;
-
-       private final static int objectId = 0;
-       
-
-       public LawnSmart_Stub(int _port, String _skeletonAddress, String _callbackAddress, int _rev, int[] _ports) throws Exception {
-               callbackAddress = _callbackAddress;
-               ports = _ports;
-               rmiCall = new IoTRMICall(_port, _skeletonAddress, _rev);
-       }
-
-}
diff --git a/benchmarks/IrrigationController/LawnState.java b/benchmarks/IrrigationController/LawnState.java
deleted file mode 100644 (file)
index 10ac4f0..0000000
+++ /dev/null
@@ -1,539 +0,0 @@
-package IrrigationController;
-
-// Standard Java Packages
-import java.util.Date;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantLock;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.Map;
-
-// RMI packages
-import java.rmi.RemoteException;
-import java.rmi.server.UnicastRemoteObject;
-
-// IoT Driver Packages
-import iotcode.interfaces.*;
-
-// Checker annotations
-//import iotchecker.qual.*;
-
-/** Class LawnState that represents the state of the lawn, also help calculate if the lawn needs to be watered.
- *
- * @author      Ali Younis <ayounis @ uci.edu>
- * @version     1.0
- * @since       2016-04-04
- */
-
-public class LawnState extends UnicastRemoteObject implements MotionDetectionCallback, MoistureSensorCallback {
-
-
-       /*******************************************************************************************************************************************
-       **
-       **  Constants
-       **
-       *******************************************************************************************************************************************/
-       private static final long MAX_TIME_BETWEEN_WATERING_SESSIONS = 4 * 24 * 60 * 60;        // 5 days
-       private static final int MAX_DAYS_RAINED_RECORD = 20;
-       private static final int RAINED_RECENTLY_DAYS_INTERVAL = 1;
-       private static final long TWENTY_FIVE_HOURS = 25 * 60 * 60;
-       private static final long TWO_HOURS = 2 * 60 * 60;
-
-       private static final long NEW_MOTION_THRESHOLD = 2 * 60;        // 2 minutes
-       private static final long AMOUNT_OF_MOTION_FOR_ACTIVE = 60 * 60;        // 1 hour
-       private static final long AMOUNT_OF_TIME_FOR_ACTIVE_TO_HOLD = 7 * 24 * 60 * 60;         // 1 week
-
-       private static final double MOISTURE_LEVEL_FOR_NORMAL_WATERING = 25;            // Percentage
-       private static final double MOISTURE_LEVEL_FOR_EMERGENCY_WATERING = 5;  // Percentage
-       private static final double MOISTURE_LEVEL_FOR_NO_WATERING = 80;        // Percentage
-
-       /*******************************************************************************************************************************************
-       **
-       **  Variables
-       **
-       *******************************************************************************************************************************************/
-       private boolean isInHibernationMode = false;
-       private Date lastTimeWatered = null;
-       private boolean didWaterSinceLastSchedualedDate = false;
-       private List<Date> daysRained = new ArrayList<Date>();
-       private int daysToWaterOn = 0;
-       private LawnSmart iotLawnObject;
-       private MotionDetection motionDetector;
-       private double inchesPerMinute = 0;
-       private double inchesPerWeek = 0;
-       private double timePerWatering = 0;
-       private double timePerWeek = 0;
-       private double timeWateredSoFar = 0;
-       private SprinklerSmart sprinkler;
-       private int zone = 0;
-       private Date lastMotionDetectedTime = null;
-       private Date startOfThisMotion = null;
-       private Date lastUpdateDate = null;
-       private Lock mutex = new ReentrantLock();
-       private long totalMotionOnLawn = 0;
-       private long numberOfMotionsOnLawnToday = 0;
-       private boolean lawnIsActive = false;
-       private Date lawnBecameActiceDate = null;
-       private Map<Integer, Double> moistureSensorReadings = 
-               new ConcurrentHashMap<Integer, Double>();
-       private Map<Integer, Date> moistureSensorUpdateTimes = 
-               new ConcurrentHashMap<Integer, Date>();
-
-
-       // 0th bit = Monday, 1th bit = Tuesday ext
-       public LawnState(LawnSmart _l, int _daysToWaterOn, MotionDetection _mo, 
-                                       double _inchesPerMinute, double _inchesPerWeek, SprinklerSmart _sprinkler, 
-                                       int _zone, Set<MoistureSensorSmart> _moistureSensors) throws RemoteException {
-               iotLawnObject = _l;
-               daysToWaterOn = _daysToWaterOn;
-               inchesPerMinute = _inchesPerMinute;
-               inchesPerWeek = _inchesPerWeek;
-               sprinkler = _sprinkler;
-               zone = _zone;
-
-               // register the callback with self
-               motionDetector = _mo;
-               _mo.registerCallback(this);
-
-               // register callback to self
-               for (MoistureSensorSmart sen : _moistureSensors) {
-
-                       try {
-                               sen.registerCallback(this);
-                       } catch (Exception e) {
-                               e.printStackTrace();
-                       }
-               }
-
-               // parse the days that we are going to water on
-               int numberOfDaysForWatering = 0;
-               for (int i = 0; i < 7; i++) {
-                       if ((daysToWaterOn & (1 << i)) > 0) {
-                               numberOfDaysForWatering++;
-                       }
-               }
-
-               // calculate lawn watering water amounts
-               timePerWeek = _inchesPerWeek / _inchesPerMinute;
-               timePerWatering = timePerWeek / (double)numberOfDaysForWatering;
-       }
-
-       /*******************************************************************************************************************************************
-       **
-       **  Public Methods
-       **
-       *******************************************************************************************************************************************/
-
-
-       /** Method to update the lawn state, updates lawn activity state based on activity timeout
-        *
-        *   @param _currentDate  [Date], the current date and time.
-        *
-        *   @return [void] None.
-        */
-       public void updateLawn(Date _currentDate) {
-               if (lastUpdateDate != null) {
-
-                       // check if we already did an update today
-                       if ((lastUpdateDate.getDate() == _currentDate.getDate())
-                                       && (lastUpdateDate.getMonth() == _currentDate.getMonth())
-                                       && (lastUpdateDate.getYear() == _currentDate.getYear())) {
-                               return;
-                       }
-               }
-
-               lastUpdateDate = _currentDate;
-
-               // lawn was active at some time so check if it can be deemed inactive because
-               // time has passed and it has not been active in that time
-               if (lawnBecameActiceDate != null) {
-                       long timeElapsed = (_currentDate.getTime() - lawnBecameActiceDate.getTime()) / 1000;
-
-                       if (timeElapsed >= AMOUNT_OF_TIME_FOR_ACTIVE_TO_HOLD) {
-                               lawnBecameActiceDate = null;
-                               lawnIsActive = false;
-                       }
-               }
-
-
-               // check activity of lawn
-               boolean isActiveLawn = false;
-               try {
-                       mutex.lock();
-                       if (totalMotionOnLawn >= AMOUNT_OF_MOTION_FOR_ACTIVE) {
-                               isActiveLawn = true;
-                       }
-
-                       // reset motion counters
-                       totalMotionOnLawn = 0;
-                       numberOfMotionsOnLawnToday = 0;
-
-               } catch (Exception e) {
-                       e.printStackTrace();
-               }
-               finally {
-                       mutex.unlock();
-               }
-
-               // update lawn state
-               if (isActiveLawn) {
-                       lawnIsActive = true;
-                       lawnBecameActiceDate = _currentDate;
-               }
-       }
-
-
-       /** Method to test if this lawn is active or not.
-        *
-        *   @return [Boolean] lawn is active.
-        */
-       public boolean lawnHasSufficientMotion() {
-               return lawnIsActive;
-       }
-
-
-       /** Method to test if this lawn should be watered or not right now.
-        *   Lawn urgently needs to be watered right now.
-        *
-        *   @param _currentDate  [Date], the current date and time.
-        *
-        *   @return [Boolean] lawn does need watering.
-        */
-       public boolean needsWateringUrgently(Date _currentDate) {
-
-               // get difference between now and last time watered
-               // TODO: Remove this to uncommented!!! This is only for testing!!!
-/*             long timeElapsed = (_currentDate.getTime() - lastTimeWatered.getTime()) / 1000;
-
-               // needs watering now urgently
-               if (timeElapsed >= MAX_TIME_BETWEEN_WATERING_SESSIONS) {
-                       return true;
-               }
-
-               // calculate the average moisture readings of all the
-               // sensors in this lawn
-               double averageMoistureValue = getAverageMoistureReading();
-
-               // is a valid average
-               if (averageMoistureValue != -1) {
-                       // moisture is very low so we need to water now!
-                       if (averageMoistureValue <= MOISTURE_LEVEL_FOR_EMERGENCY_WATERING) {
-                               return true;
-                       } else if (averageMoistureValue >= MOISTURE_LEVEL_FOR_NO_WATERING) {
-                               // moisture is high so no need to water
-                               return false;
-                       }
-               }
-
-               return false;
-*/
-               double averageMoistureValue = getAverageMoistureReading();
-//             System.out.println("DEBUG: Average moisture value: " + averageMoistureValue);
-
-               return true;
-       }
-
-
-       /** Method to test if this lawn should be watered or not
-        *
-        *   @param _currentDate  [Date], the current date and time.
-        *
-        *   @return [Boolean] lawn does need watering.
-        */
-       public boolean needsWatering(Date _currentDate) {
-
-               // only check if we have watered since the last date
-               if (didWaterSinceLastSchedualedDate) {
-                       // get the day of the week from the date and convert it to be
-                       // 0=Monday, 1=Sunday, ....
-                       int dayOfWeek = _currentDate.getDay();
-                       dayOfWeek = (dayOfWeek - 1) % 7;
-
-                       // Calculate what we should mask out days to water byte to see if it is a 1
-                       int mask = (1 << dayOfWeek);
-
-                       // mask the bye
-                       int shouldWaterToday = daysToWaterOn & mask;
-
-                       // if the post masked data is 0 then we should not water today since that bit was not set to 1
-                       // do not water today
-                       if (shouldWaterToday == 0) {
-                               return false;
-                       }
-
-               }
-
-               // it is a scheduled day so we need to water soon;
-               didWaterSinceLastSchedualedDate = false;
-
-               // check if it rained in the last little bit so there is no need to water this grass right now.
-               if (didRainRecently(_currentDate, RAINED_RECENTLY_DAYS_INTERVAL)) {
-                       return false;
-               }
-
-               // The grass was never watered before so water now
-               if (lastTimeWatered == null) {
-                       return true;
-               }
-
-               // calculate the average moisture readings of all the
-               // sensors in this lawn
-               double averageMoistureValue = getAverageMoistureReading();
-
-               // is a valid average
-               if (averageMoistureValue != -1) {
-                       // moisture is low enough to need to water now
-                       if (averageMoistureValue <= MOISTURE_LEVEL_FOR_NORMAL_WATERING) {
-                               return true;
-                       } else if (averageMoistureValue >= MOISTURE_LEVEL_FOR_NO_WATERING) {
-                               // moisture is high so no need to water
-                               return false;
-                       }
-               }
-
-               // if got here then no condition says we should not water today so we should
-               // water the grass today
-               return true;
-       }
-
-
-       /** Method to get the date of the last time the lawn was watered
-        *
-        *   @return [Date] date of last watering.
-        */
-       public Date getLastTimeWatered() {
-               return lastTimeWatered;
-       }
-
-       /** Method to keep track of the last few times it rained on this lawn
-        *
-        *   @param _dateOfRain  [Date], the date of the rain.
-        *
-        *   @return [void] None.
-        */
-       public void rainedOnDate(Date _dateOfRain) {
-
-               // the grass was technically watered on this day
-               lastTimeWatered = _dateOfRain;
-
-               didWaterSinceLastSchedualedDate = true;
-
-               // it rained on this date
-               daysRained.add(_dateOfRain);
-
-               // only keep the last 20 days that it rained
-               if (daysRained.size() > 20) {
-                       daysRained.remove(0);
-               }
-
-       }
-
-
-       /** Method to water lawn, calculates how much to water and sends water signal to controller
-        *
-        *   @param _currentDate  [Date], the current date and time.
-        *
-        *   @return [void] None.
-        */
-       public void waterLawn(Date _currentDate) {
-               lastTimeWatered = _currentDate;
-               didWaterSinceLastSchedualedDate = true;
-
-               // get the day of the week from the date and convert it to be
-               // 0=Monday, 1=Sunday, ....
-               int dayOfWeek = _currentDate.getDay();
-               dayOfWeek = (dayOfWeek - 1) % 7;
-
-
-               // check if it is the last day to water for this week
-               boolean isLastDay = true;
-               for (int i = 6; i > dayOfWeek; i--) {
-                       int mask = (1 << dayOfWeek);
-
-                       int shouldWaterToday = daysToWaterOn & mask;
-
-                       if (shouldWaterToday != 0) {
-                               isLastDay = false;
-                               break;
-                       }
-               }
-
-
-               int secondsToWater = 0;
-               if (isLastDay) {
-
-                       // last day of week to water so water the remaining amount
-                       double minutesToWater = timePerWeek - timeWateredSoFar;
-                       timeWateredSoFar = 0;
-                       secondsToWater = (int)((double)(minutesToWater * 60));
-
-               } else {
-
-                       // if it is not the last day then just water a normal amount
-                       timeWateredSoFar += timePerWatering;
-                       secondsToWater = (int)((double)(timePerWatering * 60));
-               }
-
-               try {
-                       System.out.println("DEBUG: We water the lawn!!! Zone: " + zone + " Seconds to water: " + secondsToWater);
-                       sprinkler.setZone(zone, true, secondsToWater);
-               } catch (Exception e) {
-                       e.printStackTrace();
-               }
-
-       }
-
-       /** Method callback from the motion detection callback interface, processes the motion
-        *  to see how long the motion was and saves that motion.
-        *
-        *   @param _md  [MotionDetection], motion detector with the motion
-        *
-        *   @return [void] None.
-        */
-       public void motionDetected(long timeStampOfLastMotion) {
-
-               Date currMotTime = new Date(timeStampOfLastMotion);
-
-               if (lastMotionDetectedTime == null) {
-                       lastMotionDetectedTime = currMotTime;
-               }
-
-               if (startOfThisMotion == null) {
-                       startOfThisMotion = currMotTime;
-               }
-
-               long timeElapsed = (currMotTime.getTime() - lastMotionDetectedTime.getTime()) / 1000;
-
-               if (timeElapsed >= NEW_MOTION_THRESHOLD) {
-                       try {
-                               mutex.lock();
-                               long motiontime = (lastMotionDetectedTime.getTime() - startOfThisMotion.getTime()) / 1000;
-                               totalMotionOnLawn += motiontime;
-                               numberOfMotionsOnLawnToday++;
-
-
-                       } catch (Exception e) {
-                               e.printStackTrace();
-                       }
-                       finally {
-                               mutex.unlock();
-                       }
-
-                       startOfThisMotion = currMotTime;
-               }
-
-               lastMotionDetectedTime = currMotTime;
-       }
-
-
-       /** Callback method for when a new moisture reading is available.
-        *   Called when a new reading is ready by the sensor and the sensor
-        *   can be checked for the frame data.
-        *
-        *   @param _sensor [MoistureSensor] .
-        *
-        *   @return [void] None.
-        */
-       public void newReadingAvailable(int sensorId, float moisture, long timeStampOfLastReading) {
-
-               moistureSensorReadings.put(sensorId, (double) moisture);
-               moistureSensorUpdateTimes.put(sensorId, new Date(timeStampOfLastReading));
-       }
-
-
-       /*******************************************************************************************************************************************
-       **
-       **  Helper Methods
-       **
-       *******************************************************************************************************************************************/
-
-       /** Method to check if it rained recently in the near past.
-        *
-        *   @param _numberOfDaysInPast  [long], number of days in the past to check if it rained recently.
-        *   @param _currentDate  [Date], the current date and time.
-        *
-        *   @return [boolean] weather it rained recently or not.
-        */
-       private boolean didRainRecently(Date _currentDate, long _numberOfDaysInPast) {
-
-               // it never rained before
-               if (daysRained.size() == 0) {
-                       return false;
-               }
-
-               // convert the days to seconds for calculation
-               long numberOfSecondsInPast = _numberOfDaysInPast * 24 * 60 * 60;
-
-               // go through all the stored days that it rained on
-               for (Date d : daysRained) {
-
-                       // check the difference time and convert to seconds.
-                       long numberOfSecondsDifference = (_currentDate.getTime() - d.getTime()) / 1000;
-
-                       // if it rained in the last specified time then return true
-                       if (numberOfSecondsDifference < numberOfSecondsInPast) {
-                               return true;
-                       }
-               }
-
-               return false;
-       }
-
-
-       /** Method calculate the average moisture readings of the most recent moisture reading of each sensor
-        *   if that reading is not stale
-        *
-        *   @return [double] average value of moisture readings.
-        */
-       private double getAverageMoistureReading() {
-
-               Date currentTime = new Date();
-               double total = 0;
-               int numberOfReadings = 0;
-
-               for (Integer sen : moistureSensorReadings.keySet()) {
-
-                       // check the timestamp of the watering of the lawn
-                       Date readingTimestamp = moistureSensorUpdateTimes.get(sen);
-
-                       System.out.println("DEBUG: Sensor reading time stamp: " + readingTimestamp.getTime());
-                       System.out.println("DEBUG: Current time stamp: " + currentTime.getTime());
-                       System.out.println("Time elapsed: " + (currentTime.getTime() - readingTimestamp.getTime()) / 1000);                     
-
-                       //long timeElapsedSinceLastWatering = (currentTime.getTime() - readingTimestamp.getTime()) / 1000;
-
-                       // if reading is old then dont use it since it is noise
-                       //if (timeElapsedSinceLastWatering > TWO_HOURS) {
-                       //      continue;
-                       //}
-
-                       // Do averaging
-                       numberOfReadings++;
-                       total += moistureSensorReadings.get(sen);
-
-                       System.out.println("DEBUG: Sensor reading value: " + moistureSensorReadings.get(sen) + " with total: " + total);
-               }
-
-
-               // if no readings were valid then return -1 so that we can signal that moisture cannot be used for now
-               if (numberOfReadings == 0) {
-                       return -1;
-               }
-
-               // return the calculated average of all the recent moisture readings
-               return total / (double)numberOfReadings;
-       }
-}
-
-
-
-
-
-
-
-
-
-
-
diff --git a/benchmarks/IrrigationController/MANIFEST.MF b/benchmarks/IrrigationController/MANIFEST.MF
deleted file mode 100644 (file)
index a29e15e..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Manifest-Version: 1.0\r
-Main-Class: WeatherGrabber\r
diff --git a/benchmarks/IrrigationController/Makefile b/benchmarks/IrrigationController/Makefile
deleted file mode 100644 (file)
index e338f79..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-BASE = ../..
-
-include $(BASE)/common.mk
-
-BOOFDIR := ../libs/boofcv_libs
-BOOFJARS := $(BOOFDIR)/BoofCV-feature-0.21.jar:$(BOOFDIR)/BoofCV-io-0.21.jar:$(BOOFDIR)/BoofCV-visualize-0.21.jar:$(BOOFDIR)/BoofCV-ip-0.21.jar:$(CHECKERJARS)
-
-JFLAGS = -d $(BIN_DIR) -cp $(BOOFJARS):$(BIN_DIR):.
-JARFLAGS = cf 
-
-all: irrigation
-
-PHONY += irrigation
-irrigation:
-       $(JAVAC) $(JFLAGS) *.java
-       cd  $(BIN_DIR)/IrrigationController; $(JAR) $(JARFLAGS) IrrigationController.jar ../IrrigationController/*.class ../iotcode/interfaces/*.class
-       cp IrrigationController.config $(BIN_DIR)/IrrigationController
-       cp -rf ./resources ./help_files $(BIN_DIR)/IrrigationController
-       cd  $(BIN_DIR)/IrrigationController; zip -r IrrigationController.zip ./resources ./help_files
-
-.PHONY: $(PHONY)
diff --git a/benchmarks/IrrigationController/MoistureSensorCallback_CallbackSkeleton.java b/benchmarks/IrrigationController/MoistureSensorCallback_CallbackSkeleton.java
deleted file mode 100644 (file)
index a82ae71..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-package IrrigationController;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Arrays;
-import iotrmi.Java.IoTRMICall;
-import iotrmi.Java.IoTRMIObject;
-
-import iotcode.interfaces.*;
-
-public class MoistureSensorCallback_CallbackSkeleton implements MoistureSensorCallback {
-
-       private MoistureSensorCallback mainObj;
-       private int objectId = 0;
-       private String callbackAddress;
-       
-
-       public MoistureSensorCallback_CallbackSkeleton(MoistureSensorCallback _mainObj, String _callbackAddress, int _objectId) throws Exception {
-               callbackAddress = _callbackAddress;
-               mainObj = _mainObj;
-               objectId = _objectId;
-       }
-
-       public void newReadingAvailable(int sensorId, float moisture, long timeStampOfLastReading) {
-               mainObj.newReadingAvailable(sensorId, moisture, timeStampOfLastReading);
-       }
-
-       public void ___newReadingAvailable(IoTRMIObject rmiObj) {
-               Object[] paramObj = rmiObj.getMethodParams(new Class<?>[] { int.class, float.class, long.class }, 
-               new Class<?>[] { null, null, null });
-               newReadingAvailable((int) paramObj[0], (float) paramObj[1], (long) paramObj[2]);
-       }
-
-       public void invokeMethod(IoTRMIObject rmiObj) throws IOException {
-               int methodId = rmiObj.getMethodId();
-               switch (methodId) {
-                       case 0: ___newReadingAvailable(rmiObj); break;
-                       default: 
-                       throw new Error("Method Id " + methodId + " not recognized!");
-               }
-       }
-
-}
diff --git a/benchmarks/IrrigationController/MoistureSensorSmart_Stub.java b/benchmarks/IrrigationController/MoistureSensorSmart_Stub.java
deleted file mode 100644 (file)
index 438563b..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-package IrrigationController;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Arrays;
-import iotrmi.Java.IoTRMICall;
-import iotrmi.Java.IoTRMIObject;
-
-import iotcode.interfaces.*;
-
-public class MoistureSensorSmart_Stub implements MoistureSensorSmart {
-
-       private IoTRMICall rmiCall;
-       private String callbackAddress;
-       private int[] ports;
-
-       private final static int objectId = 0;
-       // Callback properties
-       private IoTRMIObject rmiObj;
-       List<MoistureSensorCallback> listCallbackObj;
-       private int objIdCnt = 0;
-       private final static int object0Id = 0; //MoistureSensorSmartCallback
-       private static Integer[] object0Permission = { 0 };
-       private static List<Integer> set0Allowed;
-       
-
-       public MoistureSensorSmart_Stub(int _port, String _skeletonAddress, String _callbackAddress, int _rev, int[] _ports) throws Exception {
-               callbackAddress = _callbackAddress;
-               ports = _ports;
-               rmiCall = new IoTRMICall(_port, _skeletonAddress, _rev);
-               set0Allowed = new ArrayList<Integer>(Arrays.asList(object0Permission));
-               listCallbackObj = new ArrayList<MoistureSensorCallback>();
-               set0Allowed.add(-9999);
-               ___initCallBack();
-       }
-
-       public long getTimestampOfLastReading() {
-               int methodId = 2;
-               Class<?> retType = long.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               return (long)retObj;
-       }
-
-       public int getId() {
-               int methodId = 4;
-               Class<?> retType = int.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               return (int)retObj;
-       }
-
-       public void registerCallback(MoistureSensorCallback _callbackTo) {
-               try {
-                       MoistureSensorCallback_CallbackSkeleton skel0 = new MoistureSensorCallback_CallbackSkeleton(_callbackTo, callbackAddress, objIdCnt++);
-                       listCallbackObj.add(skel0);
-               } catch (Exception ex) {
-                       ex.printStackTrace();
-                       throw new Error("Exception when generating skeleton objects!");
-               }
-
-               int methodId = 5;
-               Class<?> retType = void.class;
-               Class<?>[] paramCls = new Class<?>[] { int.class };
-               Object[] paramObj = new Object[] { new Integer(1) };
-               rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-       }
-
-       public void ___initCallBack() {
-               Thread thread = new Thread() {
-                       public void run() {
-                               try {
-                                       rmiObj = new IoTRMIObject(ports[0]);
-                                       while (true) {
-                                               byte[] method = rmiObj.getMethodBytes();
-                                               int objId = IoTRMIObject.getObjectId(method);
-                                               MoistureSensorCallback_CallbackSkeleton skel = (MoistureSensorCallback_CallbackSkeleton) listCallbackObj.get(objId);
-                                               if (skel != null) {
-                                                       int methodId = IoTRMIObject.getMethodId(method);
-                                                       if (!set0Allowed.contains(methodId)) {
-                                                               throw new Error("Callback object for MoistureSensorCallback is not allowed to access method: " + methodId);
-                                                       }
-                                                       skel.invokeMethod(rmiObj);
-                                               } else {
-                                                       throw new Error("MoistureSensorCallback: Object with Id " + objId + " not found!");
-                                               }
-                                       }
-                               } catch (Exception ex) {
-                                       ex.printStackTrace();
-                                       throw new Error("Error instantiating class MoistureSensorCallback_CallbackSkeleton!");
-                               }
-                       }
-               };
-               thread.start();
-
-               int methodId = -9998;
-               Class<?> retType = void.class;
-               Class<?>[] paramCls = new Class<?>[] { int[].class, String.class, int.class };
-               Object[] paramObj = new Object[] { ports, callbackAddress, 0 };
-               rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-       }
-
-       public float getMoisture() {
-               int methodId = 1;
-               Class<?> retType = float.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               return (float)retObj;
-       }
-
-       public void setId(int id) {
-               int methodId = 3;
-               Class<?> retType = void.class;
-               Class<?>[] paramCls = new Class<?>[] { int.class };
-               Object[] paramObj = new Object[] { id };
-               rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-       }
-
-       public void init() {
-               int methodId = 0;
-               Class<?> retType = void.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-       }
-
-}
diff --git a/benchmarks/IrrigationController/MotionDetection.java b/benchmarks/IrrigationController/MotionDetection.java
deleted file mode 100644 (file)
index 0ae1e70..0000000
+++ /dev/null
@@ -1,436 +0,0 @@
-package IrrigationController;
-// IoT packages
-import iotcode.interfaces.*;
-
-// BoofCv packages
-import boofcv.alg.background.BackgroundModelStationary;
-import boofcv.factory.background.ConfigBackgroundGaussian;
-import boofcv.factory.background.FactoryBackgroundModel;
-import boofcv.gui.binary.VisualizeBinaryData;
-import boofcv.gui.image.ImageGridPanel;
-import boofcv.gui.image.ShowImages;
-import boofcv.io.MediaManager;
-import boofcv.io.UtilIO;
-import boofcv.io.image.SimpleImageSequence;
-import boofcv.io.image.ConvertBufferedImage;
-import boofcv.io.wrapper.DefaultMediaManager;
-import boofcv.struct.image.ImageBase;
-import boofcv.struct.image.ImageFloat32;
-import boofcv.struct.image.ImageType;
-import boofcv.struct.image.ImageUInt8;
-import boofcv.alg.filter.blur.BlurImageOps;
-
-
-// Standard Java Packages
-import java.awt.image.BufferedImage;
-import java.util.Date;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReadWriteLock;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.awt.image.ColorModel;
-import java.awt.image.WritableRaster;
-import java.util.List;
-import java.util.ArrayList;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import javax.imageio.ImageIO;
-
-// RMI Packages
-import java.rmi.RemoteException;
-import java.rmi.server.UnicastRemoteObject;
-
-// Checker annotations
-//import iotchecker.qual.*;
-
-
-
-/** Class MotionDetection to do motion detection using images
- *
- *
- * @author      Ali Younis <ayounis @ uci.edu>
- * @version     1.0
- * @since       2016-03-21
- */
-class MotionDetection extends UnicastRemoteObject implements CameraCallback {
-
-       // Define Like variables
-       private static boolean DO_GRAPHICAL_USER_INTERFACE = false;
-
-       /*******************************************************************************************************************************************
-       **
-       **  Constants
-       **
-       *******************************************************************************************************************************************/
-       private final float MOTION_DETECTED_THRESHOLD_PERCENTAGE = 5;
-
-
-       /*******************************************************************************************************************************************
-       **
-       **  Variables
-       **
-       *******************************************************************************************************************************************/
-
-       // Timestamp buffer and locks needed for that safety on that buffer
-       // This is the buffer for post-detection algorithm use
-       private Date timestampOfLastMotion = null;
-       private ReadWriteLock timestampReadWriteLock = new ReentrantReadWriteLock();
-       private Lock timestampReadLock = timestampReadWriteLock.readLock();
-       private Lock timestampWriteLock = timestampReadWriteLock.writeLock();
-
-       // Flag for when new data is available and ready for processing
-       private AtomicBoolean newFrameAvailable = new AtomicBoolean(false);
-
-       // Flag for determining if motion has been detected and therefore
-       // the callbacks should be issued
-       private AtomicBoolean motionDetected = new AtomicBoolean(false);
-
-       // Image and timestamp buffers and  locks needed for that safety on those buffers
-       // Timestamp buffer for pre-detection algorithm use
-       private BufferedImage latestImage = null;
-       private Date possibleDate = null;
-       private ReadWriteLock imageReadWriteLock = new ReentrantReadWriteLock();
-       private Lock imageReadLock = imageReadWriteLock.readLock();
-       private Lock imageWriteLock = imageReadWriteLock.writeLock();
-
-       // List of objects wishing to receive callbacks from this class.
-       private List<MotionDetectionCallback> callbackList = new ArrayList<MotionDetectionCallback>();
-
-       // Variables to help with motion detection
-       private ConfigBackgroundGaussian configGaussian = null;
-       private BackgroundModelStationary backgroundDetector = null;
-       private ImageUInt8 segmented = null;
-       private ImageFloat32 newFrameFloat = null;
-
-       // counts the number of frames since a background image is added to algorithm
-       private int frameCounter = 0;
-
-
-
-       /*******************************************************************************************************************************************
-       **
-       **  Threads
-       **
-       *******************************************************************************************************************************************/
-       private Thread workThread = null;
-       private Thread callBackThread = null;
-
-       /*******************************************************************************************************************************************
-       **
-       **  GUI Stuff (Used Only for Testing)
-       **
-       *******************************************************************************************************************************************/
-       ImageGridPanel gui;
-
-
-
-       /** Constructor
-        *
-        *   @param _threshold       [float], Variable for gaussian background detector.
-        *   @param _learnSpeed      [float], Variable for gaussian background detector.
-        *   @param _initialVariance [float], Variable for gaussian background detector.
-        *   @param _minDifference   [float], Variable for gaussian background detector.
-        *
-        */
-       public MotionDetection(float _threshold, float _learnSpeed, float _initialVariance, float _minDifference) throws RemoteException {
-
-               // Configure the Gaussian model used for background detection
-               configGaussian = new ConfigBackgroundGaussian(_threshold, _learnSpeed);
-               configGaussian.initialVariance = _initialVariance;
-               configGaussian.minimumDifference = _minDifference;
-
-               // setup the background detector
-               ImageType imageType = ImageType.single(ImageFloat32.class);
-               backgroundDetector = FactoryBackgroundModel.stationaryGaussian(configGaussian, imageType);
-
-               // setup the gui if we are going to use it
-               if (DO_GRAPHICAL_USER_INTERFACE) {
-
-                       // create an image grid for images to place on, tile fashion
-                       gui = new ImageGridPanel(1, 2);
-
-                       // make the window large so we dont have to manually resize with the mouse
-                       gui.setSize(1920, 1080);
-
-                       // Make the window visible and set the title
-                       ShowImages.showWindow(gui, "Static Scene: Background Segmentation", true);
-               }
-
-               // Launch the worker thread
-               workThread = new Thread(new Runnable() {
-                       public void run() {
-
-                               while (true) {
-                                       runMotionDetection();
-                               }
-                       }
-               });
-               workThread.start();
-
-
-               // Launch the callback thread
-               callBackThread = new Thread(new Runnable() {
-                       public void run() {
-
-                               while (true) {
-                                       doCallbacks();
-                               }
-                       }
-               });
-               callBackThread.start();
-       }
-
-
-       /*******************************************************************************************************************************************
-       **
-       **  Public Methods
-       **
-       *******************************************************************************************************************************************/
-
-       /** Method to add a new frame to the motion detector.
-        *
-        *   @param _newFrame  [byte[]], Frame data of new frame.
-        *   @param _timestamp [Date]  , Timestamp of new frame.
-        *
-        *   @return [void] None.
-        */
-       public void addFrame(byte[]  _newFrame, Date _timestamp) {
-               BufferedImage img = null;
-
-               try {
-                       // Parse the byte array into a Buffered Image
-                       InputStream in = new ByteArrayInputStream(_newFrame);
-                       img = ImageIO.read(in);
-
-               } catch (Exception e) {
-                       e.printStackTrace();
-                       return;
-               }
-
-               // Save the image and timestamp for use later
-               imageWriteLock.lock();                                          // lock the image and timestamp buffers since multithread
-               latestImage = img;                                                              // image into image buffer
-               possibleDate = _timestamp;                              // timestamp into timestamp buffer
-               imageWriteLock.unlock();                                        // Never forget to unlock
-
-               // flag the worker thread that there is new data ready for processing
-               newFrameAvailable.set(true);
-       }
-
-       /** Method to get the timestamp of the last time motion was detected
-        *
-        *   @return [Date] timestamp of last motion or null if no motion was ever detected.
-        */
-       public long getTimestampOfLastMotion() {
-               Date ret = null;
-
-               // Be safe because multithread
-               timestampReadLock.lock();
-
-               // Checks if there was ever motion, if not then timestampOfLastMotion
-               // will be null
-               if (timestampOfLastMotion != null) {
-                       // Clone since we don't know what the other person is going to do
-                       // with the timestamp
-                       ret = (Date)timestampOfLastMotion.clone();
-               }
-
-               timestampReadLock.unlock();
-               long retLong = ret.getTime();
-
-               return retLong;
-       }
-
-
-       /** Method to add a new frame to the motion detector from a camera
-        *
-        *   @param _camera  [Camera], Camera that has the new data.
-        *
-        *   @return [void] None.
-        */
-       //public void newCameraFrameAvailable(@NonLocalRemote Camera _camera) {
-       public void newCameraFrameAvailable(byte[] latestFrame, long timeStamp) {
-               BufferedImage img = null;
-
-               try {
-                       // Parse the byte array into a Buffered Image
-                       //InputStream in = new ByteArrayInputStream(_camera.getLatestFrame());
-                       InputStream in = new ByteArrayInputStream(latestFrame);
-                       img = ImageIO.read(in);
-
-               } catch (RemoteException e) {
-                       e.printStackTrace();
-                       return;
-
-               } catch (Exception e) {
-                       e.printStackTrace();
-                       return;
-
-               }
-
-               // Save the image and timestamp for use later
-               imageWriteLock.lock();                  // lock the image and timestamp buffers since multithread
-               latestImage = img;                                      // image into image buffer
-
-               // timestamp from camera into timestamo buffer
-               //try {
-                       //long dateLong = _camera.getTimestamp();
-                       long dateLong = timeStamp;
-                       possibleDate = new Date(dateLong);
-               //} catch (RemoteException e) {
-               //      e.printStackTrace();
-               //}
-
-               imageWriteLock.unlock();                // Never forget to unlock
-
-               // flag the worker thread that there is new data ready for processing
-               newFrameAvailable.set(true);
-       }
-
-       /** Method to register an object to recieve callbacks from this motion detector
-        *
-        *   @param _mdc  [MotionDetectionCallback], object to recieve callbacks.
-        *
-        *   @return [void] None.
-        */
-       public void registerCallback(MotionDetectionCallback _mdc) {
-               callbackList.add(_mdc);
-       }
-
-       /*******************************************************************************************************************************************
-       **
-       **  Helper Methods
-       **
-       *******************************************************************************************************************************************/
-
-       /** Method that constantly loops checking if new data is available.  If there is
-        *   new data, it is processed.
-        *   This method should be run on a separate thread.
-        *
-        *   @return [void] None.
-        */
-       private void runMotionDetection() {
-
-               // check if there is a new frame availble, only runs detection if there is new data to save
-               // computation time
-               if (!newFrameAvailable.get()) {
-                       return;
-               }
-
-               // Lock since we are accessing the data buffers
-               imageReadLock.lock();
-
-               // processing data so now the buffered data is old
-               newFrameAvailable.set(false);
-
-               // copy from buffer to local for processing
-               Date tmpDate = possibleDate;
-
-               // Allocate space for the segmented image based on the first image we received
-               // cannot pre-allocate this since we do not know what the size of the images is
-               // before the first image arrives
-               if (segmented == null) {
-                       segmented = new ImageUInt8(latestImage.getWidth(), latestImage.getHeight());
-               }
-
-               // copy from data buffers and convert into correct data type for BoofCv libraries
-               newFrameFloat = ConvertBufferedImage.convertFrom(latestImage, newFrameFloat);
-
-               // All done accessing the data buffers
-               imageReadLock.unlock();
-
-               // Run background detection
-               backgroundDetector.segment(newFrameFloat, segmented);
-
-               // Update the background baseline every 10 frames, helps the algorithm
-               frameCounter++;
-               if (frameCounter > 10) {
-                       backgroundDetector.updateBackground(newFrameFloat);
-                       frameCounter = 0;
-               }
-
-               // get the raw pixel data, gray-scale image
-               byte[] frameData = segmented.getData();
-
-               // count the number of pixels of the image that was deemed as "motion"
-               double count = 0;
-               double countMotion = 0;
-               for (byte b : frameData) {
-                       count++;
-                       if (b > 0) {
-                               countMotion++;
-                       }
-               }
-
-               // calculate the percentage of the image that was in motion
-               double percentMotion = (countMotion / count) * 100.0;
-
-               // Check if a high enough percentage of the image was in motion to say that there was motion in this frame of data
-               if (percentMotion > MOTION_DETECTED_THRESHOLD_PERCENTAGE) {
-
-                       // Motion detected so save timestamp of this frame to another buffer
-                       timestampWriteLock.lock();
-                       timestampOfLastMotion = (Date)tmpDate.clone();                  // clone to a different buffer
-                       timestampWriteLock.unlock();
-
-                       System.out.println("Motion Detected (with percentage: " + Double.toString(percentMotion) + "%)");
-               }
-
-               // Do output to the screen if we are using gui mode
-               if (DO_GRAPHICAL_USER_INTERFACE) {
-
-                       // change image data unto correct type for rendering
-                       BufferedImage visualized1 = new BufferedImage(segmented.width, segmented.height, BufferedImage.TYPE_INT_RGB);
-                       VisualizeBinaryData.renderBinary(segmented, false, visualized1);
-
-                       // change image data unto correct type for rendering
-                       BufferedImage visualized2 = null;
-                       visualized2 = ConvertBufferedImage.convertTo(newFrameFloat, visualized2, true);
-
-                       // place the images into the image grid
-                       gui.setImage(0, 1, visualized1);
-                       gui.setImage(0, 2, visualized2);
-
-                       // trigger rendering
-                       gui.repaint();
-               }
-       }
-
-       /** Method that constantly loops checking if the callbacks should be issues and
-        *   issues the callbacks if they should be issues.
-        *   This method should be run on a separate thread.
-        *
-        *   @return [void] None.
-        */
-       private void doCallbacks() {
-
-               // Keep looping forever for callback
-               while (true) {
-
-                       // If motion detected
-                       if (motionDetected.compareAndSet(true, false)) {
-
-                               // Motion was detected so issue callbacks to all objects that registered
-                               // to receive callback from this class.
-                               for (MotionDetectionCallback c : callbackList) {
-                                       //try {
-                                               c.motionDetected(this.getTimestampOfLastMotion());
-                                       //} catch (RemoteException re) {
-                                       //}
-                               }
-
-                       } else {
-
-                               // Sleep for 15 millisec to give time for new frame to arrive
-                               try {
-                                       Thread.sleep(15);
-                               } catch (InterruptedException ie) {
-                               }
-                       }
-               }
-       }
-}
-
diff --git a/benchmarks/IrrigationController/MotionDetectionCallback.java b/benchmarks/IrrigationController/MotionDetectionCallback.java
deleted file mode 100644 (file)
index 3f89aa2..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-package IrrigationController;
-
-/** Interface MotionDetectionCallback for allowing callbacks from the MotionDetection class.
- *
- *
- * @author      Ali Younis <ayounis @ uci.edu>
- * @version     1.0
- * @since       2016-03-21
- */
-
-public interface MotionDetectionCallback {
-
-       /** Callback method for when motion is detected.
-        *
-        *   @param timeStampOfLastMotion [long].
-        *
-        *   @return [void] None.
-        */
-       public void motionDetected(long timeStampOfLastMotion);
-}
diff --git a/benchmarks/IrrigationController/SprinklerSmart_Stub.java b/benchmarks/IrrigationController/SprinklerSmart_Stub.java
deleted file mode 100644 (file)
index 6e06e56..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-package IrrigationController;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Arrays;
-import iotrmi.Java.IoTRMICall;
-import iotrmi.Java.IoTRMIObject;
-
-import iotcode.interfaces.*;
-
-public class SprinklerSmart_Stub implements SprinklerSmart {
-
-       private IoTRMICall rmiCall;
-       private String callbackAddress;
-       private int[] ports;
-
-       private final static int objectId = 0;
-       
-
-       public SprinklerSmart_Stub(int _port, String _skeletonAddress, String _callbackAddress, int _rev, int[] _ports) throws Exception {
-               callbackAddress = _callbackAddress;
-               ports = _ports;
-               rmiCall = new IoTRMICall(_port, _skeletonAddress, _rev);
-       }
-
-       public boolean doesHaveZoneTimers() {
-               int methodId = 4;
-               Class<?> retType = boolean.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               return (boolean)retObj;
-       }
-
-       public List<ZoneState> getZoneStates() {
-               int methodId = 2;
-               Class<?> retType = int.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               Object retLenObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               int retLen = (int) retLenObj;
-               Class<?>[] retCls = new Class<?>[3*retLen];
-               Class<?>[] retClsVal = new Class<?>[3*retLen];
-               int retPos = 0;
-               for(int i = 0; i < retLen; i++) {
-                       retCls[retPos] = int.class;
-                       retClsVal[retPos++] = null;
-                       retCls[retPos] = boolean.class;
-                       retClsVal[retPos++] = null;
-                       retCls[retPos] = int.class;
-                       retClsVal[retPos++] = null;
-               }
-               Object[] retObj = rmiCall.getStructObjects(retCls, retClsVal);
-               List<ZoneState> structRet = new ArrayList<ZoneState>();
-               int retObjPos = 0;
-               for(int i = 0; i < retLen; i++) {
-                       ZoneState structRetMem = new ZoneState();
-                       structRetMem.zoneNumber = (int) retObj[retObjPos++];
-                       structRetMem.onOffState = (boolean) retObj[retObjPos++];
-                       structRetMem.duration = (int) retObj[retObjPos++];
-                       structRet.add(structRetMem);
-               }
-               return structRet;
-       }
-
-       public void init() {
-               int methodId = 0;
-               Class<?> retType = void.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-       }
-
-       public void setZone(int _zone, boolean _onOff, int _onDurationSeconds) {
-               int methodId = 1;
-               Class<?> retType = void.class;
-               Class<?>[] paramCls = new Class<?>[] { int.class, boolean.class, int.class };
-               Object[] paramObj = new Object[] { _zone, _onOff, _onDurationSeconds };
-               rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-       }
-
-       public int getNumberOfZones() {
-               int methodId = 3;
-               Class<?> retType = int.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               return (int)retObj;
-       }
-
-}
diff --git a/benchmarks/IrrigationController/Tuple.java b/benchmarks/IrrigationController/Tuple.java
deleted file mode 100644 (file)
index ec75598..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-package IrrigationController;
-
-/** Class Tuple used for storing a pair of objects together
- *
- * Referenced from: http://stackoverflow.com/questions/2670982/using-pairs-or-2-tuples-in-java
- *
- * @author      Ali Younis <ayounis @ uci.edu>
- * @version     1.0
- * @since       2016-01-27
- */
-
-public class Tuple<X, Y> {
-
-       // The tuple object internal objects have no protection
-       // Assume that the user will use these in a safe way
-       public final X x;
-       public final Y y;
-
-
-       /** Constructor
-        *
-        *   @param x [X], x value of tuple.
-        *   @param y [Y], y value of tuple.
-        *
-        */
-       public Tuple(X x, Y y) {
-               this.x = x;
-               this.y = y;
-       }
-}
diff --git a/benchmarks/IrrigationController/WeatherGatewayCallback_CallbackSkeleton.java b/benchmarks/IrrigationController/WeatherGatewayCallback_CallbackSkeleton.java
deleted file mode 100644 (file)
index f3696e4..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-package IrrigationController;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Arrays;
-import iotrmi.Java.IoTRMICall;
-import iotrmi.Java.IoTRMIObject;
-
-import iotcode.interfaces.*;
-
-public class WeatherGatewayCallback_CallbackSkeleton implements WeatherGatewayCallback {
-
-       private WeatherGatewayCallback mainObj;
-       private int objectId = 0;
-       private String callbackAddress;
-       
-
-       public WeatherGatewayCallback_CallbackSkeleton(WeatherGatewayCallback _mainObj, String _callbackAddress, int _objectId) throws Exception {
-               callbackAddress = _callbackAddress;
-               mainObj = _mainObj;
-               objectId = _objectId;
-       }
-
-       public void informationRetrieved(double _inchesPerWeek, int _weatherZipCode, int _daysToWaterOn, double _inchesPerMinute) {
-               mainObj.informationRetrieved(_inchesPerWeek, _weatherZipCode, _daysToWaterOn, _inchesPerMinute);
-       }
-
-       public void ___informationRetrieved(IoTRMIObject rmiObj) {
-               Object[] paramObj = rmiObj.getMethodParams(new Class<?>[] { double.class, int.class, int.class, double.class }, 
-               new Class<?>[] { null, null, null, null });
-               informationRetrieved((double) paramObj[0], (int) paramObj[1], (int) paramObj[2], (double) paramObj[3]);
-       }
-
-       public void invokeMethod(IoTRMIObject rmiObj) throws IOException {
-               int methodId = rmiObj.getMethodId();
-               switch (methodId) {
-                       case 0: ___informationRetrieved(rmiObj); break;
-                       default: 
-                       throw new Error("Method Id " + methodId + " not recognized!");
-               }
-       }
-
-}
diff --git a/benchmarks/IrrigationController/WeatherGatewaySmart_Stub.java b/benchmarks/IrrigationController/WeatherGatewaySmart_Stub.java
deleted file mode 100644 (file)
index e8922c5..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-package IrrigationController;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Arrays;
-import iotrmi.Java.IoTRMICall;
-import iotrmi.Java.IoTRMIObject;
-
-import iotcode.interfaces.*;
-
-public class WeatherGatewaySmart_Stub implements WeatherGatewaySmart {
-
-       private IoTRMICall rmiCall;
-       private String callbackAddress;
-       private int[] ports;
-
-       private final static int objectId = 0;
-       // Callback properties
-       private IoTRMIObject rmiObj;
-       List<WeatherGatewayCallback> listCallbackObj;
-       private int objIdCnt = 0;
-       private final static int object0Id = 0; //WeatherGatewaySmartCallback
-       private static Integer[] object0Permission = { 0 };
-       private static List<Integer> set0Allowed;
-       
-
-       public WeatherGatewaySmart_Stub(int _port, String _skeletonAddress, String _callbackAddress, int _rev, int[] _ports) throws Exception {
-               callbackAddress = _callbackAddress;
-               ports = _ports;
-               rmiCall = new IoTRMICall(_port, _skeletonAddress, _rev);
-               set0Allowed = new ArrayList<Integer>(Arrays.asList(object0Permission));
-               listCallbackObj = new ArrayList<WeatherGatewayCallback>();
-               set0Allowed.add(-9999);
-               ___initCallBack();
-       }
-
-       public double getInchesPerWeek() {
-               int methodId = 3;
-               Class<?> retType = double.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               return (double)retObj;
-       }
-
-       public double getInchesPerMinute() {
-               int methodId = 6;
-               Class<?> retType = double.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               return (double)retObj;
-       }
-
-       public int getDaysToWaterOn() {
-               int methodId = 5;
-               Class<?> retType = int.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               return (int)retObj;
-       }
-
-       public void registerCallback(WeatherGatewayCallback _callbackTo) {
-               try {
-                       WeatherGatewayCallback_CallbackSkeleton skel0 = new WeatherGatewayCallback_CallbackSkeleton(_callbackTo, callbackAddress, objIdCnt++);
-                       listCallbackObj.add(skel0);
-               } catch (Exception ex) {
-                       ex.printStackTrace();
-                       throw new Error("Exception when generating skeleton objects!");
-               }
-
-               int methodId = 7;
-               Class<?> retType = void.class;
-               Class<?>[] paramCls = new Class<?>[] { int.class };
-               Object[] paramObj = new Object[] { new Integer(1) };
-               rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-       }
-
-       public void ___initCallBack() {
-               Thread thread = new Thread() {
-                       public void run() {
-                               try {
-                                       rmiObj = new IoTRMIObject(ports[0]);
-                                       while (true) {
-                                               byte[] method = rmiObj.getMethodBytes();
-                                               int objId = IoTRMIObject.getObjectId(method);
-                                               WeatherGatewayCallback_CallbackSkeleton skel = (WeatherGatewayCallback_CallbackSkeleton) listCallbackObj.get(objId);
-                                               if (skel != null) {
-                                                       int methodId = IoTRMIObject.getMethodId(method);
-                                                       if (!set0Allowed.contains(methodId)) {
-                                                               throw new Error("Callback object for WeatherGatewayCallback is not allowed to access method: " + methodId);
-                                                       }
-                                                       skel.invokeMethod(rmiObj);
-                                               } else {
-                                                       throw new Error("WeatherGatewayCallback: Object with Id " + objId + " not found!");
-                                               }
-                                       }
-                               } catch (Exception ex) {
-                                       ex.printStackTrace();
-                                       throw new Error("Error instantiating class WeatherGatewayCallback_CallbackSkeleton!");
-                               }
-                       }
-               };
-               thread.start();
-
-               int methodId = -9998;
-               Class<?> retType = void.class;
-               Class<?>[] paramCls = new Class<?>[] { int[].class, String.class, int.class };
-               Object[] paramObj = new Object[] { ports, callbackAddress, 0 };
-               rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-       }
-
-       public void stop() {
-               int methodId = 2;
-               Class<?> retType = void.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-       }
-
-       public void start() {
-               int methodId = 1;
-               Class<?> retType = void.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-       }
-
-       public void init() {
-               int methodId = 0;
-               Class<?> retType = void.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-       }
-
-       public int getWeatherZipCode() {
-               int methodId = 4;
-               Class<?> retType = int.class;
-               Class<?>[] paramCls = new Class<?>[] {  };
-               Object[] paramObj = new Object[] {  };
-               Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
-               return (int)retObj;
-       }
-
-}
diff --git a/benchmarks/IrrigationController/WeatherGrabber.java b/benchmarks/IrrigationController/WeatherGrabber.java
deleted file mode 100644 (file)
index c47170b..0000000
+++ /dev/null
@@ -1,584 +0,0 @@
-package IrrigationController;
-
-// IoT Packages
-import iotruntime.slave.IoTAddress;
-import iotruntime.IoTURL;
-
-// Standard Java Packages
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.PrintStream;
-import java.io.Reader;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-/** Class WeatherGrabber to get weather data information using the OpenWeatherMap api.
- *
- * @author      Ali Younis <ayounis @ uci.edu>
- * @version     1.0
- * @since       2016-03-24
- */
-public class WeatherGrabber {
-
-       /*******************************************************************************************************************************************
-       **
-       **  Constants
-       **
-       *******************************************************************************************************************************************/
-
-       // KEy for using the api, needed for authentication with the api when making calls to it
-       public static final String API_KEY_ID = "fbc55f11190c6472e14b7743f8a38c92";
-
-       // location in the jar file where the zipcodes csv data is located
-       public static final String ZIPCODE_CSV_FILE = "./resources/zipcode.csv";
-
-       // location in the jar file where the area codes csv data is located
-       public static final String AREA_CODE_CSV_FILE = "./resources/area_codes.csv";
-
-
-
-
-       /*******************************************************************************************************************************************
-       **
-       **  Variables
-       **
-       *******************************************************************************************************************************************/
-
-       // Communications information for interfacing with the api
-       private IoTAddress weatherDataAddress;
-
-       // Things needed for caching of the data
-       private long timestampOfLastWeatherRetrieval = 0;
-       private int lastZipcodeLookup = 0;
-       private List<DayWeather> weatherDataCache = null;
-
-       private int savedZipcode = 0;
-       private int savedNumberOfDays = 16;
-
-
-       public WeatherGrabber(IoTAddress _IoTAddress) {
-               this.weatherDataAddress = _IoTAddress;
-       }
-
-
-
-
-       /*******************************************************************************************************************************************
-       **
-       **  Public Methods
-       **
-       *******************************************************************************************************************************************/
-
-
-       /** Method to get and parse the weather data for the saved zipcode and number of days
-        *
-        *   @return [List<DayWeather>] list of day by day weather data.
-        */
-       public List<DayWeather> getWeatherData() {
-               if (savedZipcode <= 0) {
-                       return null;
-               }
-               return getWeatherData(savedZipcode, savedNumberOfDays);
-       }
-
-
-       /** Method to get and parse the weather data for a specific zipcode for a specified number of days
-        *
-        *   @param _weatherCode  [int], zipcode to get the weather for.
-        *   @param _numberOfDays [int], number of days to lookup weather for.
-        *
-        *   @return [List<DayWeather>] list of day by day weather data.
-        */
-       public List<DayWeather> getWeatherData(int _zipcode, int _numberOfDays) {
-
-               // less than or equal to 0 means that the list will be empty
-               if (_numberOfDays <= 0) {
-                       return new ArrayList<DayWeather>();
-               }
-
-               // get current date and time
-               Date date = new Date();
-
-               // check if we ever got the weather data
-               if (this.timestampOfLastWeatherRetrieval != 0) {
-
-                       // check the elapsed time since we got the weather data
-                       long timeElapsedFromLastWeatherDataRead = date.getTime() - this.timestampOfLastWeatherRetrieval;
-                       timeElapsedFromLastWeatherDataRead /= 1000;                             // convert to seconds
-
-                       // we got the cached weather data less than 12 hours ago so just use the cached data
-                       // The api limits how many calls we can make in a given time and so we should cache the data
-                       // and reuse it.  Also the weather doesnt change that fast
-                       if (timestampOfLastWeatherRetrieval <= 43200) {
-
-                               // make sure the cached weather data is for the zipcode that we are being asked for
-                               if (lastZipcodeLookup == _zipcode) {
-
-                                       // now check that we actually have weather data available
-                                       if (weatherDataCache != null) {
-
-                                               // make sure we have enough weather data, we may only have data for some of the days that
-                                               // are being requested but not all
-                                               if (weatherDataCache.size() >= _numberOfDays) {
-                                                       return weatherDataCache;
-                                               }
-                                       }
-                               }
-                       }
-               }
-
-               // convert zipcode into weather api specific area code
-               int weatherLocationCode = getWeatherCode(_zipcode);
-
-               // check if weather information can be attained for the zipcode specified
-               if (weatherLocationCode == -1) {
-                       return null;
-               }
-
-               // save information for caching
-               lastZipcodeLookup = _zipcode;
-               timestampOfLastWeatherRetrieval = date.getTime();
-
-               // try to get the weather data XML from the server
-               InputStream inputStream = getXmlData(weatherLocationCode, _numberOfDays);
-               if (inputStream == null) {
-                       return null;
-               }
-
-               // convert the XML into an easier to use format
-               weatherDataCache = parseXmlData(inputStream);
-               return weatherDataCache;
-       }
-
-
-       /** Method to set the zipcode of this weather grabber
-        *
-        *   @param _zipcode  [int], zipcode to get the weather for.
-        *
-        *   @return [void] None.
-        */
-       public void setZipcode(int _zipcode) {
-               savedZipcode = _zipcode;
-       }
-
-
-       /** Method to set the number of days of this weather grabber
-        *
-        *   @param _numberOfDays  [int], number of days to get the weather for.
-        *
-        *   @return [void] None.
-        */
-       public void setNumberOfDays(int _numberOfDays) {
-               savedNumberOfDays = _numberOfDays;
-       }
-
-
-       /** Method to get the zipcode of this weather grabber
-        *
-        *   @return [int] zipcode of the weather grabber.
-        */
-       public int getZipcode() {
-               return savedZipcode;
-       }
-
-
-       /** Method to get the number of days of this weather grabber
-        *
-        *   @return [int] number of days of the weather grabber.
-        */
-       public int getNumberOfDays() {
-               return savedNumberOfDays;
-       }
-
-       /*******************************************************************************************************************************************
-       **
-       **  Helper Methods
-       **
-       *******************************************************************************************************************************************/
-
-       /** Method to get the XML file that the weather api returns after a query
-        *
-        *   @param _weatherCode  [int], weather api specific location code.
-        *   @param _numberOfDays [int], number of days to lookup weather for.
-        *
-        *   @return [InputStream] InputStream containing the xml file data.
-        */
-       private InputStream getXmlData(int _weatherCode, int _numberOfDays) {
-
-               // We can only get a max of 16 days into the future
-               if (_numberOfDays > 16) {
-                       _numberOfDays = 16;
-               }
-
-               // Create the url ending path with all the parameters needed to get the XML file
-               String urlEnd = "/data/2.5/forecast/daily?id=" + Integer.toString(_weatherCode) + "&units=imperial&mode=xml&cnt=" + Integer.toString(_numberOfDays) + "&APPID=" + "fbc55f11190c6472e14b7743f8a38c92";
-
-               // Communication object created based on address passed in by the runtime system
-               IoTURL urlConnection = new IoTURL(weatherDataAddress);
-               System.out.println("URL: " + urlEnd);
-
-               try {
-                       // sets the connection ending address
-                       urlConnection.setURL(urlEnd);
-                       System.out.println("Connected to URL!");
-
-                       // Return the stream
-                       return urlConnection.openStream();
-               } catch (Exception e) {
-                       e.printStackTrace();
-               }
-
-               // something happened and the URL connection could not be opened.
-               return null;
-       }
-
-
-       /** Method to parse the XML file that the weather api returns after a query
-        *
-        *   @param inputStream [InputStream], input stream containing weather XML file.
-        *
-        *   @return [List<DayWeather>] list of day by day weather data.
-        */
-       private List<DayWeather> parseXmlData(InputStream inputStream) {
-               try {
-
-                       // array to store the parsed weather data per day
-                       ArrayList<DayWeather> weatherDataList = new ArrayList<DayWeather>();
-
-                       // stuff needed to open and parse an XML file
-                       DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
-                       documentBuilderFactory.setValidating(false);
-                       documentBuilderFactory.setNamespaceAware(false);
-                       DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
-                       Document document = documentBuilder.parse(inputStream);
-
-                       // get the forecast node that is the main node for each of the day subnodes
-                       NodeList forcastNodes = document.getElementsByTagName("forecast").item(0).getChildNodes();
-                       for (int i = 0; i < forcastNodes.getLength(); ++i) {
-
-                               // the node for each of the individual days
-                               Node dayNode = forcastNodes.item(i);
-
-                               // make sure the node is an actually day node and not an invalid node
-                               if (dayNode.getNodeType() == Node.ELEMENT_NODE) {
-
-                                       // Convert to elements since we can only pull data out of elements not nodes
-                                       Element dayElement = (Element)dayNode;
-
-                                       // Information is saved in child nodes
-                                       NodeList informationNodes = dayNode.getChildNodes();
-
-                                       // Data that pulls the pre-parse data from the XML file
-                                       String dateString = dayElement.getAttribute("day");
-                                       String weatherInfoCode = "";
-                                       String windDirectionText = "";
-                                       String windDirectionDegrees = "";
-                                       String windSpeed = "";
-                                       String temperatureDay = "";
-                                       String temperatureEvening = "";
-                                       String temperatureMorning = "";
-                                       String temperatureNight = "";
-                                       String temperatureMax = "";
-                                       String temperatureMin = "";
-                                       String pressure = "";
-                                       String humidity = "";
-                                       String cloudCoverage = "";
-
-                                       // go through the child info nodes and pull the data out
-                                       for (int j = 0; j < informationNodes.getLength(); ++j) {
-
-                                               Node informationNode = informationNodes.item(j);
-
-                                               if (informationNode.getNodeType() == Node.ELEMENT_NODE) {
-
-                                                       Element informationElement = (Element)informationNode;
-                                                       String informationName = informationElement.getTagName();
-
-                                                       if (informationName.equals("symbol")) {
-                                                               weatherInfoCode = informationElement.getAttribute("number");
-
-                                                       } else if (informationName.equals("windDirection")) {
-                                                               windDirectionText = informationElement.getAttribute("code");
-                                                               windDirectionDegrees = informationElement.getAttribute("deg");
-
-                                                       } else if (informationName.equals("windSpeed")) {
-                                                               windSpeed = informationElement.getAttribute("mps");
-
-                                                       } else if (informationName.equals("temperature")) {
-                                                               temperatureDay = informationElement.getAttribute("day");
-                                                               temperatureEvening = informationElement.getAttribute("eve");
-                                                               temperatureMorning = informationElement.getAttribute("morn");
-                                                               temperatureNight = informationElement.getAttribute("night");
-                                                               temperatureMax = informationElement.getAttribute("max");
-                                                               temperatureMin = informationElement.getAttribute("min");
-
-                                                       } else if (informationName.equals("pressure")) {
-                                                               pressure = informationElement.getAttribute("value");
-
-                                                       } else if (informationName.equals("humidity")) {
-                                                               humidity = informationElement.getAttribute("value");
-
-                                                       } else if (informationName.equals("clouds")) {
-                                                               cloudCoverage = informationElement.getAttribute("all");
-
-                                                       }
-                                               }
-                                       }
-
-                                       // Create the day object,  this object will automatically convert the string data into
-                                       // the appropriate data types
-                                       DayWeather dayWeather = new DayWeather(dateString,
-                                                                                                                                                                                                weatherInfoCode,
-                                                                                                                                                                                                windDirectionText,
-                                                                                                                                                                                                windDirectionDegrees,
-                                                                                                                                                                                                windSpeed,
-                                                                                                                                                                                                temperatureDay,
-                                                                                                                                                                                                temperatureEvening,
-                                                                                                                                                                                                temperatureMorning,
-                                                                                                                                                                                                temperatureNight,
-                                                                                                                                                                                                temperatureMax,
-                                                                                                                                                                                                temperatureMin,
-                                                                                                                                                                                                pressure,
-                                                                                                                                                                                                humidity,
-                                                                                                                                                                                                cloudCoverage);
-
-                                       // add this day to the list
-                                       weatherDataList.add(dayWeather);
-                               }
-                       }
-
-                       // return the weather data to the caller
-                       return weatherDataList;
-               } catch (Exception e) {
-                       System.err.println("unable to load XML: ");
-                       e.printStackTrace();
-               }
-
-               // There was an error parsing so return null
-               return null;
-       }
-
-
-       /** Method to weather api specific location code for a given zipcode.
-        *
-        *   @param _zipcode [double], zipcode to lookup.
-        *
-        *   @return [double] weather api location code for the given zipcode.
-        */
-       private int getWeatherCode(int _zipcode) {
-
-               // used for reading the .csv files
-               BufferedReader bufferedReader = null;
-
-               // latitude and longitude of the zipcode, will stay -1 if zipcode not found
-               float locationLatitude = -1;
-               float locationLongitude = -1;
-
-
-               try {
-
-                       // Open the csv file
-                       //InputStream inputStream = this.getClass().getResourceAsStream(ZIPCODE_CSV_FILE);
-                       InputStream inputStream = new FileInputStream(new File(ZIPCODE_CSV_FILE));
-                       bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
-
-                       if (bufferedReader != null)
-                               System.out.println("DEBUG: Zip code file read successfully!");
-
-                       // read the .csv file line by line and parse the file
-                       String line = "";
-                       while ((line = bufferedReader.readLine()) != null) {
-
-                               // split lines on commas, should result in an array of strings of size 3
-                               String[] splitString = line.split(",");
-
-                               // make sure the line has the correct format
-                               if (splitString.length != 3) {
-                                       continue;
-                               }
-
-                               // parse the line for the individual data pieces
-                               int zipcodeValue = Integer.parseInt(splitString[0]);
-                               float latValue = Float.parseFloat(splitString[1]);
-                               float lonValue = Float.parseFloat(splitString[2]);
-
-                               // if the zipcode of this line matches the zipcode that was requested
-                               if (zipcodeValue == _zipcode) {
-
-                                       // It does get the lat and long
-                                       locationLatitude = latValue;
-                                       locationLongitude = lonValue;
-
-                                       // dont need to search anymore since we found the exact zipcode
-                                       break;
-                               }
-                       }
-
-               } catch (Exception e) {
-                       e.printStackTrace();
-               }
-               finally {
-
-                       // always close the file since we are going to use the buffered reader again
-                       if (bufferedReader != null) {
-                               try {
-                                       bufferedReader.close();
-                               } catch (IOException e) {
-                                       e.printStackTrace();
-                               }
-                       }
-               }
-
-               // if zipcode was not found then will be -1 and we should report an error
-               if (locationLatitude == -1) {
-                       return -1;
-               }
-
-               // reset so we can use it again
-               bufferedReader = null;
-
-               // used to store the closest location matched since lat and long may not match up exactly
-               float closestDistance = 100000;
-               int closestWeatherCode = 0;
-
-
-               try {
-                       // Open the csv file
-                       //InputStream inputStream = this.getClass().getResourceAsStream(AREA_CODE_CSV_FILE);
-                       InputStream inputStream = new FileInputStream(new File(AREA_CODE_CSV_FILE));
-                       bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
-
-                       if (bufferedReader != null)
-                               System.out.println("DEBUG: Area code file read successfully!");
-
-                       // read the .csv file line by line and parse the file
-                       String line = "";
-                       while ((line = bufferedReader.readLine()) != null) {
-
-                               // split lines on commas, should result in an array of strings of size 3
-                               String[] splitString = line.split(",");
-
-                               // make sure the line has the correct format
-                               if (splitString.length != 3) {
-                                       continue;
-                               }
-
-                               // parse the line for the individual data pieces
-                               int weatheCodeValue = Integer.parseInt(splitString[0]);
-                               float lonValue = Float.parseFloat(splitString[1]);
-                               float latValue = Float.parseFloat(splitString[2]);
-
-
-                               // calculate the distance from this lat long from the one matched to the zipcode
-                               float currDistance = (float)distance(latValue, lonValue, locationLatitude, locationLongitude);
-
-                               // of distance is closer
-                               if (currDistance <= closestDistance) {
-
-                                       // save this entry
-                                       closestDistance = currDistance;
-                                       closestWeatherCode = weatheCodeValue;
-                               }
-                       }
-               } catch (Exception e) {
-                       e.printStackTrace();
-               }
-               finally {
-
-                       // make sure we close the file
-                       if (bufferedReader != null) {
-                               try {
-                                       bufferedReader.close();
-                               } catch (IOException e) {
-                                       e.printStackTrace();
-                               }
-                       }
-               }
-
-               return closestWeatherCode;
-       }
-
-
-       /** Static Method to get distance from 2 latitude and longitude positions.
-        *   Adapted from https://www.geodatasource.com/developers/java
-        *
-        *   @param _lat1   [double], latitude pair 1.
-        *   @param _long1  [double], longitude pair 1.
-        *   @param _lat2   [double], latitude pair 2.
-        *   @param _long2  [double], longitude pair 2.
-        *
-        *   @return [double] distance in miles.
-        */
-       private static double distance(double _lat1, double _lon1, double _lat2, double _lon2) {
-               double theta = _lon1 - _lon2;
-               double dist = Math.sin(deg2rad(_lat1)) * Math.sin(deg2rad(_lat2)) + Math.cos(deg2rad(_lat1)) * Math.cos(deg2rad(_lat2)) * Math.cos(deg2rad(theta));
-               dist = Math.acos(dist);
-               dist = rad2deg(dist);
-               dist = dist * 60 * 1.1515;
-               return (dist);
-       }
-
-
-       /** Static Method convert degrees to radians.
-        *   Adapted from https://www.geodatasource.com/developers/java
-        *
-        *   @param _degree  [double], degrees.
-        *
-        *   @return [double] radians value.
-        */
-       private static double deg2rad(double _degree) {
-               return _degree * 3.141592653589793 / 180.0;
-       }
-
-
-       /** Static Method convert radians to degrees.
-        *   Adapted from https://www.geodatasource.com/developers/java
-        *
-        *   @param _rad  [double], radians.
-        *
-        *   @return [double] degrees value.
-        */
-       private static double rad2deg(double _rad) {
-               return _rad * 180.0 / 3.141592653589793;
-       }
-
-
-
-       /*******************************************************************************************************************************************
-       **  Main Method used for testing
-       *******************************************************************************************************************************************/
-/*     public static void main(String[] arrstring) {
-               System.out.println("WE ARE RUNNING!");
-
-
-               try {
-                       IoTAddress devAddress = new IoTAddress("api.openweathermap.org");
-                       WeatherGrabber we = new WeatherGrabber(devAddress);
-
-                       //List<DayWeather> dw = we.getWeatherData(92130, 16);
-                       List<DayWeather> dw = we.getWeatherData(92612, 255);
-
-
-                       for (DayWeather day : dw) {
-                               System.out.println(day);
-                       }
-
-               } catch (Exception e) {
-
-               }
-       }*/
-}
-
-
diff --git a/benchmarks/IrrigationController/help_files/city_list_us.json b/benchmarks/IrrigationController/help_files/city_list_us.json
deleted file mode 100644 (file)
index a14e7b0..0000000
+++ /dev/null
@@ -1,19972 +0,0 @@
-{"_id":4070245,"name":"Jones Crossroads","country":"US","coord":{"lon":-85.484657,"lat":31.21073}}
-{"_id":4344544,"name":"Vernon Parish","country":"US","coord":{"lon":-93.183502,"lat":31.11685}}
-{"_id":4215307,"name":"Pennick","country":"US","coord":{"lon":-81.55899,"lat":31.313}}
-{"_id":5285039,"name":"Black Bear Spring","country":"US","coord":{"lon":-110.288139,"lat":31.386209}}
-{"_id":4673179,"name":"Bee House","country":"US","coord":{"lon":-98.081139,"lat":31.40266}}
-{"_id":4047656,"name":"Provo","country":"US","coord":{"lon":-94.107697,"lat":34.037609}}
-{"_id":5493998,"name":"Tejon","country":"US","coord":{"lon":-105.28611,"lat":34.58979}}
-{"_id":5815135,"name":"Washington","country":"US","coord":{"lon":-120.501472,"lat":47.500118}}
-{"_id":5391891,"name":"San Dimas","country":"US","coord":{"lon":-117.806732,"lat":34.106682}}
-{"_id":4056099,"name":"Coffee County","country":"US","coord":{"lon":-86.000221,"lat":31.41683}}
-{"_id":4151245,"name":"Clay County","country":"US","coord":{"lon":-81.833153,"lat":29.99968}}
-{"_id":4155535,"name":"Flagler County","country":"US","coord":{"lon":-81.291451,"lat":29.45859}}
-{"_id":4158449,"name":"Hernando County","country":"US","coord":{"lon":-82.458153,"lat":28.541941}}
-{"_id":4174301,"name":"Sumter County","country":"US","coord":{"lon":-82.083138,"lat":28.708599}}
-{"_id":4196508,"name":"Fulton County","country":"US","coord":{"lon":-84.449928,"lat":33.766769}}
-{"_id":4191014,"name":"DeKalb County","country":"US","coord":{"lon":-84.233253,"lat":33.750381}}
-{"_id":4255818,"name":"Clark County","country":"US","coord":{"lon":-85.761353,"lat":38.483398}}
-{"_id":4310411,"name":"Sylvania","country":"US","coord":{"lon":-85.87413,"lat":38.157009}}
-{"_id":4287837,"name":"Clark County","country":"US","coord":{"lon":-84.266602,"lat":37.98341}}
-{"_id":4347820,"name":"City of Baltimore","country":"US","coord":{"lon":-76.61219,"lat":39.290379}}
-{"_id":7198188,"name":"Cashell Estates","country":"US","coord":{"lon":-77.138702,"lat":39.137199}}
-{"_id":4372589,"name":"Wakely Terrace","country":"US","coord":{"lon":-76.334961,"lat":39.525661}}
-{"_id":4406835,"name":"Saint Charles County","country":"US","coord":{"lon":-90.733459,"lat":38.76672}}
-{"_id":4407084,"name":"City of Saint Louis","country":"US","coord":{"lon":-90.197891,"lat":38.62727}}
-{"_id":4422178,"name":"Coahoma County","country":"US","coord":{"lon":-90.567879,"lat":34.217892}}
-{"_id":4431425,"name":"Jackson County","country":"US","coord":{"lon":-88.6278,"lat":30.42325}}
-{"_id":4481511,"name":"Nash County","country":"US","coord":{"lon":-77.96637,"lat":35.96682}}
-{"_id":4475520,"name":"Lee County","country":"US","coord":{"lon":-79.183083,"lat":35.46682}}
-{"_id":4527624,"name":"Warren County","country":"US","coord":{"lon":-84.166603,"lat":39.433392}}
-{"_id":4534444,"name":"Creek County","country":"US","coord":{"lon":-96.400291,"lat":35.900082}}
-{"_id":4592843,"name":"Richland County","country":"US","coord":{"lon":-80.916481,"lat":34.016819}}
-{"_id":4735729,"name":"Taylor County","country":"US","coord":{"lon":-99.833702,"lat":32.300129}}
-{"_id":4697444,"name":"Hidalgo County","country":"US","coord":{"lon":-98.200287,"lat":26.333679}}
-{"_id":4740157,"name":"Washington County","country":"US","coord":{"lon":-96.400238,"lat":30.233549}}
-{"_id":4739690,"name":"Walker County","country":"US","coord":{"lon":-95.566887,"lat":30.73353}}
-{"_id":4703071,"name":"Kerr County","country":"US","coord":{"lon":-99.300323,"lat":30.050211}}
-{"_id":4744106,"name":"City of Alexandria","country":"US","coord":{"lon":-77.046921,"lat":38.80484}}
-{"_id":4749005,"name":"City of Bristol","country":"US","coord":{"lon":-82.188469,"lat":36.596489}}
-{"_id":4752046,"name":"City of Charlottesville","country":"US","coord":{"lon":-78.476677,"lat":38.029308}}
-{"_id":4752215,"name":"City of Chesapeake","country":"US","coord":{"lon":-76.312157,"lat":36.687649}}
-{"_id":4753684,"name":"City of Colonial Heights","country":"US","coord":{"lon":-77.410263,"lat":37.244041}}
-{"_id":4755298,"name":"City of Danville","country":"US","coord":{"lon":-79.39502,"lat":36.585972}}
-{"_id":4758109,"name":"City of Fairfax","country":"US","coord":{"lon":-77.306374,"lat":38.846218}}
-{"_id":4760084,"name":"City of Fredericksburg","country":"US","coord":{"lon":-77.460541,"lat":38.303181}}
-{"_id":4763237,"name":"City of Harrisonburg","country":"US","coord":{"lon":-78.868919,"lat":38.44957}}
-{"_id":4764849,"name":"City of Hopewell","country":"US","coord":{"lon":-77.287201,"lat":37.304321}}
-{"_id":4771099,"name":"City of Lynchburg","country":"US","coord":{"lon":-79.14225,"lat":37.41375}}
-{"_id":4771426,"name":"City of Manassas","country":"US","coord":{"lon":-77.475273,"lat":38.75095}}
-{"_id":4776037,"name":"City of Newport News","country":"US","coord":{"lon":-76.508011,"lat":37.062649}}
-{"_id":4776242,"name":"City of Norfolk","country":"US","coord":{"lon":-76.261879,"lat":36.891258}}
-{"_id":4778642,"name":"City of Petersburg","country":"US","coord":{"lon":-77.401932,"lat":37.227928}}
-{"_id":4780019,"name":"City of Portsmouth","country":"US","coord":{"lon":-76.354668,"lat":36.85487}}
-{"_id":4780851,"name":"City of Radford","country":"US","coord":{"lon":-80.576447,"lat":37.13179}}
-{"_id":4781756,"name":"City of Richmond","country":"US","coord":{"lon":-77.460258,"lat":37.553761}}
-{"_id":4782241,"name":"City of Roanoke","country":"US","coord":{"lon":-79.941429,"lat":37.270969}}
-{"_id":4784205,"name":"City of Salem","country":"US","coord":{"lon":-80.054764,"lat":37.293468}}
-{"_id":4788160,"name":"City of Suffolk","country":"US","coord":{"lon":-76.608009,"lat":36.708481}}
-{"_id":4787467,"name":"City of Staunton","country":"US","coord":{"lon":-79.071701,"lat":38.149578}}
-{"_id":4792534,"name":"City of Waynesboro","country":"US","coord":{"lon":-78.889473,"lat":38.06847}}
-{"_id":4794134,"name":"City of Winchester","country":"US","coord":{"lon":-78.16333,"lat":39.185661}}
-{"_id":5151606,"name":"Cuyahoga County","country":"US","coord":{"lon":-81.666519,"lat":41.433392}}
-{"_id":4899519,"name":"Lee County","country":"US","coord":{"lon":-89.283432,"lat":41.750591}}
-{"_id":4898722,"name":"Knox County","country":"US","coord":{"lon":-90.200119,"lat":40.933369}}
-{"_id":5004681,"name":"Ottawa County","country":"US","coord":{"lon":-86.000603,"lat":42.95002}}
-{"_id":4985190,"name":"Bay County","country":"US","coord":{"lon":-84.016647,"lat":43.73336}}
-{"_id":5000477,"name":"Macomb County","country":"US","coord":{"lon":-82.949928,"lat":42.700031}}
-{"_id":4997130,"name":"Ingham County","country":"US","coord":{"lon":-84.383301,"lat":42.60004}}
-{"_id":5009706,"name":"Shiawassee County","country":"US","coord":{"lon":-84.149971,"lat":42.950031}}
-{"_id":5128316,"name":"Nassau County","country":"US","coord":{"lon":-73.582901,"lat":40.75066}}
-{"_id":6941775,"name":"Kings County","country":"US","coord":{"lon":-73.949577,"lat":40.650101}}
-{"_id":5113792,"name":"Cortland County","country":"US","coord":{"lon":-76.082977,"lat":42.600071}}
-{"_id":5112738,"name":"City Line","country":"US","coord":{"lon":-73.887077,"lat":40.676208}}
-{"_id":5118116,"name":"Fulton County","country":"US","coord":{"lon":-74.449577,"lat":43.116741}}
-{"_id":5122534,"name":"Jamestown","country":"US","coord":{"lon":-79.235329,"lat":42.097}}
-{"_id":6332485,"name":"Queensbridge Houses","country":"US","coord":{"lon":-73.945,"lat":40.75528}}
-{"_id":7250946,"name":"Carnegie Hill","country":"US","coord":{"lon":-73.95472,"lat":40.783329}}
-{"_id":5133668,"name":"Rensselaer County","country":"US","coord":{"lon":-73.482887,"lat":42.716751}}
-{"_id":5161640,"name":"Mahoning County","country":"US","coord":{"lon":-80.766472,"lat":41.03339}}
-{"_id":5151896,"name":"Delaware County","country":"US","coord":{"lon":-83.000183,"lat":40.266731}}
-{"_id":5145576,"name":"Allen County","country":"US","coord":{"lon":-84.083282,"lat":40.76672}}
-{"_id":5153362,"name":"Erie County","country":"US","coord":{"lon":-82.599899,"lat":41.350052}}
-{"_id":5221078,"name":"Bristol County","country":"US","coord":{"lon":-71.271721,"lat":41.71677}}
-{"_id":5393068,"name":"Santa Cruz County","country":"US","coord":{"lon":-122.051071,"lat":37.066608}}
-{"_id":5391997,"name":"San Francisco County","country":"US","coord":{"lon":-122.45108,"lat":37.766602}}
-{"_id":5423573,"name":"Grand Junction","country":"US","coord":{"lon":-108.550652,"lat":39.063869}}
-{"_id":5525886,"name":"Maverick County","country":"US","coord":{"lon":-100.350349,"lat":28.76692}}
-{"_id":5522430,"name":"Gray County","country":"US","coord":{"lon":-100.802002,"lat":35.416698}}
-{"_id":5128638,"name":"New York","country":"US","coord":{"lon":-75.499901,"lat":43.000351}}
-{"_id":7169710,"name":"City of Cape Canaveral","country":"US","coord":{"lon":-80.60567,"lat":28.39367}}
-{"_id":5415040,"name":"Broomfield County","country":"US","coord":{"lon":-105.086647,"lat":39.92054}}
-{"_id":5419396,"name":"Denver County","country":"US","coord":{"lon":-104.950539,"lat":39.666649}}
-{"_id":5420241,"name":"Durango","country":"US","coord":{"lon":-107.880074,"lat":37.27528}}
-{"_id":5431716,"name":"Montrose County","country":"US","coord":{"lon":-108.267303,"lat":38.416649}}
-{"_id":5445820,"name":"Liberal","country":"US","coord":{"lon":-100.920998,"lat":37.043079}}
-{"_id":5478585,"name":"McKinley County","country":"US","coord":{"lon":-109.033981,"lat":35.900009}}
-{"_id":5507669,"name":"Lyon County","country":"US","coord":{"lon":-119.126259,"lat":39.000198}}
-{"_id":5508180,"name":"Mesquite","country":"US","coord":{"lon":-114.067192,"lat":36.805531}}
-{"_id":5520910,"name":"Ector County","country":"US","coord":{"lon":-102.55043,"lat":31.866791}}
-{"_id":5781925,"name":"Spring Circle","country":"US","coord":{"lon":-111.854927,"lat":40.57217}}
-{"_id":5784685,"name":"Wheadon Acres","country":"US","coord":{"lon":-111.96299,"lat":40.560501}}
-{"_id":5790179,"name":"Clark County","country":"US","coord":{"lon":-122.484543,"lat":45.799839}}
-{"_id":5820705,"name":"Casper","country":"US","coord":{"lon":-106.31308,"lat":42.866631}}
-{"_id":4159872,"name":"Islandia","country":"US","coord":{"lon":-80.252548,"lat":25.37817}}
-{"_id":4736286,"name":"Texas","country":"US","coord":{"lon":-99.25061,"lat":31.250441}}
-{"_id":4676547,"name":"Brooks County","country":"US","coord":{"lon":-98.23362,"lat":27.033661}}
-{"_id":4714936,"name":"Noria Willie","country":"US","coord":{"lon":-98.127228,"lat":27.0856}}
-{"_id":4158643,"name":"Highlands County","country":"US","coord":{"lon":-81.349792,"lat":27.366989}}
-{"_id":4178270,"name":"Wild Island","country":"US","coord":{"lon":-81.203682,"lat":27.37282}}
-{"_id":4158712,"name":"Hillsborough County","country":"US","coord":{"lon":-82.349808,"lat":27.916969}}
-{"_id":7217562,"name":"Lindsey","country":"US","coord":{"lon":-82.211403,"lat":28.005199}}
-{"_id":4722147,"name":"Refugio County","country":"US","coord":{"lon":-97.166939,"lat":28.33362}}
-{"_id":4684064,"name":"Cranell","country":"US","coord":{"lon":-97.392769,"lat":28.16807}}
-{"_id":4678165,"name":"Calhoun County","country":"US","coord":{"lon":-96.61692,"lat":28.466949}}
-{"_id":4331987,"name":"Louisiana","country":"US","coord":{"lon":-92.000397,"lat":31.000469}}
-{"_id":4337452,"name":"Plaquemines Parish","country":"US","coord":{"lon":-89.700058,"lat":29.45022}}
-{"_id":4318404,"name":"Burrwood (historical)","country":"US","coord":{"lon":-89.377548,"lat":28.96829}}
-{"_id":4341715,"name":"Slagle","country":"US","coord":{"lon":-93.12738,"lat":31.20241}}
-{"_id":4056592,"name":"Conecuh County","country":"US","coord":{"lon":-86.983307,"lat":31.466829}}
-{"_id":4053940,"name":"Castleberry","country":"US","coord":{"lon":-87.022469,"lat":31.299061}}
-{"_id":4057517,"name":"Crenshaw County","country":"US","coord":{"lon":-86.316628,"lat":31.73349}}
-{"_id":4059229,"name":"Dozier","country":"US","coord":{"lon":-86.36496,"lat":31.492109}}
-{"_id":4695945,"name":"Hamilton County","country":"US","coord":{"lon":-98.083641,"lat":31.71682}}
-{"_id":4717770,"name":"Parsley Crossing","country":"US","coord":{"lon":-98.112259,"lat":31.567659}}
-{"_id":5308878,"name":"Pima County","country":"US","coord":{"lon":-112.003464,"lat":32.000351}}
-{"_id":7262440,"name":"Valencia West","country":"US","coord":{"lon":-111.114143,"lat":32.132381}}
-{"_id":5319409,"name":"Vanar","country":"US","coord":{"lon":-109.095062,"lat":32.241192}}
-{"_id":4316180,"name":"Bedford","country":"US","coord":{"lon":-91.015106,"lat":32.240978}}
-{"_id":5454967,"name":"Alvarado","country":"US","coord":{"lon":-106.237213,"lat":32.13649}}
-{"_id":4445717,"name":"Shavers (historical)","country":"US","coord":{"lon":-88.530037,"lat":33.25568}}
-{"_id":5524819,"name":"Lakeview","country":"US","coord":{"lon":-102.050453,"lat":33.326481}}
-{"_id":4180067,"name":"Apollo (historical)","country":"US","coord":{"lon":-83.527672,"lat":33.36541}}
-{"_id":4694710,"name":"Grayson County","country":"US","coord":{"lon":-96.683601,"lat":33.616772}}
-{"_id":5368381,"name":"Los Angeles County","country":"US","coord":{"lon":-118.200912,"lat":34.366661}}
-{"_id":4187459,"name":"Chattooga County","country":"US","coord":{"lon":-85.33329,"lat":34.466751}}
-{"_id":4224239,"name":"Sprite","country":"US","coord":{"lon":-85.39579,"lat":34.288429}}
-{"_id":4589213,"name":"Newberry County","country":"US","coord":{"lon":-81.616501,"lat":34.30014}}
-{"_id":4587774,"name":"Mount Bethel (historical)","country":"US","coord":{"lon":-81.562332,"lat":34.3382}}
-{"_id":4583989,"name":"Kershaw County","country":"US","coord":{"lon":-80.56646,"lat":34.45015}}
-{"_id":5306372,"name":"Nelson","country":"US","coord":{"lon":-113.320213,"lat":35.51416}}
-{"_id":4550954,"name":"Schoolton","country":"US","coord":{"lon":-96.458618,"lat":35.391739}}
-{"_id":4460324,"name":"Chatham County","country":"US","coord":{"lon":-79.266411,"lat":35.700142}}
-{"_id":4619773,"name":"Dyer County","country":"US","coord":{"lon":-89.40007,"lat":36.050072}}
-{"_id":4652680,"name":"Rehoboth","country":"US","coord":{"lon":-89.25563,"lat":36.032291}}
-{"_id":4896861,"name":"Illinois","country":"US","coord":{"lon":-89.250366,"lat":40.00032}}
-{"_id":4748806,"name":"Breaks","country":"US","coord":{"lon":-82.280983,"lat":37.29594}}
-{"_id":5341170,"name":"Curry Village","country":"US","coord":{"lon":-119.572662,"lat":37.73687}}
-{"_id":5413481,"name":"Bent County","country":"US","coord":{"lon":-103.067146,"lat":37.966671}}
-{"_id":5436536,"name":"Riverdale","country":"US","coord":{"lon":-103.316597,"lat":38.05862}}
-{"_id":5435436,"name":"Prowers County","country":"US","coord":{"lon":-102.400467,"lat":37.966679}}
-{"_id":4048572,"name":"Rowan County","country":"US","coord":{"lon":-83.433243,"lat":38.183411}}
-{"_id":5354590,"name":"Guadalcanal Village","country":"US","coord":{"lon":-122.293861,"lat":38.11853}}
-{"_id":5539525,"name":"Garfield County","country":"US","coord":{"lon":-111.501282,"lat":37.750542}}
-{"_id":5446275,"name":"Ravanna","country":"US","coord":{"lon":-100.382362,"lat":38.15974}}
-{"_id":5435465,"name":"Pueblo County","country":"US","coord":{"lon":-104.483856,"lat":38.183338}}
-{"_id":5435047,"name":"Poncha Springs","country":"US","coord":{"lon":-106.07724,"lat":38.512779}}
-{"_id":5376101,"name":"Napa County","country":"US","coord":{"lon":-122.334419,"lat":38.483238}}
-{"_id":5386729,"name":"Redbud Park (historical)","country":"US","coord":{"lon":-122.137199,"lat":38.519348}}
-{"_id":5396498,"name":"Sloughhouse","country":"US","coord":{"lon":-121.19384,"lat":38.495739}}
-{"_id":5420926,"name":"El Paso County","country":"US","coord":{"lon":-104.517189,"lat":38.833328}}
-{"_id":5442076,"name":"Truckton","country":"US","coord":{"lon":-104.182182,"lat":38.738049}}
-{"_id":5445498,"name":"Grainfield","country":"US","coord":{"lon":-100.465141,"lat":39.113621}}
-{"_id":5427526,"name":"Kit Carson County","country":"US","coord":{"lon":-102.567139,"lat":39.299992}}
-{"_id":5514336,"name":"Vanderbilt (historical)","country":"US","coord":{"lon":-115.978394,"lat":39.424648}}
-{"_id":5446632,"name":"Thomas County","country":"US","coord":{"lon":-101.05043,"lat":39.349998}}
-{"_id":5424440,"name":"Harris Park","country":"US","coord":{"lon":-105.491112,"lat":39.511662}}
-{"_id":5095971,"name":"Brindletown","country":"US","coord":{"lon":-74.50515,"lat":40.04734}}
-{"_id":5576103,"name":"Crisman","country":"US","coord":{"lon":-105.361382,"lat":40.040821}}
-{"_id":5583173,"name":"Ward","country":"US","coord":{"lon":-105.508331,"lat":40.072208}}
-{"_id":5074889,"name":"Pawnee City","country":"US","coord":{"lon":-96.154449,"lat":40.10833}}
-{"_id":5162774,"name":"Miami County","country":"US","coord":{"lon":-84.233276,"lat":40.050049}}
-{"_id":5162767,"name":"Meyers (historical)","country":"US","coord":{"lon":-84.317169,"lat":40.131439}}
-{"_id":5565500,"name":"Humboldt County","country":"US","coord":{"lon":-123.917831,"lat":40.666519}}
-{"_id":5565253,"name":"Honeydew","country":"US","coord":{"lon":-124.122818,"lat":40.244308}}
-{"_id":5171871,"name":"Shelby County","country":"US","coord":{"lon":-84.183281,"lat":40.316719}}
-{"_id":7729130,"name":"Lakeside Village","country":"US","coord":{"lon":-84.184998,"lat":40.293892}}
-{"_id":5560570,"name":"Bull Creek","country":"US","coord":{"lon":-124.026428,"lat":40.33569}}
-{"_id":5444907,"name":"Yuma County","country":"US","coord":{"lon":-102.433807,"lat":39.983318}}
-{"_id":5771084,"name":"Barro","country":"US","coord":{"lon":-113.488876,"lat":40.726879}}
-{"_id":5081111,"name":"Verona","country":"US","coord":{"lon":-97.966164,"lat":40.553619}}
-{"_id":5171643,"name":"Seneca County","country":"US","coord":{"lon":-83.116577,"lat":41.116718}}
-{"_id":5172848,"name":"Springville","country":"US","coord":{"lon":-83.386589,"lat":41.009781}}
-{"_id":5696463,"name":"Jacinto","country":"US","coord":{"lon":-103.404099,"lat":41.225811}}
-{"_id":4861712,"name":"Indiana","country":"US","coord":{"lon":-93.0252,"lat":41.204441}}
-{"_id":5205930,"name":"Pike County","country":"US","coord":{"lon":-75.124893,"lat":41.50037}}
-{"_id":4861743,"name":"Indiantown (historical)","country":"US","coord":{"lon":-95.108047,"lat":41.312489}}
-{"_id":5825405,"name":"Fort LaClede (historical)","country":"US","coord":{"lon":-108.389267,"lat":41.415241}}
-{"_id":4880695,"name":"Warren County","country":"US","coord":{"lon":-93.550217,"lat":41.333328}}
-{"_id":4870622,"name":"Palmyra","country":"US","coord":{"lon":-93.438271,"lat":41.4361}}
-{"_id":4926802,"name":"Steubenville","country":"US","coord":{"lon":-85.022743,"lat":41.532269}}
-{"_id":5562484,"name":"Del Norte County","country":"US","coord":{"lon":-123.901176,"lat":41.699841}}
-{"_id":5128148,"name":"Mundale","country":"US","coord":{"lon":-75.049606,"lat":42.25481}}
-{"_id":5823980,"name":"Dwyer Junction","country":"US","coord":{"lon":-104.994972,"lat":42.234692}}
-{"_id":5610054,"name":"Three Creek","country":"US","coord":{"lon":-115.1595,"lat":42.071301}}
-{"_id":4932165,"name":"Camp Wyoma","country":"US","coord":{"lon":-73.125381,"lat":42.428421}}
-{"_id":5138846,"name":"South Gilboa Station","country":"US","coord":{"lon":-74.562653,"lat":42.410912}}
-{"_id":5138935,"name":"South New Berlin","country":"US","coord":{"lon":-75.385178,"lat":42.529518}}
-{"_id":4936231,"name":"Farnams","country":"US","coord":{"lon":-73.185661,"lat":42.541752}}
-{"_id":4997811,"name":"Kalamo","country":"US","coord":{"lon":-85.012772,"lat":42.542809}}
-{"_id":5586500,"name":"Bonneville County","country":"US","coord":{"lon":-111.50106,"lat":43.41658}}
-{"_id":5609454,"name":"Swan Valley","country":"US","coord":{"lon":-111.341621,"lat":43.456032}}
-{"_id":5094264,"name":"Warren","country":"US","coord":{"lon":-71.892029,"lat":43.923119}}
-{"_id":5590266,"name":"Crystal (historical)","country":"US","coord":{"lon":-114.32589,"lat":44.267422}}
-{"_id":5117867,"name":"Franklin County","country":"US","coord":{"lon":-74.349609,"lat":44.650051}}
-{"_id":5587585,"name":"Cabarton","country":"US","coord":{"lon":-116.040131,"lat":44.435452}}
-{"_id":5598464,"name":"Lemhi County","country":"US","coord":{"lon":-114.00119,"lat":45.666592}}
-{"_id":5584508,"name":"Baker","country":"US","coord":{"lon":-113.734512,"lat":45.09465}}
-{"_id":5259487,"name":"Langlade County","country":"US","coord":{"lon":-89.05011,"lat":45.250519}}
-{"_id":5016060,"name":"Albion Center","country":"US","coord":{"lon":-94.073593,"lat":45.17691}}
-{"_id":5731315,"name":"Hilgard","country":"US","coord":{"lon":-118.227997,"lat":45.35207}}
-{"_id":5032867,"name":"Kandiyohi County","country":"US","coord":{"lon":-95.000839,"lat":45.133301}}
-{"_id":5606338,"name":"Sampson","country":"US","coord":{"lon":-116.008469,"lat":45.51767}}
-{"_id":5692786,"name":"Walser Crossing","country":"US","coord":{"lon":-103.596298,"lat":46.619179}}
-{"_id":5796126,"name":"Grays Harbor County","country":"US","coord":{"lon":-123.83461,"lat":47.083149}}
-{"_id":5811704,"name":"Spokane County","country":"US","coord":{"lon":-117.367706,"lat":47.616562}}
-{"_id":5812148,"name":"Stevens County","country":"US","coord":{"lon":-117.834419,"lat":48.433231}}
-{"_id":7260215,"name":"Tyndall Air Force Base","country":"US","coord":{"lon":-85.607307,"lat":30.08535}}
-{"_id":4345638,"name":"Weil","country":"US","coord":{"lon":-92.560699,"lat":31.31185}}
-{"_id":5039807,"name":"Noyes","country":"US","coord":{"lon":-97.204514,"lat":48.99749}}
-{"_id":5790289,"name":"Clearbrook","country":"US","coord":{"lon":-122.32238,"lat":48.978729}}
-{"_id":5322021,"name":"Young","country":"US","coord":{"lon":-110.963737,"lat":34.101429}}
-{"_id":4658872,"name":"South Dyersburg","country":"US","coord":{"lon":-89.391182,"lat":36.01952}}
-{"_id":4603330,"name":"Atwood","country":"US","coord":{"lon":-88.678108,"lat":35.973122}}
-{"_id":5365687,"name":"Le Grand","country":"US","coord":{"lon":-120.24823,"lat":37.22855}}
-{"_id":5425180,"name":"Hoehne","country":"US","coord":{"lon":-104.381088,"lat":37.281132}}
-{"_id":5386335,"name":"Ravenswood","country":"US","coord":{"lon":-122.135239,"lat":37.47633}}
-{"_id":4521978,"name":"Prospect","country":"US","coord":{"lon":-83.563812,"lat":39.135071}}
-{"_id":5784492,"name":"Wendover","country":"US","coord":{"lon":-114.037514,"lat":40.737148}}
-{"_id":4920512,"name":"Fremont","country":"US","coord":{"lon":-84.932739,"lat":41.730881}}
-{"_id":5120956,"name":"Hogansburg","country":"US","coord":{"lon":-74.663239,"lat":44.973942}}
-{"_id":5039576,"name":"North Redwood","country":"US","coord":{"lon":-95.094437,"lat":44.56329}}
-{"_id":5036727,"name":"Marshall","country":"US","coord":{"lon":-95.788353,"lat":44.446899}}
-{"_id":5040864,"name":"Parkwood Estates","country":"US","coord":{"lon":-95.084717,"lat":45.130001}}
-{"_id":5266230,"name":"Park Falls","country":"US","coord":{"lon":-90.441551,"lat":45.934399}}
-{"_id":5046026,"name":"Sauk Centre","country":"US","coord":{"lon":-94.952522,"lat":45.737461}}
-{"_id":4404807,"name":"Pulaski County","country":"US","coord":{"lon":-92.200172,"lat":37.83337}}
-{"_id":5758058,"name":"Umatilla County","country":"US","coord":{"lon":-118.50135,"lat":45.50013}}
-{"_id":5053645,"name":"Zimmerman Terrace","country":"US","coord":{"lon":-93.583611,"lat":45.448608}}
-{"_id":5398597,"name":"Stanislaus County","country":"US","coord":{"lon":-121.001602,"lat":37.549931}}
-{"_id":5094497,"name":"West Brookline","country":"US","coord":{"lon":-71.679237,"lat":42.736198}}
-{"_id":5421327,"name":"Estabrook","country":"US","coord":{"lon":-105.429443,"lat":39.383041}}
-{"_id":5231992,"name":"Spink County","country":"US","coord":{"lon":-98.317039,"lat":44.936081}}
-{"_id":5332628,"name":"Calaveras County","country":"US","coord":{"lon":-120.584373,"lat":38.166592}}
-{"_id":5343792,"name":"Douds Landing","country":"US","coord":{"lon":-120.32547,"lat":38.2127}}
-{"_id":4163123,"name":"Macon","country":"US","coord":{"lon":-84.279068,"lat":30.49464}}
-{"_id":4186876,"name":"Cedar Hill","country":"US","coord":{"lon":-83.76545,"lat":34.022331}}
-{"_id":5392329,"name":"San Luis Obispo County","country":"US","coord":{"lon":-120.534332,"lat":35.366638}}
-{"_id":5530531,"name":"Shafter","country":"US","coord":{"lon":-104.303253,"lat":29.820169}}
-{"_id":4261996,"name":"Navilleton","country":"US","coord":{"lon":-85.938583,"lat":38.381729}}
-{"_id":4919627,"name":"Deming","country":"US","coord":{"lon":-86.098602,"lat":40.115311}}
-{"_id":4978496,"name":"Shermans Corner","country":"US","coord":{"lon":-69.006416,"lat":44.45813}}
-{"_id":5160581,"name":"Lemoyne","country":"US","coord":{"lon":-83.474098,"lat":41.495892}}
-{"_id":4177409,"name":"Walton County","country":"US","coord":{"lon":-86.166611,"lat":30.62575}}
-{"_id":4165763,"name":"New Harmony","country":"US","coord":{"lon":-86.279953,"lat":30.853519}}
-{"_id":4343122,"name":"Tangipahoa Parish","country":"US","coord":{"lon":-90.400093,"lat":30.666849}}
-{"_id":4992137,"name":"Emmet County","country":"US","coord":{"lon":-84.916718,"lat":45.53334}}
-{"_id":4987969,"name":"Canby Corners","country":"US","coord":{"lon":-84.915329,"lat":45.63612}}
-{"_id":5755890,"name":"Talent","country":"US","coord":{"lon":-122.788651,"lat":42.245682}}
-{"_id":4880327,"name":"Volga","country":"US","coord":{"lon":-91.540977,"lat":42.80471}}
-{"_id":4693922,"name":"Goliad County","country":"US","coord":{"lon":-97.433601,"lat":28.65027}}
-{"_id":5205669,"name":"Perry County","country":"US","coord":{"lon":-77.249992,"lat":40.500359}}
-{"_id":5186715,"name":"Dellville","country":"US","coord":{"lon":-77.115807,"lat":40.363972}}
-{"_id":5021676,"name":"Cloverleaf Mobile Home Community","country":"US","coord":{"lon":-94.138893,"lat":45.57222}}
-{"_id":7261046,"name":"Cayuse","country":"US","coord":{"lon":-118.566116,"lat":45.67643}}
-{"_id":4085392,"name":"Ramer","country":"US","coord":{"lon":-86.221352,"lat":32.05043}}
-{"_id":4905232,"name":"Palm Beach","country":"US","coord":{"lon":-88.197311,"lat":42.37669}}
-{"_id":4917545,"name":"Alida","country":"US","coord":{"lon":-86.903084,"lat":41.510601}}
-{"_id":4456938,"name":"Brake","country":"US","coord":{"lon":-77.737747,"lat":35.92321}}
-{"_id":4122327,"name":"Mound City","country":"US","coord":{"lon":-90.129257,"lat":35.190369}}
-{"_id":4935951,"name":"Essex County","country":"US","coord":{"lon":-70.832832,"lat":42.666759}}
-{"_id":4405434,"name":"Republic","country":"US","coord":{"lon":-93.480186,"lat":37.120049}}
-{"_id":5078878,"name":"Shelton","country":"US","coord":{"lon":-98.730911,"lat":40.779179}}
-{"_id":5551665,"name":"Arizona City","country":"US","coord":{"lon":-111.670959,"lat":32.75589}}
-{"_id":4368320,"name":"Saint Mary's County","country":"US","coord":{"lon":-76.616348,"lat":38.300129}}
-{"_id":7208522,"name":"Pin Oak Village","country":"US","coord":{"lon":-95.803001,"lat":29.7665}}
-{"_id":4578104,"name":"Fairtraid","country":"US","coord":{"lon":-78.979477,"lat":33.873779}}
-{"_id":4341377,"name":"Sheltons","country":"US","coord":{"lon":-91.907349,"lat":32.8293}}
-{"_id":4422833,"name":"Country Club Subdivision","country":"US","coord":{"lon":-88.806442,"lat":33.423458}}
-{"_id":4712711,"name":"Mount Enterprise","country":"US","coord":{"lon":-94.681038,"lat":31.91795}}
-{"_id":5424865,"name":"Hermosa","country":"US","coord":{"lon":-107.835342,"lat":37.415279}}
-{"_id":5363907,"name":"La Fetra","country":"US","coord":{"lon":-117.881447,"lat":34.138901}}
-{"_id":5064432,"name":"Boone County","country":"US","coord":{"lon":-98.083672,"lat":41.700008}}
-{"_id":7201401,"name":"Carlyle West","country":"US","coord":{"lon":-73.830559,"lat":42.935558}}
-{"_id":5139023,"name":"South Westerlo","country":"US","coord":{"lon":-74.027077,"lat":42.447861}}
-{"_id":4461697,"name":"Contentnea Junction","country":"US","coord":{"lon":-77.93248,"lat":35.678211}}
-{"_id":4475980,"name":"Lincoln Heights","country":"US","coord":{"lon":-77.904709,"lat":35.69405}}
-{"_id":4527720,"name":"Waterloo","country":"US","coord":{"lon":-82.784897,"lat":39.83979}}
-{"_id":5268838,"name":"Richfield","country":"US","coord":{"lon":-88.193977,"lat":43.256119}}
-{"_id":4599503,"name":"Vaughans Crossroads","country":"US","coord":{"lon":-80.102287,"lat":34.208771}}
-{"_id":4421547,"name":"Choctaw County","country":"US","coord":{"lon":-89.237572,"lat":33.340401}}
-{"_id":5312572,"name":"Saint David","country":"US","coord":{"lon":-110.214241,"lat":31.904249}}
-{"_id":4723416,"name":"Rockwell","country":"US","coord":{"lon":-95.549683,"lat":33.591221}}
-{"_id":4919277,"name":"Cook","country":"US","coord":{"lon":-87.469757,"lat":41.377258}}
-{"_id":4985016,"name":"Barry County","country":"US","coord":{"lon":-85.316673,"lat":42.60004}}
-{"_id":5273134,"name":"Sidney","country":"US","coord":{"lon":-90.638748,"lat":44.552738}}
-{"_id":4494053,"name":"Sunny View","country":"US","coord":{"lon":-82.187889,"lat":35.374279}}
-{"_id":4988619,"name":"Cheboygan County","country":"US","coord":{"lon":-84.500587,"lat":45.450008}}
-{"_id":4913764,"name":"Tomahawk Bluff","country":"US","coord":{"lon":-89.08342,"lat":41.380589}}
-{"_id":4290651,"name":"Dykes","country":"US","coord":{"lon":-84.435768,"lat":37.068138}}
-{"_id":7247870,"name":"Cozy Acres","country":"US","coord":{"lon":-81.63694,"lat":40.658329}}
-{"_id":5723848,"name":"Drake Crossing","country":"US","coord":{"lon":-122.655922,"lat":44.925961}}
-{"_id":5564102,"name":"Gas Point","country":"US","coord":{"lon":-122.534462,"lat":40.415428}}
-{"_id":4926474,"name":"Sloan","country":"US","coord":{"lon":-87.476128,"lat":40.301979}}
-{"_id":5340687,"name":"Creston","country":"US","coord":{"lon":-120.523773,"lat":35.51886}}
-{"_id":4364519,"name":"Oliver Beach","country":"US","coord":{"lon":-76.342743,"lat":39.37289}}
-{"_id":5128581,"name":"New York","country":"US","coord":{"lon":-74.005966,"lat":40.714272}}
-{"_id":4179320,"name":"Albany","country":"US","coord":{"lon":-84.155739,"lat":31.57851}}
-{"_id":4351021,"name":"Charles County","country":"US","coord":{"lon":-76.983032,"lat":38.483459}}
-{"_id":4532136,"name":"Canadian County","country":"US","coord":{"lon":-97.983658,"lat":35.533379}}
-{"_id":4703486,"name":"Kleberg County","country":"US","coord":{"lon":-97.716942,"lat":27.433649}}
-{"_id":4885392,"name":"Boone County","country":"US","coord":{"lon":-88.816772,"lat":42.333351}}
-{"_id":5046749,"name":"Scott County","country":"US","coord":{"lon":-93.500793,"lat":44.633301}}
-{"_id":5141784,"name":"Ulster County","country":"US","coord":{"lon":-74.250153,"lat":41.88343}}
-{"_id":5128594,"name":"New York County","country":"US","coord":{"lon":-73.966248,"lat":40.783428}}
-{"_id":5217179,"name":"Verona","country":"US","coord":{"lon":-79.843102,"lat":40.506458}}
-{"_id":5251040,"name":"Dunn County","country":"US","coord":{"lon":-91.883507,"lat":44.949959}}
-{"_id":5430806,"name":"Mesa County","country":"US","coord":{"lon":-108.467308,"lat":39.033321}}
-{"_id":5417258,"name":"Clifton","country":"US","coord":{"lon":-108.448982,"lat":39.09193}}
-{"_id":5709906,"name":"Washoe County","country":"US","coord":{"lon":-119.626312,"lat":40.750179}}
-{"_id":5528613,"name":"Potter County","country":"US","coord":{"lon":-101.900459,"lat":35.416721}}
-{"_id":5523520,"name":"Howard County","country":"US","coord":{"lon":-101.450401,"lat":32.300121}}
-{"_id":4106979,"name":"Craighead County","country":"US","coord":{"lon":-90.650108,"lat":35.816738}}
-{"_id":7232148,"name":"Pleasant Prairie Mobile Home Court","country":"US","coord":{"lon":-87.950829,"lat":42.581669}}
-{"_id":5278089,"name":"Waupaca County","country":"US","coord":{"lon":-88.983437,"lat":44.466648}}
-{"_id":5813521,"name":"Thurston County","country":"US","coord":{"lon":-122.817909,"lat":46.916489}}
-{"_id":5235681,"name":"East Clarendon","country":"US","coord":{"lon":-72.938988,"lat":43.524792}}
-{"_id":5527151,"name":"Nolan County","country":"US","coord":{"lon":-100.417053,"lat":32.300121}}
-{"_id":7209040,"name":"Allen Farms","country":"US","coord":{"lon":-95.291199,"lat":29.6409}}
-{"_id":7208536,"name":"Pinewood Place","country":"US","coord":{"lon":-95.556198,"lat":30.080099}}
-{"_id":5528185,"name":"Pecos County","country":"US","coord":{"lon":-102.750992,"lat":30.75071}}
-{"_id":5525208,"name":"Little Mexico Colonia","country":"US","coord":{"lon":-102.878487,"lat":30.918209}}
-{"_id":4682392,"name":"Coleman County","country":"US","coord":{"lon":-99.45034,"lat":31.78348}}
-{"_id":5712716,"name":"Basque","country":"US","coord":{"lon":-117.868477,"lat":42.410721}}
-{"_id":5717316,"name":"Cairo","country":"US","coord":{"lon":-117.009048,"lat":43.995998}}
-{"_id":5736643,"name":"Lincoln County","country":"US","coord":{"lon":-123.834557,"lat":44.666512}}
-{"_id":5731612,"name":"Holiday Beach","country":"US","coord":{"lon":-124.068169,"lat":44.567619}}
-{"_id":4543342,"name":"Muskogee County","country":"US","coord":{"lon":-95.33358,"lat":35.583431}}
-{"_id":4540737,"name":"Lawton","country":"US","coord":{"lon":-98.390327,"lat":34.608688}}
-{"_id":4537289,"name":"Frederick","country":"US","coord":{"lon":-99.01841,"lat":34.392029}}
-{"_id":4529531,"name":"Artillery Village","country":"US","coord":{"lon":-98.41394,"lat":34.638962}}
-{"_id":4539265,"name":"Imo","country":"US","coord":{"lon":-97.977837,"lat":36.35392}}
-{"_id":4531980,"name":"Calera","country":"US","coord":{"lon":-96.428596,"lat":33.93454}}
-{"_id":4538808,"name":"Hird","country":"US","coord":{"lon":-96.651962,"lat":34.810638}}
-{"_id":8063054,"name":"White Hill","country":"US","coord":{"lon":-81.4813,"lat":41.57674}}
-{"_id":5148672,"name":"Bulah","country":"US","coord":{"lon":-80.668411,"lat":41.782001}}
-{"_id":5139942,"name":"Stoodley Corners","country":"US","coord":{"lon":-73.933182,"lat":42.868961}}
-{"_id":5514318,"name":"Valley View","country":"US","coord":{"lon":-117.224533,"lat":38.068272}}
-{"_id":5512515,"name":"Sloan","country":"US","coord":{"lon":-115.217216,"lat":35.943588}}
-{"_id":4500561,"name":"Atlantic County","country":"US","coord":{"lon":-74.666267,"lat":39.466782}}
-{"_id":4459620,"name":"Catherine Lake","country":"US","coord":{"lon":-77.563858,"lat":34.817661}}
-{"_id":7122887,"name":"Mobile Court East","country":"US","coord":{"lon":-95.748329,"lat":48.84861}}
-{"_id":5030862,"name":"Hubbard County","country":"US","coord":{"lon":-94.900291,"lat":47.09996}}
-{"_id":5024544,"name":"Douglas County","country":"US","coord":{"lon":-95.450317,"lat":45.933289}}
-{"_id":4929772,"name":"Barnstable County","country":"US","coord":{"lon":-70.249458,"lat":41.666779}}
-{"_id":5733534,"name":"Jefferson County","country":"US","coord":{"lon":-121.334488,"lat":44.633171}}
-{"_id":5738690,"name":"Madras","country":"US","coord":{"lon":-121.129494,"lat":44.63345}}
-{"_id":4858159,"name":"Gas Light Mobile Home Villa","country":"US","coord":{"lon":-92.41658,"lat":42.54137}}
-{"_id":4857406,"name":"Forest City","country":"US","coord":{"lon":-93.637161,"lat":43.262459}}
-{"_id":4167465,"name":"Page Park","country":"US","coord":{"lon":-81.86203,"lat":26.579241}}
-{"_id":7190149,"name":"Ocean Waterway Mobile Home Park","country":"US","coord":{"lon":-80.158791,"lat":26.059799}}
-{"_id":7150586,"name":"Countryside","country":"US","coord":{"lon":-105.119438,"lat":39.88583}}
-{"_id":5427691,"name":"La Fruto","country":"US","coord":{"lon":-105.898628,"lat":37.41473}}
-{"_id":5364038,"name":"La Patera","country":"US","coord":{"lon":-119.842079,"lat":34.4375}}
-{"_id":5377708,"name":"North Norton","country":"US","coord":{"lon":-117.252823,"lat":34.105572}}
-{"_id":5398168,"name":"Spreckels Junction","country":"US","coord":{"lon":-121.630783,"lat":36.658291}}
-{"_id":5323121,"name":"Alisal","country":"US","coord":{"lon":-121.617722,"lat":36.679131}}
-{"_id":5323012,"name":"Alessandro","country":"US","coord":{"lon":-117.270317,"lat":33.886131}}
-{"_id":5325943,"name":"Ballou","country":"US","coord":{"lon":-117.607002,"lat":34.049179}}
-{"_id":5331874,"name":"Burdell","country":"US","coord":{"lon":-122.565262,"lat":38.15797}}
-{"_id":5372844,"name":"Middleton","country":"US","coord":{"lon":-122.263031,"lat":38.206581}}
-{"_id":5342441,"name":"Del Rey Oaks","country":"US","coord":{"lon":-121.834953,"lat":36.593288}}
-{"_id":5371068,"name":"Mather Field","country":"US","coord":{"lon":-121.29689,"lat":38.56657}}
-{"_id":5332698,"name":"Calexico","country":"US","coord":{"lon":-115.498878,"lat":32.678951}}
-{"_id":5321473,"name":"Winslow","country":"US","coord":{"lon":-110.697357,"lat":35.024189}}
-{"_id":4059870,"name":"East Florence","country":"US","coord":{"lon":-87.649467,"lat":34.809528}}
-{"_id":4053062,"name":"Calhoun County","country":"US","coord":{"lon":-85.849968,"lat":33.750381}}
-{"_id":4081914,"name":"Oxford","country":"US","coord":{"lon":-85.834961,"lat":33.614269}}
-{"_id":4120792,"name":"Maumelle","country":"US","coord":{"lon":-92.40432,"lat":34.86676}}
-{"_id":4152574,"name":"Cutler Ridge","country":"US","coord":{"lon":-80.346718,"lat":25.58066}}
-{"_id":4156018,"name":"Fort Pierce","country":"US","coord":{"lon":-80.325607,"lat":27.446711}}
-{"_id":4161178,"name":"Lake Butler","country":"US","coord":{"lon":-81.540909,"lat":28.501671}}
-{"_id":4163049,"name":"Lynn Haven","country":"US","coord":{"lon":-85.648262,"lat":30.24548}}
-{"_id":4166195,"name":"North Fort Myers","country":"US","coord":{"lon":-81.880089,"lat":26.66729}}
-{"_id":4167694,"name":"Panama City","country":"US","coord":{"lon":-85.659828,"lat":30.15946}}
-{"_id":4176380,"name":"Venice","country":"US","coord":{"lon":-82.454262,"lat":27.099779}}
-{"_id":4181936,"name":"Belvedere Park","country":"US","coord":{"lon":-84.267418,"lat":33.754829}}
-{"_id":4185657,"name":"Calhoun","country":"US","coord":{"lon":-84.95105,"lat":34.50259}}
-{"_id":4193699,"name":"Evans","country":"US","coord":{"lon":-82.130669,"lat":33.533749}}
-{"_id":4235668,"name":"Charleston","country":"US","coord":{"lon":-88.176147,"lat":39.496151}}
-{"_id":4241704,"name":"Jacksonville","country":"US","coord":{"lon":-90.229012,"lat":39.73394}}
-{"_id":4244099,"name":"Mattoon","country":"US","coord":{"lon":-88.372833,"lat":39.483089}}
-{"_id":4265737,"name":"Terre Haute","country":"US","coord":{"lon":-87.41391,"lat":39.466702}}
-{"_id":4292686,"name":"Georgetown","country":"US","coord":{"lon":-84.55883,"lat":38.209801}}
-{"_id":4294494,"name":"Henderson","country":"US","coord":{"lon":-87.590012,"lat":37.836151}}
-{"_id":4302035,"name":"Murray","country":"US","coord":{"lon":-88.314758,"lat":36.610329}}
-{"_id":4303436,"name":"Owensboro","country":"US","coord":{"lon":-87.113327,"lat":37.77422}}
-{"_id":4305504,"name":"Radcliff","country":"US","coord":{"lon":-85.949127,"lat":37.840351}}
-{"_id":4305974,"name":"Richmond","country":"US","coord":{"lon":-84.294647,"lat":37.74786}}
-{"_id":4313697,"name":"Winchester","country":"US","coord":{"lon":-84.179649,"lat":37.990082}}
-{"_id":4317639,"name":"Bossier City","country":"US","coord":{"lon":-93.732117,"lat":32.515991}}
-{"_id":4333669,"name":"Monroe","country":"US","coord":{"lon":-92.119301,"lat":32.509312}}
-{"_id":4338012,"name":"Prairieville","country":"US","coord":{"lon":-90.972054,"lat":30.302971}}
-{"_id":4356783,"name":"Green Haven","country":"US","coord":{"lon":-76.547737,"lat":39.139549}}
-{"_id":4368711,"name":"Salisbury","country":"US","coord":{"lon":-75.599373,"lat":38.360668}}
-{"_id":4386289,"name":"Farmington","country":"US","coord":{"lon":-90.421791,"lat":37.78088}}
-{"_id":4406282,"name":"Rolla","country":"US","coord":{"lon":-91.771271,"lat":37.951431}}
-{"_id":4407010,"name":"Saint Joseph","country":"US","coord":{"lon":-94.846626,"lat":39.768608}}
-{"_id":4413595,"name":"Warrensburg","country":"US","coord":{"lon":-93.736053,"lat":38.762791}}
-{"_id":4418478,"name":"Biloxi","country":"US","coord":{"lon":-88.885307,"lat":30.39603}}
-{"_id":4419290,"name":"Brandon","country":"US","coord":{"lon":-89.985924,"lat":32.273201}}
-{"_id":4422133,"name":"Clinton","country":"US","coord":{"lon":-90.321762,"lat":32.34153}}
-{"_id":4429295,"name":"Hattiesburg","country":"US","coord":{"lon":-89.290337,"lat":31.32712}}
-{"_id":4434663,"name":"Madison","country":"US","coord":{"lon":-90.115356,"lat":32.461811}}
-{"_id":4440076,"name":"Oxford","country":"US","coord":{"lon":-89.519249,"lat":34.366501}}
-{"_id":4465088,"name":"Elizabeth City","country":"US","coord":{"lon":-76.251053,"lat":36.294601}}
-{"_id":4493316,"name":"Statesville","country":"US","coord":{"lon":-80.887299,"lat":35.782639}}
-{"_id":4525353,"name":"Springfield","country":"US","coord":{"lon":-83.808823,"lat":39.924229}}
-{"_id":4531405,"name":"Broken Arrow","country":"US","coord":{"lon":-95.790817,"lat":36.052601}}
-{"_id":4535783,"name":"El Reno","country":"US","coord":{"lon":-97.955048,"lat":35.532269}}
-{"_id":4543338,"name":"Muskogee","country":"US","coord":{"lon":-95.36969,"lat":35.747879}}
-{"_id":4550659,"name":"Sand Springs","country":"US","coord":{"lon":-96.108887,"lat":36.139809}}
-{"_id":4552707,"name":"Tahlequah","country":"US","coord":{"lon":-94.969963,"lat":35.915371}}
-{"_id":4562144,"name":"West Chester","country":"US","coord":{"lon":-75.605492,"lat":39.960659}}
-{"_id":4593724,"name":"Saint Andrews","country":"US","coord":{"lon":-81.129257,"lat":34.045429}}
-{"_id":4597499,"name":"Saint Andrews","country":"US","coord":{"lon":-81.103149,"lat":34.048759}}
-{"_id":4619800,"name":"Dyersburg","country":"US","coord":{"lon":-89.385628,"lat":36.034519}}
-{"_id":4626334,"name":"Greeneville","country":"US","coord":{"lon":-82.830994,"lat":36.163158}}
-{"_id":4646571,"name":"Oak Ridge","country":"US","coord":{"lon":-84.269638,"lat":36.010361}}
-{"_id":4657077,"name":"Shelbyville","country":"US","coord":{"lon":-86.460274,"lat":35.48341}}
-{"_id":4659446,"name":"Spring Hill","country":"US","coord":{"lon":-86.93,"lat":35.751179}}
-{"_id":4663494,"name":"Tullahoma","country":"US","coord":{"lon":-86.209427,"lat":35.362019}}
-{"_id":4670074,"name":"Alamo","country":"US","coord":{"lon":-98.123062,"lat":26.183689}}
-{"_id":4673425,"name":"Belton","country":"US","coord":{"lon":-97.464447,"lat":31.056009}}
-{"_id":4686593,"name":"Donna","country":"US","coord":{"lon":-98.051949,"lat":26.170349}}
-{"_id":4688275,"name":"Edinburg","country":"US","coord":{"lon":-98.163338,"lat":26.301741}}
-{"_id":4693150,"name":"Gatesville","country":"US","coord":{"lon":-97.743912,"lat":31.43516}}
-{"_id":4703223,"name":"Killeen","country":"US","coord":{"lon":-97.727798,"lat":31.117121}}
-{"_id":4704628,"name":"Lake Jackson","country":"US","coord":{"lon":-95.434387,"lat":29.033859}}
-{"_id":4705349,"name":"Laredo","country":"US","coord":{"lon":-99.507538,"lat":27.506411}}
-{"_id":4708308,"name":"Lufkin","country":"US","coord":{"lon":-94.729103,"lat":31.33824}}
-{"_id":4716805,"name":"Orange","country":"US","coord":{"lon":-93.736549,"lat":30.092991}}
-{"_id":4726440,"name":"San Juan","country":"US","coord":{"lon":-98.155289,"lat":26.18924}}
-{"_id":4728328,"name":"Sherman","country":"US","coord":{"lon":-96.608879,"lat":33.635658}}
-{"_id":4829791,"name":"Albertville","country":"US","coord":{"lon":-86.20887,"lat":34.26759}}
-{"_id":4830198,"name":"Anniston","country":"US","coord":{"lon":-85.831627,"lat":33.659828}}
-{"_id":4846960,"name":"Ankeny","country":"US","coord":{"lon":-93.605766,"lat":41.72971}}
-{"_id":4852065,"name":"Clive","country":"US","coord":{"lon":-93.724113,"lat":41.603039}}
-{"_id":4866445,"name":"Mason City","country":"US","coord":{"lon":-93.201042,"lat":43.153568}}
-{"_id":4868907,"name":"Newton","country":"US","coord":{"lon":-93.047981,"lat":41.699711}}
-{"_id":4870380,"name":"Ottumwa","country":"US","coord":{"lon":-92.411301,"lat":41.020012}}
-{"_id":4880889,"name":"Waterloo","country":"US","coord":{"lon":-92.342957,"lat":42.49276}}
-{"_id":4881346,"name":"West Des Moines","country":"US","coord":{"lon":-93.745308,"lat":41.571991}}
-{"_id":4888015,"name":"Cicero","country":"US","coord":{"lon":-87.753937,"lat":41.845589}}
-{"_id":4889426,"name":"Danville","country":"US","coord":{"lon":-87.63002,"lat":40.124481}}
-{"_id":4931429,"name":"Brockton","country":"US","coord":{"lon":-71.018379,"lat":42.083431}}
-{"_id":4991735,"name":"Eastpointe","country":"US","coord":{"lon":-82.955467,"lat":42.468369}}
-{"_id":4995514,"name":"Haslett","country":"US","coord":{"lon":-84.401077,"lat":42.746979}}
-{"_id":5001929,"name":"Midland","country":"US","coord":{"lon":-84.247208,"lat":43.615582}}
-{"_id":5004359,"name":"Okemos","country":"US","coord":{"lon":-84.427467,"lat":42.72226}}
-{"_id":5036420,"name":"Mankato","country":"US","coord":{"lon":-93.999397,"lat":44.163582}}
-{"_id":5040647,"name":"Owatonna","country":"US","coord":{"lon":-93.226044,"lat":44.083851}}
-{"_id":5046001,"name":"Sartell","country":"US","coord":{"lon":-94.20694,"lat":45.621632}}
-{"_id":5053156,"name":"Winona","country":"US","coord":{"lon":-91.63932,"lat":44.049961}}
-{"_id":5107505,"name":"Auburn","country":"US","coord":{"lon":-76.566048,"lat":42.931728}}
-{"_id":5112078,"name":"Central Islip","country":"US","coord":{"lon":-73.201782,"lat":40.790649}}
-{"_id":5116303,"name":"Eggertsville","country":"US","coord":{"lon":-78.803917,"lat":42.96339}}
-{"_id":5118743,"name":"Gloversville","country":"US","coord":{"lon":-74.34375,"lat":43.052849}}
-{"_id":5122432,"name":"Ithaca","country":"US","coord":{"lon":-76.496613,"lat":42.440632}}
-{"_id":5131692,"name":"Plattsburgh","country":"US","coord":{"lon":-73.452911,"lat":44.69949}}
-{"_id":5142056,"name":"Utica","country":"US","coord":{"lon":-75.232658,"lat":43.100899}}
-{"_id":5146256,"name":"Austintown","country":"US","coord":{"lon":-80.764519,"lat":41.101719}}
-{"_id":5155207,"name":"Fremont","country":"US","coord":{"lon":-83.121857,"lat":41.35033}}
-{"_id":5195561,"name":"Johnstown","country":"US","coord":{"lon":-78.921967,"lat":40.32674}}
-{"_id":5216895,"name":"Upper Saint Clair","country":"US","coord":{"lon":-80.083389,"lat":40.335899}}
-{"_id":5231851,"name":"Sioux Falls","country":"US","coord":{"lon":-96.700333,"lat":43.549969}}
-{"_id":5245193,"name":"Beaver Dam","country":"US","coord":{"lon":-88.837334,"lat":43.457771}}
-{"_id":5257754,"name":"Janesville","country":"US","coord":{"lon":-89.018723,"lat":42.682789}}
-{"_id":5265838,"name":"Oshkosh","country":"US","coord":{"lon":-88.54261,"lat":44.024712}}
-{"_id":5274644,"name":"Stevens Point","country":"US","coord":{"lon":-89.574562,"lat":44.523579}}
-{"_id":5278120,"name":"Wausau","country":"US","coord":{"lon":-89.630119,"lat":44.959141}}
-{"_id":5280822,"name":"Weirton Heights","country":"US","coord":{"lon":-80.539238,"lat":40.408401}}
-{"_id":5287262,"name":"Buckeye","country":"US","coord":{"lon":-112.583778,"lat":33.370319}}
-{"_id":5309858,"name":"Prescott Valley","country":"US","coord":{"lon":-112.325249,"lat":34.589409}}
-{"_id":5325111,"name":"Atascadero","country":"US","coord":{"lon":-120.670731,"lat":35.489422}}
-{"_id":5336269,"name":"Chico","country":"US","coord":{"lon":-121.837479,"lat":39.728489}}
-{"_id":5338122,"name":"Clovis","country":"US","coord":{"lon":-119.702919,"lat":36.82523}}
-{"_id":5339539,"name":"Corcoran","country":"US","coord":{"lon":-119.560402,"lat":36.098011}}
-{"_id":5343171,"name":"Dinuba","country":"US","coord":{"lon":-119.38707,"lat":36.543282}}
-{"_id":5359864,"name":"Isla Vista","country":"US","coord":{"lon":-119.86097,"lat":34.41333}}
-{"_id":5369367,"name":"Lynwood","country":"US","coord":{"lon":-118.211456,"lat":33.93029}}
-{"_id":5377100,"name":"Nipomo","country":"US","coord":{"lon":-120.475998,"lat":35.042751}}
-{"_id":5378500,"name":"Oakdale","country":"US","coord":{"lon":-120.847153,"lat":37.76659}}
-{"_id":5380626,"name":"Palm Desert","country":"US","coord":{"lon":-116.374458,"lat":33.72224}}
-{"_id":5381515,"name":"Patterson","country":"US","coord":{"lon":-121.129662,"lat":37.4716}}
-{"_id":5386984,"name":"Reedley","country":"US","coord":{"lon":-119.450401,"lat":36.59634}}
-{"_id":5392090,"name":"San Jacinto","country":"US","coord":{"lon":-116.958641,"lat":33.783909}}
-{"_id":5392528,"name":"San Pedro","country":"US","coord":{"lon":-118.29229,"lat":33.735851}}
-{"_id":5394136,"name":"Seaside","country":"US","coord":{"lon":-121.851624,"lat":36.611069}}
-{"_id":5404024,"name":"Turlock","country":"US","coord":{"lon":-120.846588,"lat":37.494659}}
-{"_id":5406222,"name":"Victorville","country":"US","coord":{"lon":-117.291161,"lat":34.53611}}
-{"_id":5406567,"name":"Visalia","country":"US","coord":{"lon":-119.292061,"lat":36.330231}}
-{"_id":5416005,"name":"Canon City","country":"US","coord":{"lon":-105.242447,"lat":38.440979}}
-{"_id":5454627,"name":"Alamogordo","country":"US","coord":{"lon":-105.960258,"lat":32.899529}}
-{"_id":5475352,"name":"Las Cruces","country":"US","coord":{"lon":-106.778343,"lat":32.312321}}
-{"_id":5488441,"name":"Roswell","country":"US","coord":{"lon":-104.523018,"lat":33.394272}}
-{"_id":5504003,"name":"Fernley","country":"US","coord":{"lon":-119.251831,"lat":39.607971}}
-{"_id":5509403,"name":"North Las Vegas","country":"US","coord":{"lon":-115.1175,"lat":36.19886}}
-{"_id":5516233,"name":"Amarillo","country":"US","coord":{"lon":-101.831299,"lat":35.222}}
-{"_id":5527554,"name":"Odessa","country":"US","coord":{"lon":-102.367638,"lat":31.84568}}
-{"_id":5530022,"name":"San Angelo","country":"US","coord":{"lon":-100.437042,"lat":31.46377}}
-{"_id":5601538,"name":"Moscow","country":"US","coord":{"lon":-117.000168,"lat":46.732391}}
-{"_id":5660340,"name":"Kalispell","country":"US","coord":{"lon":-114.312912,"lat":48.195789}}
-{"_id":5754005,"name":"Springfield","country":"US","coord":{"lon":-123.022034,"lat":44.046242}}
-{"_id":5781070,"name":"Sandy Hills","country":"US","coord":{"lon":-111.850769,"lat":40.581059}}
-{"_id":5808276,"name":"Richland","country":"US","coord":{"lon":-119.284462,"lat":46.28569}}
-{"_id":5810490,"name":"Silverdale","country":"US","coord":{"lon":-122.69487,"lat":47.644539}}
-{"_id":5852275,"name":"Pearl City","country":"US","coord":{"lon":-157.973328,"lat":21.397221}}
-{"_id":5854686,"name":"Waipahu","country":"US","coord":{"lon":-158.009171,"lat":21.386669}}
-{"_id":5855070,"name":"Ewa Gentry","country":"US","coord":{"lon":-158.030823,"lat":21.34417}}
-{"_id":5855927,"name":"Hilo","country":"US","coord":{"lon":-155.089996,"lat":19.729719}}
-{"_id":6332439,"name":"Alafaya","country":"US","coord":{"lon":-81.211403,"lat":28.5641}}
-{"_id":6941080,"name":"Fort Bragg","country":"US","coord":{"lon":-79.006027,"lat":35.139}}
-{"_id":7262761,"name":"Makakilo","country":"US","coord":{"lon":-158.086548,"lat":21.352369}}
-{"_id":6252001,"name":"United States","country":"US","coord":{"lon":-98.5,"lat":39.759998}}
-{"_id":4155751,"name":"Florida","country":"US","coord":{"lon":-82.500099,"lat":28.75054}}
-{"_id":4164238,"name":"Miami-Dade County","country":"US","coord":{"lon":-80.533112,"lat":25.61705}}
-{"_id":4068296,"name":"Houston County","country":"US","coord":{"lon":-85.316597,"lat":31.150181}}
-{"_id":5290270,"name":"Cochise County","country":"US","coord":{"lon":-109.742287,"lat":31.93203}}
-{"_id":4683477,"name":"Coryell County","country":"US","coord":{"lon":-97.800301,"lat":31.383499}}
-{"_id":4718267,"name":"Pecan Wells","country":"US","coord":{"lon":-98.371429,"lat":31.57655}}
-{"_id":5297410,"name":"Harrington Place","country":"US","coord":{"lon":-110.546738,"lat":32.04258}}
-{"_id":5236279,"name":"Franklin County","country":"US","coord":{"lon":-72.866249,"lat":44.850052}}
-{"_id":5235775,"name":"East Richford","country":"US","coord":{"lon":-72.58596,"lat":45.011162}}
-{"_id":5302611,"name":"Lone Butte Ranch","country":"US","coord":{"lon":-112.047089,"lat":33.232552}}