Filter.h
Go to the documentation of this file.
1 #pragma once
2 
3 // STD/STL
4 #include <memory>
5 
6 // Simox
7 #include <SimoxUtility/json.h>
8 
9 // ArmarX
13 
15 {
17  {
18  public:
19  MemoryFilter() = default;
20  virtual ~MemoryFilter() = default;
21 
22  virtual bool accept(const armem::wm::Memory& e) = 0;
23  virtual void configure(const nlohmann::json& json);
24  };
25 
27  {
28  public:
29  SnapshotFilter() = default;
30  virtual ~SnapshotFilter() = default;
31 
32  virtual bool accept(const armem::wm::EntitySnapshot& e) = 0;
33  virtual void configure(const nlohmann::json& json);
34 
36  double accepted = 0;
37  double rejected = 0;
38  std::chrono::duration<double> additional_time = std::chrono::duration<double>::zero();
39  std::string additional_info = "";
41  std::chrono::high_resolution_clock::time_point start_time;
42  std::chrono::high_resolution_clock::time_point end_time;
44  std::string importance_type = "";
45  } stats;
46 
48  virtual std::string getName();
49 
50  /**
51  * @brief resetStatisticsForNewEpisode resets the parts of the statistics that are unique
52  * to one recording cycle (episode)
53  */
55  };
56 } // namespace armarx::armem::server::ltm::processor
armarx::armem::server::ltm::processor
Definition: Converter.cpp:3
armarx::armem::server::ltm::processor::SnapshotFilter::FilterStatistics::end_time
std::chrono::high_resolution_clock::time_point end_time
Definition: Filter.h:42
armarx::armem::server::ltm::processor::MemoryFilter::configure
virtual void configure(const nlohmann::json &json)
Definition: Filter.cpp:6
armarx::armem::server::ltm::processor::MemoryFilter::accept
virtual bool accept(const armem::wm::Memory &e)=0
MemoryID.h
armarx::armem::server::ltm::processor::SnapshotFilter::FilterStatistics::rejected
double rejected
Definition: Filter.h:37
armarx::armem::server::ltm::processor::MemoryFilter::~MemoryFilter
virtual ~MemoryFilter()=default
armarx::armem::server::ltm::processor::MemoryFilter::MemoryFilter
MemoryFilter()=default
armarx::armem::server::ltm::processor::SnapshotFilter::FilterStatistics::importance_type
std::string importance_type
Definition: Filter.h:44
armarx::armem::server::ltm::processor::SnapshotFilter::FilterStatistics::number_of_compared_objects
int number_of_compared_objects
Definition: Filter.h:43
armarx::armem::server::ltm::processor::SnapshotFilter::getFilterStatistics
virtual FilterStatistics getFilterStatistics()
Definition: Filter.cpp:15
armarx::armem::wm::Memory
Client-side working memory.
Definition: memory_definitions.h:133
armarx::armem::server::ltm::processor::SnapshotFilter::FilterStatistics::start_time
std::chrono::high_resolution_clock::time_point start_time
Definition: Filter.h:41
armarx::armem::server::ltm::processor::SnapshotFilter::stats
struct armarx::armem::server::ltm::processor::SnapshotFilter::FilterStatistics stats
armarx::armem::wm::EntitySnapshot
Client-side working memory entity snapshot.
Definition: memory_definitions.h:80
armarx::armem::server::ltm::processor::SnapshotFilter::accept
virtual bool accept(const armem::wm::EntitySnapshot &e)=0
armarx::armem::server::ltm::processor::SnapshotFilter::~SnapshotFilter
virtual ~SnapshotFilter()=default
memory_definitions.h
armarx::armem::server::ltm::processor::SnapshotFilter::getName
virtual std::string getName()
Definition: Filter.cpp:20
armarx::armem::server::ltm::processor::SnapshotFilter::configure
virtual void configure(const nlohmann::json &json)
Definition: Filter.cpp:11
armarx::armem::server::ltm::processor::SnapshotFilter::FilterStatistics::additional_info
std::string additional_info
Definition: Filter.h:39
armarx::armem::server::ltm::processor::SnapshotFilter::FilterStatistics::similarity_type
aron::similarity::NDArraySimilarity::Type similarity_type
Definition: Filter.h:40
NDArraySimilarity.h
armarx::armem::server::ltm::processor::SnapshotFilter::SnapshotFilter
SnapshotFilter()=default
armarx::armem::server::ltm::processor::SnapshotFilter::resetStatisticsForNewEpisode
void resetStatisticsForNewEpisode()
resetStatisticsForNewEpisode resets the parts of the statistics that are unique to one recording cycl...
Definition: Filter.cpp:25
armarx::armem::server::ltm::processor::SnapshotFilter::FilterStatistics
Definition: Filter.h:35
armarx::armem::server::ltm::processor::SnapshotFilter
Definition: Filter.h:26
armarx::aron::similarity::NDArraySimilarity::Type
Type
Definition: NDArraySimilarity.h:8
armarx::armem::server::ltm::processor::MemoryFilter
Definition: Filter.h:16
armarx::armem::server::ltm::processor::SnapshotFilter::FilterStatistics::accepted
double accepted
Definition: Filter.h:36
armarx::armem::server::ltm::processor::SnapshotFilter::FilterStatistics::additional_time
std::chrono::duration< double > additional_time
Definition: Filter.h:38