Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
DDC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GOKA HARSHITH
DDC
Commits
8f11fdf2
Commit
8f11fdf2
authored
Jun 30, 2016
by
Harshith Goka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrated LinkedList for the queue
parent
dca046b5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
app/src/main/java/com/example/harshith/ddc/DynamicQueue.java
app/src/main/java/com/example/harshith/ddc/DynamicQueue.java
+13
-3
app/src/main/java/com/example/harshith/ddc/ReceiveDataThread.java
...main/java/com/example/harshith/ddc/ReceiveDataThread.java
+1
-2
No files found.
app/src/main/java/com/example/harshith/ddc/DynamicQueue.java
View file @
8f11fdf2
...
@@ -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
);
}
}
}
}
}
...
...
app/src/main/java/com/example/harshith/ddc/ReceiveDataThread.java
View file @
8f11fdf2
...
@@ -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
,
4
0
};
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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment