Skip to content
Snippets Groups Projects

Feature/forgetting in wm and em

Merged Fabian Tërnava requested to merge feature/forgetting-in-wm-and-em into master
Compare and
24 files
+ 696
42
Compare changes
  • Side-by-side
  • Inline
Files
24
@@ -2,11 +2,11 @@
#include <functional>
// BaseClass
#include "MemoryItem.h"
// ChildType
#include "CoreSegmentBase.h"
// ArmarX
#include <ArmarXCore/core/Component.h>
@@ -18,6 +18,7 @@
#include <RobotAPI/libraries/armem/core/wm/aron_conversions.h>
#include <RobotAPI/libraries/armem/core/wm/memory_definitions.h>
#include <RobotAPI/libraries/armem/server/wm/memory_definitions.h>
#include <RobotAPI/libraries/armem/server/test/ForgettingExperiments.h>
namespace armarx::armem::server::ltm::detail
{
@@ -136,12 +137,13 @@ namespace armarx::armem::server::ltm::detail
void
store(const armem::wm::Memory& memory)
{
ARMARX_INFO << deactivateSpam() << "Memory stored";
TIMING_START(LTM_Memory_Append);
for (auto& f : processors->memFilters)
{
if (!f->accept(memory))
{
ARMARX_INFO << deactivateSpam()
ARMARX_INFO
<< "Ignoring to put a Memory into the LTM because it got filtered.";
return;
}
@@ -188,6 +190,8 @@ namespace armarx::armem::server::ltm::detail
stopRecording()
{
disable();
//This can hold information abut the filter statistics, if the LTM recording is properly ended
getFilterStatistics();
}
bool
@@ -211,6 +215,13 @@ namespace armarx::armem::server::ltm::detail
return statistics;
}
std::map<std::string, processor::SnapshotFilter::FilterStatistics>
getFilterStatistics(){
auto stats = processors->getSnapshotFilterStatistics();
test::save_statistics(stats);
return stats;
}
/// get level name
static std::string
getLevelName()
@@ -248,9 +259,12 @@ namespace armarx::armem::server::ltm::detail
// stuff for scenario parameters
struct Properties
{
bool enabled_on_startup = false;
bool enabled_on_startup = true;
std::string configuration_on_startup =
"{\"SnapshotFrequencyFilter\": { \"WaitingTimeInMs\": 1000}, \"PngConverter\": {}}";
"{"
"\"SnapshotSimilarityFilter\": { \"Threshold\": 20},"
" \"PngConverter\": {}"
"}";
} p;
protected:
Loading