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

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

#include <SimpleTruthValue.h>

+ Inheritance diagram for opencog::SimpleTruthValue:
+ Collaboration diagram for opencog::SimpleTruthValue:

Public Member Functions

void initialize (strength_t new_mean, count_t new_count)
 
 SimpleTruthValue (strength_t mean, count_t count)
 
 SimpleTruthValue (const TruthValue &)
 
 SimpleTruthValue (SimpleTruthValue 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) 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 SimpleTruthValuePtr 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 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 SimpleTruthValue.h.

Constructor & Destructor Documentation

SimpleTruthValue::SimpleTruthValue ( strength_t  mean,
count_t  count 
)

Definition at line 43 of file SimpleTruthValue.cc.

References count, reorder_log::m, and mean.

+ Here is the caller graph for this function:

SimpleTruthValue::SimpleTruthValue ( const TruthValue source)
SimpleTruthValue::SimpleTruthValue ( SimpleTruthValue const &  source)

Definition at line 54 of file SimpleTruthValue.cc.

References count, and mean.

Member Function Documentation

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

Implements opencog::TruthValue.

Definition at line 99 of file SimpleTruthValue.h.

count_t SimpleTruthValue::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 130 of file SimpleTruthValue.cc.

References KKK.

+ Here is the caller graph for this function:

confidence_t SimpleTruthValue::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 138 of file SimpleTruthValue.cc.

References KKK.

+ Here is the caller graph for this function:

static SimpleTruthValuePtr opencog::SimpleTruthValue::createSTV ( strength_t  mean,
count_t  count 
)
inlinestatic

Definition at line 90 of file SimpleTruthValue.h.

References count, and mean.

+ Here is the caller graph for this function:

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

Definition at line 94 of file SimpleTruthValue.h.

References createSTV().

+ Here is the caller graph for this function:

confidence_t SimpleTruthValue::getConfidence ( ) const
virtual

Implements opencog::TruthValue.

Definition at line 70 of file SimpleTruthValue.cc.

References count, and countToConfidence().

+ Here is the caller graph for this function:

count_t SimpleTruthValue::getCount ( ) const
virtual

Implements opencog::TruthValue.

Definition at line 65 of file SimpleTruthValue.cc.

References count.

+ Here is the caller graph for this function:

strength_t SimpleTruthValue::getMean ( ) const
virtual

Implements opencog::TruthValue.

Definition at line 60 of file SimpleTruthValue.cc.

References mean.

+ Here is the caller graph for this function:

TruthValueType SimpleTruthValue::getType ( ) const
virtual

Implements opencog::TruthValue.

Definition at line 125 of file SimpleTruthValue.cc.

References opencog::SIMPLE_TRUTH_VALUE.

void opencog::SimpleTruthValue::initialize ( strength_t  new_mean,
count_t  new_count 
)
inline

Definition at line 53 of file SimpleTruthValue.h.

References count, and mean.

TruthValuePtr SimpleTruthValue::merge ( TruthValuePtr  other,
TVMergeStyle  ms 
) 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 76 of file SimpleTruthValue.cc.

References count, CVAL, opencog::DEFAULT, mean, and opencog::SIMPLE_TRUTH_VALUE.

bool SimpleTruthValue::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 106 of file SimpleTruthValue.cc.

References count, FLOAT_ACCEPTABLE_COUNT_ERROR, FLOAT_ACCEPTABLE_MEAN_ERROR, and mean.

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

Implements opencog::TruthValue.

Definition at line 103 of file SimpleTruthValue.h.

References SimpleTruthValue().

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

Implements opencog::TruthValue.

Definition at line 97 of file SimpleTruthValue.cc.

References getConfidence(), and getMean().

Member Data Documentation

count_t opencog::SimpleTruthValue::count
protected

Total number of observations used to estimate the mean.

Definition at line 50 of file SimpleTruthValue.h.

strength_t opencog::SimpleTruthValue::mean
protected

Mean of the strength of the TV over all observations.

Definition at line 47 of file SimpleTruthValue.h.


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