StatisticMeasures.cpp
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 Lesser 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 Adil Orhan (ubdnw at student dot kit dot edu)
20 * @date 2015
21 * @copyright http://www.gnu.org/licenses/gpl.txt
22 * GNU General Public License
23 */
24
25#include "StatisticMeasures.h"
26
28
29namespace memoryx
30{
31
33 {
34 mean = 0;
35 standardDeviation = 0;
36 relativeStandardDeviation = 0;
37 }
38
40 double standardDeviation,
41 double relativeStandardDeviation)
42 {
43 this->mean = mean;
44 this->standardDeviation = standardDeviation;
45 this->relativeStandardDeviation = relativeStandardDeviation;
46 }
47
51
52 double
54 {
55 return mean;
56 }
57
58 double
60 {
61 return standardDeviation;
62 }
63
64 double
66 {
67 return relativeStandardDeviation;
68 }
69
70 Ice::ObjectPtr
72 {
73 return this->clone();
74 }
75
76 armarx::VariantDataClassPtr
77 StatisticMeasures::clone(const Ice::Current& c) const
78 {
79 return new StatisticMeasures(*this);
80 }
81
82 std::string
83 StatisticMeasures::output(const Ice::Current&) const
84 {
85 std::stringstream ss;
86 ss << "mean " << mean << " standardDeviation " << standardDeviation
87 << " relativeStandardDeviation " << relativeStandardDeviation;
88 return ss.str();
89 }
90
92 StatisticMeasures::getType(const Ice::Current& c) const
93 {
95 }
96
97 bool
98 StatisticMeasures::validate(const Ice::Current& c)
99 {
100 return true;
101 }
102
103 void
104 StatisticMeasures::serialize(const armarx::ObjectSerializerBasePtr& serializer,
105 const Ice::Current&) const
106 {
108 armarx::AbstractObjectSerializerPtr::dynamicCast(serializer);
109
110 obj->setDouble("mean", mean);
111 obj->setDouble("standardDeviation", standardDeviation);
112 obj->setDouble("relativeStandardDeviation", relativeStandardDeviation);
113 }
114
115 void
116 StatisticMeasures::deserialize(const armarx::ObjectSerializerBasePtr& serializer,
117 const Ice::Current&)
118 {
120 armarx::AbstractObjectSerializerPtr::dynamicCast(serializer);
121
122 mean = obj->getDouble("mean");
123 standardDeviation = obj->getDouble("standardDeviation");
124 relativeStandardDeviation = obj->getDouble("relativeStandardDeviation");
125 }
126
127} // namespace memoryx
constexpr T c
std::string output(const Ice::Current &=Ice::emptyCurrent) const override
bool validate(const Ice::Current &c=Ice::emptyCurrent) override
void deserialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) override
armarx::VariantDataClassPtr clone(const Ice::Current &c=Ice::emptyCurrent) const override
armarx::VariantTypeId getType(const Ice::Current &c=Ice::emptyCurrent) const override
Ice::ObjectPtr ice_clone() const override
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
IceInternal::Handle< AbstractObjectSerializer > AbstractObjectSerializerPtr
Ice::Int VariantTypeId
Definition Variant.h:43
const armarx::VariantTypeId StatisticMeasures
VirtualRobot headers.