Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
dcdb
dcdb
Commits
120ab444
Commit
120ab444
authored
Mar 09, 2020
by
Weronika Filinger
Browse files
Merge branch 'development' of
https://gitlab.lrz.de/dcdb/dcdb
into development
parents
2c3b1382
59262a4f
Changes
3
Hide whitespace changes
Inline
Side-by-side
analytics/operators/clustering/ClusteringOperator.cpp
View file @
120ab444
...
...
@@ -177,10 +177,12 @@ void ClusteringOperator::compute(U_Ptr unit) {
void
ClusteringOperator
::
computeFeatureVector
(
U_Ptr
unit
,
uint64_t
offset
)
{
_currentfVector
=
cv
::
Mat
(
1
,
unit
->
getInputs
().
size
(),
CV_32F
);
std
::
vector
<
ClusteringSBPtr
>&
inputs
=
unit
->
getInputs
();
uint64_t
endTs
=
getTimestamp
()
-
offset
;
uint64_t
startTs
=
endTs
-
_aggregationWindow
;
for
(
size_t
idx
=
0
;
idx
<
inputs
.
size
();
idx
++
)
{
_mean
=
0
;
_buffer
.
clear
();
if
(
!
_queryEngine
.
querySensor
(
inputs
[
idx
]
->
getName
(),
_aggregationWindow
-
offset
,
offset
,
_buffer
)
||
_buffer
.
empty
())
if
(
!
_queryEngine
.
querySensor
(
inputs
[
idx
]
->
getName
(),
startTs
,
endTs
,
_buffer
,
false
)
||
_buffer
.
empty
())
throw
std
::
runtime_error
(
"Operator "
+
_name
+
": cannot read from sensor "
+
inputs
[
idx
]
->
getName
()
+
"!"
);
// Computing MEAN
...
...
analytics/operators/regressor/RegressorOperator.cpp
View file @
120ab444
...
...
@@ -187,11 +187,13 @@ void RegressorOperator::computeFeatureVector(U_Ptr unit) {
_currentfVector
=
new
cv
::
Mat
(
1
,
unit
->
getInputs
().
size
()
*
REG_NUMFEATURES
,
CV_32F
);
int64_t
val
;
size_t
qId
,
qMod
,
idx
,
fIdx
;
uint64_t
endTs
=
getTimestamp
();
uint64_t
startTs
=
endTs
-
_aggregationWindow
;
std
::
vector
<
RegressorSBPtr
>&
inputs
=
unit
->
getInputs
();
for
(
idx
=
0
;
idx
<
inputs
.
size
();
idx
++
)
{
_mean
=
0
;
_std
=
0
;
_diffsum
=
0
;
_qtl25
=
0
;
_qtl75
=
0
;
_buffer
.
clear
();
if
(
!
_queryEngine
.
querySensor
(
inputs
[
idx
]
->
getName
(),
_aggregationWindow
,
0
,
_buffer
)
||
_buffer
.
empty
())
if
(
!
_queryEngine
.
querySensor
(
inputs
[
idx
]
->
getName
(),
startTs
,
endTs
,
_buffer
,
false
)
||
_buffer
.
empty
())
throw
std
::
runtime_error
(
"Operator "
+
_name
+
": cannot read from sensor "
+
inputs
[
idx
]
->
getName
()
+
"!"
);
if
(
inputs
[
idx
]
->
getTrainingTarget
())
_currentTarget
=
(
float
)
_buffer
.
back
().
value
;
...
...
analytics/operators/smoothing/SmoothingOperator.cpp
View file @
120ab444
...
...
@@ -47,10 +47,11 @@ void SmoothingOperator::compute(U_Ptr unit) {
// Clearing the buffer
_buffer
.
clear
();
SmoothingSBPtr
sIn
=
unit
->
getInputs
()[
0
],
sOut
=
unit
->
getOutputs
()[
0
];
uint64_t
startTs
=
sOut
->
getTimestamp
()
?
getTimestamp
()
-
sOut
->
getTimestamp
()
:
0
;
uint64_t
endTs
=
getTimestamp
();
uint64_t
startTs
=
sOut
->
getTimestamp
()
?
sOut
->
getTimestamp
()
:
endTs
;
// Throwing an error does not make sense here - the query will often fail depending on insert batching
if
(
!
_queryEngine
.
querySensor
(
sIn
->
getName
(),
startTs
,
0
,
_buffer
,
tru
e
))
if
(
!
_queryEngine
.
querySensor
(
sIn
->
getName
(),
startTs
,
endTs
,
_buffer
,
fals
e
))
return
;
for
(
const
auto
&
v
:
_buffer
)
{
...
...
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