Go to the documentation of this file.
27 const std::string& exportName,
36 const std::string& exportName,
44 ARMARX_INFO <<
"Creating a new memory at " <<
p.string() <<
" and " << exportName;
66 ARMARX_IMPORTANT <<
"Storing of data finished, starting to generate and save statistics...";
96 id().withCoreSegmentName(segmentName),
104 <<
" as the path " <<
getFullPath().string() <<
" does not exist.";
140 id().withCoreSegmentName(
name),
143 return c.fullPathExists();
149 std::unique_ptr<CoreSegment>
162 id().withCoreSegmentName(coreSegmentName),
185 x.loadAllReferences(
s);
200 x.loadLatestNReferences(n,
s);
212 [&m, &n, &coreSegNames](
auto& x)
215 (std::find(coreSegNames.begin(), coreSegNames.end(), x.id().coreSegmentName) !=
220 x.loadLatestNReferences(n,
s);
225 ARMARX_DEBUG <<
"Skipping loading CoreSegment with name "
226 << x.id().coreSegmentName
227 <<
" from LTM into WM as it is not in the defined list";
248 id().withCoreSegmentName(e.id().coreSegmentName),
255 ARMARX_WARNING <<
"You are trying to resolve an LTM from a path that does not exist: "
274 <<
"During storage of memory '" <<
memory.id().str()
275 <<
"' I noticed that the corresponding LTM has no id set. "
276 <<
"I set the id of the LTM to the same name, however this should not happen!";
288 memory.forEachCoreSegment(
289 [&](
const auto& core)
294 id().withCoreSegmentName(core.id().coreSegmentName),
298 c.store(core, simulatedVersion);
318 auto firstTimeStarted = this->
statistics.firstStarted;
319 if (!firstTimeStarted.isValid())
322 ARMARX_DEBUG <<
"No Statistics will be saved because firstStarted is invalid: "
331 if (first_stats.empty())
334 ARMARX_DEBUG <<
"No Statistics will be saved because no actual data was recorded.";
337 std::map<std::string,
338 std::map<std::string, ltm::processor::SnapshotFilter::FilterStatistics>>
340 std::map<std::string, armarx::core::time::DateTime> times;
346 information[
"LTM"] = first_stats;
350 ARMARX_INFO <<
"Something went wrong after getting the statistics";
356 test::save_statistics(information,
366 ARMARX_INFO <<
"Something went wrong with the statistics saving process";
Statistics getStatistics() const
void setMixinMemoryID(const MemoryID &id)
void _loadAllReferences(armem::wm::Memory &) final
void setMixinMemoryID(const MemoryID &id)
void _setExportName(const std::string &n) final
std::shared_ptr< Processors > processors
void configureMixin(const nlohmann::json &json)
configuration
Path getMemoryBasePath() const
void getAndSaveStatistics()
getAndSaveStatistics generates and saves statistics for a LTM recording
void createPropertyDefinitions(PropertyDefinitionsPtr &defs, const std::string &prefix)
void createPropertyDefinitions(PropertyDefinitionsPtr &defs, const std::string &prefix) override
default parameters. Implementation should use the configuration to configure
std::string str(bool escapeDelimiters=true) const
Get a string representation of this memory ID.
void setMixinMemoryID(const MemoryID &n)
struct armarx::armem::server::ltm::detail::MemoryBase::Properties p
Brief description of class memory.
void _configure(const nlohmann::json &config) final
configuration
std::string unescapeName(const std::string &escapedName)
void _loadOnStartup() final
bool forEachCoreSegment(CoreSegmentFunctionT &&func)
A memory storing data on the hard drive and in mongodb (needs 'armarx memory start' to start the mong...
void setMixinMemoryID(const armem::MemoryID &)
setter
std::vector< Path > getAllDirectories() const
void _resolve(armem::wm::Memory &) final
void addToBuffer(const armem::wm::Memory &memory)
void _store(const armem::wm::Memory &m) final
void setMemoryID(const MemoryID &)
void _setMemoryID(const MemoryID &id) final
std::recursive_mutex ltm_mutex
Client-side working memory core segment.
void configureMixin(const nlohmann::json &json)
configuration
Client-side working memory.
std::string extractLastDirectoryFromPath(const std::string &path)
void setMixinExportName(const std::string &n)
MongoDBSettings getSettings() const
CoreSegmentT & addCoreSegment(const std::string &name, aron::type::ObjectPtr coreSegmentType=nullptr, const std::vector< PredictionEngine > &predictionEngines={})
Add an empty core segment with the given name, type and prediction engines.
bool forEachCoreSegment(std::function< void(CoreSegment &)> func) const final
iterate over all core segments of this ltm
virtual void createPropertyDefinitions(PropertyDefinitionsPtr &defs, const std::string &prefix)
default parameters. Implementation should use the configuration to configure
virtual std::string getExportName() const
std::map< std::string, processor::SnapshotFilter::FilterStatistics > getFilterStatistics()
void setMixinExportName(const std::string &n)
void _directlyStore(const armem::wm::Memory &m, bool simulatedVersion) final
MemoryID getMemoryID() const
void configureMixin(const nlohmann::json &json)
configuration
const std::string memoryName
bool fullPathExists() const
bool cacheHasCoreSegment(const std::string &n) const
void _loadLatestNReferences(int n, armem::wm::Memory &m) final
void createPropertyDefinitions(PropertyDefinitionsPtr &defs, const std::string &prefix)
std::filesystem::path Path
std::unique_ptr< CoreSegment > findCoreSegment(const std::string &coreSegmentName) const final
find core segment
bool hasCoreSegment(const std::string &name) const final
check if core segment exists
void configureMixin(const nlohmann::json &json)
double s(double t, double s0, double v0, double a0, double j)