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
28#include <MemoryX/interface/memorytypes/PredictionEntities.h>
29
30namespace memoryx
31{
32 class PredictionEntity;
34
36 virtual public memoryx::PredictionEntityBase,
37 virtual public memoryx::Entity
38 {
39 public:
41 PredictionEntity(const EntityRefBasePtr& memorySnapshotRef,
42 const EntityRefBasePtr& sourceMemorySnapshotRef,
43 const EntityRefBasePtr& predictedMemorySnapshotRef,
44 const EntityRefBaseList& predictedMemorySnapshotRefList,
45 const std::string& predictionMethodName,
46 Ice::Int taskCount,
47 Ice::Float predictionScore);
49 ~PredictionEntity() override;
50
52
53
54 // cloning
55 Ice::ObjectPtr ice_clone() const override;
56 PredictionEntityPtr clone(const Ice::Current& c = Ice::emptyCurrent) const;
57
58 // PredictionEntityBase interface
59 /**
60 * @brief getProfilerMemorySnapshotRef situation (memory snapshot) that actually occured (may differ from pediction)
61 */
62 EntityRefBasePtr
63 getProfilerMemorySnapshotRef(const Ice::Current& c = Ice::emptyCurrent) const override;
64 void setProfilerMemorySnapshotRef(const EntityRefBasePtr& memorySnapshotRef,
65 const Ice::Current& c = Ice::emptyCurrent) override;
66
67 /**
68 * @brief getSourceProfilerMemorySnapshotRef situation (memory snapshot) before the prediction
69 */
71 const Ice::Current& c = Ice::emptyCurrent) const override;
72 void setSourceProfilerMemorySnapshotRef(const EntityRefBasePtr& sourceMemorySnapshotRef,
73 const Ice::Current& c = Ice::emptyCurrent) override;
74
75 /**
76 * @brief getPredictedProfilerMemorySnapshotRef situation (memory snapshot) which was predicted on the basis of getSourceProfilerMemorySnapshotRef()
77 */
79 const Ice::Current& c = Ice::emptyCurrent) const override;
80 void
81 setPredictedProfilerMemorySnapshotRef(const EntityRefBasePtr& predictedMemorySnapshotRef,
82 const Ice::Current& c = Ice::emptyCurrent) override;
83
85 const Ice::Current& c = Ice::emptyCurrent) const override;
87 const EntityRefBaseList& predictedMemorySnapshotRefList,
88 const Ice::Current& c = Ice::emptyCurrent) override;
89
90 std::string
91 getPredictionMethodName(const Ice::Current& c = Ice::emptyCurrent) const override;
92 void setPredictionMethodName(const std::string& predictionMethodName,
93 const Ice::Current& c = Ice::emptyCurrent) override;
94
95 Ice::Int getTaskCount(const Ice::Current& c = Ice::emptyCurrent) const override;
96 void setTaskCount(Ice::Int taskCount, const Ice::Current& c = Ice::emptyCurrent) override;
97
98 Ice::Float getPredictionScore(const Ice::Current& c = Ice::emptyCurrent) const override;
99 void setPredictionScore(Ice::Float predictionScore,
100 const Ice::Current& c = Ice::emptyCurrent) override;
101
102 // streaming operator
103 friend std::ostream&
104 operator<<(std::ostream& stream, const PredictionEntity& rhs)
105 {
106 rhs.output(stream);
107 return stream;
108 }
109
110 friend std::ostream&
111 operator<<(std::ostream& stream, const PredictionEntityPtr& rhs)
112 {
113 rhs->output(stream);
114 return stream;
115 }
116
117 friend std::ostream&
118 operator<<(std::ostream& stream, const PredictionEntityBasePtr& rhs)
119 {
120 stream << PredictionEntityPtr::dynamicCast(rhs);
121 return stream;
122 }
123
124 private:
125 void output(std::ostream& stream) const;
126
127 static const std::string SNAPSHOT_ATTRIBUTE;
128 static const std::string SOURCE_SNAPSHOT_ATTRIBUTE;
129 static const std::string PREDICTION_ATTRIBUTE;
130 static const std::string PREDICTION_LIST_ATTRIBUTE;
131 static const std::string PREDICTION_METHOD_NAME_ATTRIBUTE;
132 static const std::string TASK_COUNT_ATTRIBUTE;
133 static const std::string PREDICTION_SCORE_ATTRIBUTE;
134 };
135
136} // namespace memoryx
constexpr T c
Entity is the superclass for all MemoryX memory chunks.
Definition Entity.h:246
Ice::Int getTaskCount(const Ice::Current &c=Ice::emptyCurrent) const override
EntityRefBasePtr getSourceProfilerMemorySnapshotRef(const Ice::Current &c=Ice::emptyCurrent) const override
getSourceProfilerMemorySnapshotRef situation (memory snapshot) before the prediction
EntityRefBasePtr getPredictedProfilerMemorySnapshotRef(const Ice::Current &c=Ice::emptyCurrent) const override
getPredictedProfilerMemorySnapshotRef situation (memory snapshot) which was predicted on the basis of...
void setPredictionMethodName(const std::string &predictionMethodName, const Ice::Current &c=Ice::emptyCurrent) override
void setTaskCount(Ice::Int taskCount, const Ice::Current &c=Ice::emptyCurrent) override
void setPredictedProfilerMemorySnapshotRef(const EntityRefBasePtr &predictedMemorySnapshotRef, const Ice::Current &c=Ice::emptyCurrent) override
EntityRefBasePtr getProfilerMemorySnapshotRef(const Ice::Current &c=Ice::emptyCurrent) const override
getProfilerMemorySnapshotRef situation (memory snapshot) that actually occured (may differ from pedic...
void setPredictedProfilerMemorySnapshotRefList(const EntityRefBaseList &predictedMemorySnapshotRefList, const Ice::Current &c=Ice::emptyCurrent) override
void setPredictionScore(Ice::Float predictionScore, const Ice::Current &c=Ice::emptyCurrent) override
EntityRefBaseList getPredictedProfilerMemorySnapshotRefList(const Ice::Current &c=Ice::emptyCurrent) const override
PredictionEntityPtr clone(const Ice::Current &c=Ice::emptyCurrent) const
Ice::ObjectPtr ice_clone() const override
std::string getPredictionMethodName(const Ice::Current &c=Ice::emptyCurrent) const override
void setProfilerMemorySnapshotRef(const EntityRefBasePtr &memorySnapshotRef, const Ice::Current &c=Ice::emptyCurrent) override
friend std::ostream & operator<<(std::ostream &stream, const PredictionEntity &rhs)
void setSourceProfilerMemorySnapshotRef(const EntityRefBasePtr &sourceMemorySnapshotRef, const Ice::Current &c=Ice::emptyCurrent) override
Ice::Float getPredictionScore(const Ice::Current &c=Ice::emptyCurrent) const override
VirtualRobot headers.
IceInternal::Handle< PredictionEntity > PredictionEntityPtr