Commit f7247350 authored by Harshith Goka's avatar Harshith Goka

Merge branch 'dynamic' of github.com:harshithxD/DDC into dynamic

parents 6df9528e daf773c8
# Dextera Domini Client Application
package com.example.harshith.ddc; package com.example.harshith.ddc;
import java.lang.reflect.Array; import java.util.ArrayList;
import java.util.Queue; import java.util.Iterator;
class DynamicQueue{ class DynamicQueue{
public int noOfSlots = 2000; public int noOfSlots = 2000;
public int noOfGestures; public int noOfGestures;
public DynamicGesture [] gesture; public DynamicGesture [] gesture;
public int [][] dtwGap; public ArrayList [][] dtwGap;
public Live []liveElement; public Live []liveElement;
public boolean [][]shortlist; public boolean [][]shortlist;
public int latestElement = 0; public int latestElement = 0;
public int foremostElement = 0; public int foremostElement = 0;
public int[] threshold; public int[] threshold;
public double alterFactor = -1;
public DynamicQueue(DynamicGesture []gest,int[] threshold){ public DynamicQueue(DynamicGesture []gest,int[] threshold){
gesture = gest.clone(); gesture = gest.clone();
...@@ -33,7 +34,12 @@ class DynamicQueue{ ...@@ -33,7 +34,12 @@ class DynamicQueue{
} }
} }
dtwGap = new int[noOfSlots][noOfGestures]; dtwGap = new ArrayList[noOfSlots][noOfGestures];
for (int i=0; i<noOfSlots; i++) {
for(int j=0; j<noOfGestures; j++){
dtwGap[i][j] = new ArrayList();
}
}
} }
public void overflowCheck(){ public void overflowCheck(){
...@@ -124,7 +130,7 @@ class DynamicQueue{ ...@@ -124,7 +130,7 @@ class DynamicQueue{
int[][] gestarraytemp = validSensorArrayComp(i); int[][] gestarraytemp = validSensorArrayComp(i);
x.arrayInput(gestarraytemp, arraytemp); x.arrayInput(gestarraytemp, arraytemp);
dtwGap[slotNo][i] = x.sdtwDistance(); dtwGap[slotNo][i].add( Math.max( 0.0, ((double)(x.sdtwDistance() + dtwGap[slotNo][i].size()*alterFactor)) ) );
} }
for (int i=0; i<noOfGestures; i++) { for (int i=0; i<noOfGestures; i++) {
if(dtwGap[slotNo][i]>=threshold[i]) shortlist[slotNo][i] = false; if(dtwGap[slotNo][i]>=threshold[i]) shortlist[slotNo][i] = false;
......
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