OpenCog Framework  Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
opencog::FuzzyTruthValue Class Reference

a TruthValue that stores a mean and the number of observations (strength and confidence) More...

#include <FuzzyTruthValue.h>

+ Inheritance diagram for opencog::FuzzyTruthValue:
+ Collaboration diagram for opencog::FuzzyTruthValue:

Public Member Functions

 FuzzyTruthValue (strength_t mean, count_t count)
 
 FuzzyTruthValue (const TruthValue &)
 
 FuzzyTruthValue (FuzzyTruthValue const &)
 
virtual bool operator== (const TruthValue &rhs) const
 
std::string toString () const
 
TruthValueType getType () const
 
strength_t getMean () const
 
count_t getCount () const
 
confidence_t getConfidence () const
 
TruthValuePtr merge (TruthValuePtr, TVMergeStyle ms=DEFAULT) const
 
TruthValuePtr clone () const
 
TruthValuerawclone () const
 
- Public Member Functions inherited from opencog::TruthValue
virtual ~TruthValue ()
 
bool operator!= (const TruthValue &rhs) const
 
virtual bool isNullTv () const
 
virtual bool isDefaultTV () const
 

Static Public Member Functions

static count_t confidenceToCount (confidence_t)
 
static confidence_t countToConfidence (count_t)
 
static FuzzyTruthValuePtr createSTV (strength_t mean, count_t count)
 
static TruthValuePtr createTV (strength_t mean, count_t count)
 
- Static Public Member Functions inherited from opencog::TruthValue
static TruthValuePtr NULL_TV ()
 
static TruthValuePtr TRUE_TV ()
 
static TruthValuePtr DEFAULT_TV ()
 
static TruthValuePtr FALSE_TV ()
 
static TruthValuePtr TRIVIAL_TV ()
 

Protected Member Functions

void init (strength_t mean, count_t count)
 

Protected Attributes

strength_t mean
 Mean of the strength of the TV over all observations. More...
 
count_t count
 Total number of observations used to estimate the mean. More...
 

Detailed Description

a TruthValue that stores a mean and the number of observations (strength and confidence)

Definition at line 42 of file FuzzyTruthValue.h.

Constructor & Destructor Documentation

FuzzyTruthValue::FuzzyTruthValue ( strength_t  mean,
count_t  count 
)

Definition at line 42 of file FuzzyTruthValue.cc.

References count, reorder_log::m, and mean.

+ Here is the caller graph for this function:

FuzzyTruthValue::FuzzyTruthValue ( const TruthValue source)
FuzzyTruthValue::FuzzyTruthValue ( FuzzyTruthValue const &  source)

Definition at line 53 of file FuzzyTruthValue.cc.

References count, and mean.

Member Function Documentation

TruthValuePtr opencog::FuzzyTruthValue::clone ( ) const
inlinevirtual

Implements opencog::TruthValue.

Definition at line 99 of file FuzzyTruthValue.h.

+ Here is the caller graph for this function:

count_t FuzzyTruthValue::confidenceToCount ( confidence_t  cf)
static

Heuristic to compute the count given the confidence (according to the PLN book) count = confidence * k / (1 - confidence) where k is the look-ahead

Definition at line 122 of file FuzzyTruthValue.cc.

References KKK.

+ Here is the caller graph for this function:

confidence_t FuzzyTruthValue::countToConfidence ( count_t  cn)
static

Heuristic to compute the confidence given the count (according to the PLN book) confidence = count / (count + k) where k is the look-ahead

Definition at line 130 of file FuzzyTruthValue.cc.

References KKK.

+ Here is the caller graph for this function:

static FuzzyTruthValuePtr opencog::FuzzyTruthValue::createSTV ( strength_t  mean,
count_t  count 
)
inlinestatic

Definition at line 90 of file FuzzyTruthValue.h.

References count, and mean.

+ Here is the caller graph for this function:

static TruthValuePtr opencog::FuzzyTruthValue::createTV ( strength_t  mean,
count_t  count 
)
inlinestatic

Definition at line 94 of file FuzzyTruthValue.h.

References createSTV().

confidence_t FuzzyTruthValue::getConfidence ( ) const
virtual

Implements opencog::TruthValue.

Definition at line 69 of file FuzzyTruthValue.cc.

References count, and countToConfidence().

+ Here is the caller graph for this function:

count_t FuzzyTruthValue::getCount ( ) const
virtual

Implements opencog::TruthValue.

Definition at line 64 of file FuzzyTruthValue.cc.

References count.

+ Here is the caller graph for this function:

strength_t FuzzyTruthValue::getMean ( ) const
virtual

Implements opencog::TruthValue.

Definition at line 59 of file FuzzyTruthValue.cc.

References mean.

+ Here is the caller graph for this function:

TruthValueType FuzzyTruthValue::getType ( ) const
virtual

Implements opencog::TruthValue.

Definition at line 117 of file FuzzyTruthValue.cc.

References opencog::FUZZY_TRUTH_VALUE.

void opencog::FuzzyTruthValue::init ( strength_t  mean,
count_t  count 
)
protected
TruthValuePtr FuzzyTruthValue::merge ( TruthValuePtr  other,
TVMergeStyle  ms = DEFAULT 
) const
virtual

Truth value merge formula, as specified by PLN.

Currently tv1.merge(tv2) works as follows: the resulting TV is either tv1 or tv2, the result being the one with the highest confidence.

Implements opencog::TruthValue.

Definition at line 75 of file FuzzyTruthValue.cc.

References clone(), getConfidence(), and opencog::SIMPLE_TRUTH_VALUE.

bool FuzzyTruthValue::operator== ( const TruthValue rhs) const
virtual

Equality. Used to determine if two truth values are the same, or not. Primarily useful see if a TV is equal to NULL_TV, TRUE_TV, FALSE_TV, etc.

Implements opencog::TruthValue.

Definition at line 98 of file FuzzyTruthValue.cc.

References count, FLOAT_ACCEPTABLE_COUNT_ERROR, FLOAT_ACCEPTABLE_MEAN_ERROR, and mean.

TruthValue* opencog::FuzzyTruthValue::rawclone ( ) const
inlinevirtual

Implements opencog::TruthValue.

Definition at line 103 of file FuzzyTruthValue.h.

References FuzzyTruthValue().

std::string FuzzyTruthValue::toString ( ) const
virtual

Implements opencog::TruthValue.

Definition at line 89 of file FuzzyTruthValue.cc.

References getConfidence(), and getMean().

Member Data Documentation

count_t opencog::FuzzyTruthValue::count
protected

Total number of observations used to estimate the mean.

Definition at line 50 of file FuzzyTruthValue.h.

strength_t opencog::FuzzyTruthValue::mean
protected

Mean of the strength of the TV over all observations.

Definition at line 47 of file FuzzyTruthValue.h.


The documentation for this class was generated from the following files: