Commit 8f11fdf2 authored by Harshith Goka's avatar Harshith Goka

Integrated LinkedList for the queue

parent dca046b5
...@@ -53,12 +53,16 @@ class DynamicQueue{ ...@@ -53,12 +53,16 @@ class DynamicQueue{
liveElement.add(live); liveElement.add(live);
//[latestElement] = new Live(live); //[latestElement] = new Live(live);
dtwGap.add((new ArrayList[noOfGestures]));
Boolean [] trueBool = new Boolean[noOfGestures]; Boolean [] trueBool = new Boolean[noOfGestures];
for (int i=0; i<noOfGestures; i++) { for (int i=0; i<noOfGestures; i++) {
trueBool[i] = true; trueBool[i] = new Boolean(true);
dtwGap.getLast()[i] = new ArrayList();
} }
shortlist.add(trueBool); shortlist.add(trueBool);
//overflowCheck(); //overflowCheck();
} }
...@@ -129,10 +133,16 @@ class DynamicQueue{ ...@@ -129,10 +133,16 @@ class DynamicQueue{
int[][] gestarraytemp = validSensorArrayComp(i); int[][] gestarraytemp = validSensorArrayComp(i);
x.arrayInput(gestarraytemp, arraytemp); x.arrayInput(gestarraytemp, arraytemp);
dtwGap.get(slotNo)[i].add( Math.max( 0.0, ((double)(x.sdtwDistance() + dtwGap.get(slotNo)[i].size()*alterFactor)) ) ); dtwGap.get(slotNo)[i].add( Math.max( 0.0, x.sdtwDistance() + dtwGap.get(slotNo)[i].size()*alterFactor));
// dtwGap.get(slotNo)[i].add(100.0);
} }
for (int i=0; i<noOfGestures; i++) { for (int i=0; i<noOfGestures; i++) {
if( (new Double((double)dtwGap.get(slotNo)[i].get(dtwGap.get(slotNo)[i].size()-1)).intValue() ) >=threshold[i]) shortlist.get(slotNo)[i] = false; // shortlist.add(new Boolean[noOfGestures]);
if( (new Double((double)dtwGap.get(slotNo)[i].get(dtwGap.get(slotNo)[i].size()-1)).intValue() ) >=threshold[i]) shortlist.get(slotNo)[i] = new Boolean(false);
else {
shortlist.get(slotNo)[i] = new Boolean(true);
}
} }
} }
......
...@@ -182,7 +182,7 @@ public class ReceiveDataThread extends Thread { ...@@ -182,7 +182,7 @@ public class ReceiveDataThread extends Thread {
threshold[indx] = 40; threshold[indx] = 40;
threshold = new int[]{40,40,40,40,40,40,40,40,40,40,40,40}; threshold = new int[]{0,0,0,0,0,0,0,0,0,0,0,0};
DynamicQueue q = new DynamicQueue(a,threshold); DynamicQueue q = new DynamicQueue(a,threshold);
Live dynamiclive = new Live(); Live dynamiclive = new Live();
...@@ -191,7 +191,6 @@ public class ReceiveDataThread extends Thread { ...@@ -191,7 +191,6 @@ public class ReceiveDataThread extends Thread {
int bytes = -1; int bytes = -1;
String readMessage; String readMessage;
int i, counter = 1; int i, counter = 1;
convert();
while(true) { while(true) {
bytes = inputStream.read(buffer); bytes = inputStream.read(buffer);
readStatus = Constants.READ_STATUS_OK; readStatus = Constants.READ_STATUS_OK;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment