PredictionEntity.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2012-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * @package MemoryX::Core::MemoryTypes
19  * @author Manfred Kroehnert (Manfred dot Kroehnert at kit dot edu)
20  * @date 2015
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 
25 #pragma once
26 
27 #include <MemoryX/interface/memorytypes/PredictionEntities.h>
29 
30 namespace memoryx
31 {
32  class PredictionEntity;
34 
36  virtual public memoryx::PredictionEntityBase,
37  virtual public memoryx::Entity
38  {
39  public:
41  PredictionEntity(const EntityRefBasePtr& memorySnapshotRef, const EntityRefBasePtr& sourceMemorySnapshotRef, const EntityRefBasePtr& predictedMemorySnapshotRef, const EntityRefBaseList& predictedMemorySnapshotRefList, const std::string& predictionMethodName, Ice::Int taskCount, Ice::Float predictionScore);
43  ~PredictionEntity() override;
44 
45  void initializeAttributes();
46 
47 
48  // cloning
49  Ice::ObjectPtr ice_clone() const override;
50  PredictionEntityPtr clone(const Ice::Current& c = Ice::emptyCurrent) const;
51 
52  // PredictionEntityBase interface
53  /**
54  * @brief getProfilerMemorySnapshotRef situation (memory snapshot) that actually occured (may differ from pediction)
55  */
56  EntityRefBasePtr getProfilerMemorySnapshotRef(const Ice::Current& c = Ice::emptyCurrent) const override;
57  void setProfilerMemorySnapshotRef(const EntityRefBasePtr& memorySnapshotRef, const Ice::Current& c = Ice::emptyCurrent) override;
58 
59  /**
60  * @brief getSourceProfilerMemorySnapshotRef situation (memory snapshot) before the prediction
61  */
62  EntityRefBasePtr getSourceProfilerMemorySnapshotRef(const Ice::Current& c = Ice::emptyCurrent) const override;
63  void setSourceProfilerMemorySnapshotRef(const EntityRefBasePtr& sourceMemorySnapshotRef, const Ice::Current& c = Ice::emptyCurrent) override;
64 
65  /**
66  * @brief getPredictedProfilerMemorySnapshotRef situation (memory snapshot) which was predicted on the basis of getSourceProfilerMemorySnapshotRef()
67  */
68  EntityRefBasePtr getPredictedProfilerMemorySnapshotRef(const Ice::Current& c = Ice::emptyCurrent) const override;
69  void setPredictedProfilerMemorySnapshotRef(const EntityRefBasePtr& predictedMemorySnapshotRef, const Ice::Current& c = Ice::emptyCurrent) override;
70 
71  EntityRefBaseList getPredictedProfilerMemorySnapshotRefList(const Ice::Current& c = Ice::emptyCurrent) const override;
72  void setPredictedProfilerMemorySnapshotRefList(const EntityRefBaseList& predictedMemorySnapshotRefList, const Ice::Current& c = Ice::emptyCurrent) override;
73 
74  std::string getPredictionMethodName(const Ice::Current& c = Ice::emptyCurrent) const override;
75  void setPredictionMethodName(const std::string& predictionMethodName, const Ice::Current& c = Ice::emptyCurrent) override;
76 
77  Ice::Int getTaskCount(const Ice::Current& c = Ice::emptyCurrent) const override;
78  void setTaskCount(Ice::Int taskCount, const Ice::Current& c = Ice::emptyCurrent) override;
79 
80  Ice::Float getPredictionScore(const Ice::Current& c = Ice::emptyCurrent) const override;
81  void setPredictionScore(Ice::Float predictionScore, const Ice::Current& c = Ice::emptyCurrent) override;
82 
83  // streaming operator
84  friend std::ostream& operator<<(std::ostream& stream, const PredictionEntity& rhs)
85  {
86  rhs.output(stream);
87  return stream;
88  }
89 
90  friend std::ostream& operator<<(std::ostream& stream, const PredictionEntityPtr& rhs)
91  {
92  rhs->output(stream);
93  return stream;
94  }
95 
96  friend std::ostream& operator<<(std::ostream& stream, const PredictionEntityBasePtr& rhs)
97  {
98  stream << PredictionEntityPtr::dynamicCast(rhs);
99  return stream;
100  }
101  private:
102  void output(std::ostream& stream) const;
103 
104  static const std::string SNAPSHOT_ATTRIBUTE;
105  static const std::string SOURCE_SNAPSHOT_ATTRIBUTE;
106  static const std::string PREDICTION_ATTRIBUTE;
107  static const std::string PREDICTION_LIST_ATTRIBUTE;
108  static const std::string PREDICTION_METHOD_NAME_ATTRIBUTE;
109  static const std::string TASK_COUNT_ATTRIBUTE;
110  static const std::string PREDICTION_SCORE_ATTRIBUTE;
111  };
112 
113 }
114 
memoryx::PredictionEntity::getPredictionMethodName
std::string getPredictionMethodName(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: PredictionEntity.cpp:157
memoryx::PredictionEntity
Definition: PredictionEntity.h:35
armarx::VariantType::Float
const VariantTypeId Float
Definition: Variant.h:918
memoryx::PredictionEntity::initializeAttributes
void initializeAttributes()
Definition: PredictionEntity.cpp:73
memoryx::PredictionEntity::ice_clone
Ice::ObjectPtr ice_clone() const override
Definition: PredictionEntity.cpp:91
memoryx::PredictionEntity::setProfilerMemorySnapshotRef
void setProfilerMemorySnapshotRef(const EntityRefBasePtr &memorySnapshotRef, const Ice::Current &c=Ice::emptyCurrent) override
Definition: PredictionEntity.cpp:110
memoryx::PredictionEntity::operator<<
friend std::ostream & operator<<(std::ostream &stream, const PredictionEntityPtr &rhs)
Definition: PredictionEntity.h:90
memoryx::PredictionEntity::setSourceProfilerMemorySnapshotRef
void setSourceProfilerMemorySnapshotRef(const EntityRefBasePtr &sourceMemorySnapshotRef, const Ice::Current &c=Ice::emptyCurrent) override
Definition: PredictionEntity.cpp:120
memoryx
VirtualRobot headers.
Definition: CommonPlacesTester.cpp:48
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
memoryx::PredictionEntity::operator<<
friend std::ostream & operator<<(std::ostream &stream, const PredictionEntity &rhs)
Definition: PredictionEntity.h:84
memoryx::PredictionEntity::getPredictedProfilerMemorySnapshotRefList
EntityRefBaseList getPredictedProfilerMemorySnapshotRefList(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: PredictionEntity.cpp:135
memoryx::PredictionEntity::clone
PredictionEntityPtr clone(const Ice::Current &c=Ice::emptyCurrent) const
Definition: PredictionEntity.cpp:97
IceInternal::Handle
Definition: forward_declarations.h:8
memoryx::PredictionEntity::~PredictionEntity
~PredictionEntity() override
Definition: PredictionEntity.cpp:69
memoryx::PredictionEntity::getTaskCount
Ice::Int getTaskCount(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: PredictionEntity.cpp:167
memoryx::PredictionEntity::getSourceProfilerMemorySnapshotRef
EntityRefBasePtr getSourceProfilerMemorySnapshotRef(const Ice::Current &c=Ice::emptyCurrent) const override
getSourceProfilerMemorySnapshotRef situation (memory snapshot) before the prediction
Definition: PredictionEntity.cpp:115
memoryx::PredictionEntity::PredictionEntity
PredictionEntity()
Definition: PredictionEntity.cpp:39
memoryx::PredictionEntity::setPredictedProfilerMemorySnapshotRefList
void setPredictedProfilerMemorySnapshotRefList(const EntityRefBaseList &predictedMemorySnapshotRefList, const Ice::Current &c=Ice::emptyCurrent) override
Definition: PredictionEntity.cpp:147
boost::source
Vertex source(const detail::edge_base< Directed, Vertex > &e, const PCG &)
Definition: point_cloud_graph.h:681
memoryx::PredictionEntity::setTaskCount
void setTaskCount(Ice::Int taskCount, const Ice::Current &c=Ice::emptyCurrent) override
Definition: PredictionEntity.cpp:172
memoryx::PredictionEntity::operator<<
friend std::ostream & operator<<(std::ostream &stream, const PredictionEntityBasePtr &rhs)
Definition: PredictionEntity.h:96
memoryx::PredictionEntity::getProfilerMemorySnapshotRef
EntityRefBasePtr getProfilerMemorySnapshotRef(const Ice::Current &c=Ice::emptyCurrent) const override
getProfilerMemorySnapshotRef situation (memory snapshot) that actually occured (may differ from pedic...
Definition: PredictionEntity.cpp:105
memoryx::PredictionEntity::getPredictionScore
Ice::Float getPredictionScore(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: PredictionEntity.cpp:177
Entity.h
memoryx::PredictionEntity::setPredictionScore
void setPredictionScore(Ice::Float predictionScore, const Ice::Current &c=Ice::emptyCurrent) override
Definition: PredictionEntity.cpp:182
armarx::VariantType::Int
const VariantTypeId Int
Definition: Variant.h:916
memoryx::PredictionEntity::getPredictedProfilerMemorySnapshotRef
EntityRefBasePtr getPredictedProfilerMemorySnapshotRef(const Ice::Current &c=Ice::emptyCurrent) const override
getPredictedProfilerMemorySnapshotRef situation (memory snapshot) which was predicted on the basis of...
Definition: PredictionEntity.cpp:125
armarx::aron::type::ObjectPtr
std::shared_ptr< Object > ObjectPtr
Definition: Object.h:36
memoryx::PredictionEntity::setPredictionMethodName
void setPredictionMethodName(const std::string &predictionMethodName, const Ice::Current &c=Ice::emptyCurrent) override
Definition: PredictionEntity.cpp:162
memoryx::Entity
Definition: Entity.h:246
memoryx::PredictionEntity::setPredictedProfilerMemorySnapshotRef
void setPredictedProfilerMemorySnapshotRef(const EntityRefBasePtr &predictedMemorySnapshotRef, const Ice::Current &c=Ice::emptyCurrent) override
Definition: PredictionEntity.cpp:130