30 #include <opencog/util/platform.h>
31 #include <opencog/util/exceptions.h>
38 using namespace opencog;
78 throw RuntimeException(TRACE_INFO,
79 "Don't know how to merge %s into a FuzzyTruthValue",
80 typeid(*other).name());
84 return other->clone();
92 sprintf(buf,
"(stv %f %f)",
101 if (NULL == stv)
return false;
103 #define FLOAT_ACCEPTABLE_MEAN_ERROR 0.000001
111 #define FLOAT_ACCEPTABLE_COUNT_ERROR 0.0002
126 cf = std::min(cf, 0.9999998f);
127 return static_cast<count_t>(
KKK * cf / (1.0f - cf));
confidence_t getConfidence() const
virtual count_t getCount() const =0
virtual bool operator==(const TruthValue &rhs) const
std::shared_ptr< TruthValue > TruthValuePtr
static confidence_t countToConfidence(count_t)
#define FLOAT_ACCEPTABLE_MEAN_ERROR
static count_t confidenceToCount(confidence_t)
TruthValueType getType() const
strength_t mean
Mean of the strength of the TV over all observations.
TruthValuePtr clone() const
FuzzyTruthValue(strength_t mean, count_t count)
a TruthValue that stores a mean and the number of observations (strength and confidence) ...
TruthValuePtr merge(TruthValuePtr, TVMergeStyle ms=DEFAULT) const
#define FLOAT_ACCEPTABLE_COUNT_ERROR
std::string toString() const
strength_t getMean() const
count_t count
Total number of observations used to estimate the mean.
virtual strength_t getMean() const =0