OpenCog Framework  Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CountTruthValue.h
Go to the documentation of this file.
1 /*
2  * opencog/atomspace/CountTruthValue.h
3  *
4  * Copyright (C) 2002-2007 Novamente LLC
5  * All Rights Reserved
6  *
7  * Written by Guilherme Lamacie
8  * Murilo Queiroz <murilo@vettalabs.com>
9  * Welter Silva <welter@vettalabs.com>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU Affero General Public License v3 as
13  * published by the Free Software Foundation and including the exceptions
14  * at http://opencog.org/wiki/Licenses
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU Affero General Public License
22  * along with this program; if not, write to:
23  * Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25  */
26 
27 #ifndef _OPENCOG_COUNT_TRUTH_VALUE_H_
28 #define _OPENCOG_COUNT_TRUTH_VALUE_H_
29 
31 
32 namespace opencog
33 {
39 typedef std::shared_ptr<CountTruthValue> CountTruthValuePtr;
40 
43 {
44 protected:
45 
49 
50 public:
51 
55 
56  virtual bool operator==(const TruthValue& rhs) const;
57 
58  std::string toString() const;
59  TruthValueType getType() const;
60 
61  strength_t getMean() const;
62  count_t getCount() const;
64 
66 
68  {
69  return std::static_pointer_cast<TruthValue>(
70  std::make_shared<CountTruthValue>(s, f, c));
71  }
72 
74  {
75  return std::make_shared<CountTruthValue>(*this);
76  }
78  {
79  return new CountTruthValue(*this);
80  }
81 };
82 
84 } // namespace opencog
85 
86 #endif // _OPENCOG_COUNT_TRUTH_VALUE_H_
TruthValueType getType() const
count_t getCount() const
virtual TruthValuePtr merge(TruthValuePtr, TVMergeStyle ms=DEFAULT) const
std::shared_ptr< CountTruthValue > CountTruthValuePtr
TruthValueType
Definition: TruthValue.h:63
std::shared_ptr< TruthValue > TruthValuePtr
Definition: TruthValue.h:85
TruthValuePtr clone() const
CountTruthValue(strength_t, confidence_t, count_t)
float strength_t
float confidence_t
double count_t
std::string toString() const
static TruthValuePtr createTV(strength_t s, confidence_t f, count_t c)
confidence_t getConfidence() const
virtual bool operator==(const TruthValue &rhs) const
a TruthValue that stores a mean, a confidence and the number of observations
TVMergeStyle
Definition: TruthValue.h:76
strength_t getMean() const
TruthValue * rawclone() const