Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RobotAPI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software
ArmarX
RobotAPI
Commits
ec9dbfe6
Commit
ec9dbfe6
authored
2 years ago
by
Joana Plewnia
Browse files
Options
Downloads
Patches
Plain Diff
test commit
parent
da8da00c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!322
Feature/forgetting in wm and em
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/RobotAPI/libraries/armem/server/ltm/base/detail/Processors.cpp
+41
-2
41 additions, 2 deletions
...API/libraries/armem/server/ltm/base/detail/Processors.cpp
with
41 additions
and
2 deletions
source/RobotAPI/libraries/armem/server/ltm/base/detail/Processors.cpp
+
41
−
2
View file @
ec9dbfe6
#include
"Processors.h"
#include
<fstream>
namespace
armarx
::
armem
::
server
::
ltm
{
Processors
::
Processors
()
...
...
@@ -14,8 +16,45 @@ namespace armarx::armem::server::ltm
converters
.
insert
({
exrConverter
.
identifier
,
&
exrConverter
});
}
void
Processors
::
configure
(
const
nlohmann
::
json
&
config
)
void
Processors
::
configure
(
const
nlohmann
::
json
&
config
)
{
std
::
ifstream
s
(
"/home/joana/Documents/PDF Dateien/Frequency_Memory_Example.json"
);
nlohmann
::
json
jf
=
nlohmann
::
json
::
parse
(
s
);
auto
filter_type
=
jf
[
"Name"
].
get
<
std
::
string
>
();
auto
item_type
=
jf
[
"MemoryType"
].
get
<
std
::
string
>
();
ARMARX_INFO
<<
"Loaded filter of type "
<<
filter_type
<<
" and item type: "
<<
item_type
;
if
(
filter_type
==
"Equality"
)
{
snapEqFilter
.
maxWaitingTimeInMs
=
jf
[
"Parameters"
][
"maxWaitingTimeInMs"
].
get
<
std
::
int32_t
>
();
snapEqFilter
.
enabled
=
true
;
snapFreqFilter
.
enabled
=
false
;
memFreqFilter
.
enabled
=
false
;
}
else
if
(
filter_type
==
"Frequency"
)
{
auto
memory_type
=
jf
[
"MemoryType"
].
get
<
std
::
string
>
();
if
(
memory_type
==
"Memory"
)
{
memFreqFilter
.
enabled
=
true
;
memFreqFilter
.
waitingTimeInMs
=
jf
[
"Parameters"
][
"waitingTimeInMs"
].
get
<
std
::
int32_t
>
();
ARMARX_INFO
<<
"Parameter waiting time set to: "
<<
jf
[
"Parameters"
][
"waitingTimeInMs"
].
get
<
std
::
int32_t
>
();
snapFreqFilter
.
enabled
=
false
;
}
else
if
(
memory_type
==
"Snapshot"
)
{
snapFreqFilter
.
enabled
=
true
;
snapFreqFilter
.
waitingTimeInMs
=
jf
[
"Parameters"
][
"waitingTimeInMs"
].
get
<
std
::
int32_t
>
();
ARMARX_INFO
<<
"Parameter waiting time set to: "
<<
jf
[
"Parameters"
][
"waitingTimeInMs"
].
get
<
std
::
int32_t
>
();
memFreqFilter
.
enabled
=
false
;
snapEqFilter
.
enabled
=
false
;
}
}
}
}
}
// namespace armarx::armem::server::ltm
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment