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

#include <IndefiniteTruthValue.h>

+ Inheritance diagram for opencog::IndefiniteTruthValue:
+ Collaboration diagram for opencog::IndefiniteTruthValue:

Public Member Functions

 IndefiniteTruthValue ()
 
 IndefiniteTruthValue (strength_t l, strength_t u, confidence_t c=DEFAULT_CONFIDENCE_LEVEL)
 
 IndefiniteTruthValue (IndefiniteTruthValue const &)
 
virtual bool operator== (const TruthValue &rhs) const
 it is a strict equality comparison, without error interval tolerance More...
 
strength_t getMean () const
 
strength_t getU () const
 
strength_t getL () const
 
confidence_t getConfidenceLevel () const
 
strength_t getDiff ()
 
const std::vector< strength_t * > & getFirstOrderDistribution () const
 
void setMean (strength_t)
 
void setU (strength_t)
 
void setL (strength_t)
 
void setConfidenceLevel (confidence_t)
 
void setDiff (strength_t)
 
void setFirstOrderDistribution (const std::vector< strength_t * > &)
 
void setSymmetric (bool s)
 
count_t getCount () const
 
confidence_t getConfidence () const
 
strength_t getU_ () const
 
strength_t getL_ () const
 
bool isSymmetric () const
 
TruthValuePtr merge (TruthValuePtr, TVMergeStyle ms=DEFAULT) const
 
std::string toString () const
 
TruthValueType getType () 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 IndefiniteTruthValuePtr createITV (TruthValuePtr tv)
 
static TruthValuePtr createTV (TruthValuePtr tv)
 
static IndefiniteTruthValuePtr createITV (strength_t l, strength_t u, confidence_t c=DEFAULT_CONFIDENCE_LEVEL)
 
static TruthValuePtr createTV (strength_t l, strength_t u, confidence_t c=DEFAULT_CONFIDENCE_LEVEL)
 
static void setDefaultConfidenceLevel (confidence_t c)
 
static void setDefaultK (count_t k)
 
- 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 ()
 

Static Public Attributes

static confidence_t DEFAULT_CONFIDENCE_LEVEL = 0.9
 
static count_t DEFAULT_K = 2.0
 
static strength_t diffError = 0.001
 
static strength_t s = 0.5
 

Private Member Functions

void init (strength_t l=0.0f, strength_t u=0.0f, confidence_t c=DEFAULT_CONFIDENCE_LEVEL)
 
void copy (const IndefiniteTruthValue &)
 
strength_t findDiff (strength_t idiff)
 find diff by dichotomy More...
 

Private Attributes

strength_t U
 
strength_t L
 
confidence_t confidenceLevel
 referred as "b" in the paper More...
 
bool symmetric
 
strength_t diff
 
std::vector< strength_t * > firstOrderDistribution
 
mean, count, confidence

below, "mean", "count" and "confidence" are all three attributes used to translate an indefinite TV into a simple TV. If "mean" (as well as "count" or "confidence") is negative it means that it outdated and therefore must be recalculted, otherwise, i.e. positive of null, it means that the current value is correct

strength_t mean
 
count_t count
 
confidence_t confidence
 

Detailed Description

Indefinite probabilities are in the form ([L,U],b,N). In practical work, N will be hold constant and thus we have only ([L,U],b).

Definition at line 50 of file IndefiniteTruthValue.h.

Constructor & Destructor Documentation

IndefiniteTruthValue::IndefiniteTruthValue ( )

Definition at line 111 of file IndefiniteTruthValue.cc.

References init().

+ Here is the caller graph for this function:

IndefiniteTruthValue::IndefiniteTruthValue ( strength_t  l,
strength_t  u,
confidence_t  c = DEFAULT_CONFIDENCE_LEVEL 
)

Definition at line 116 of file IndefiniteTruthValue.cc.

References init().

IndefiniteTruthValue::IndefiniteTruthValue ( IndefiniteTruthValue const &  source)

Definition at line 122 of file IndefiniteTruthValue.cc.

References copy().

Member Function Documentation

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

Implements opencog::TruthValue.

Definition at line 148 of file IndefiniteTruthValue.h.

+ Here is the caller graph for this function:

void IndefiniteTruthValue::copy ( const IndefiniteTruthValue source)
private

Definition at line 99 of file IndefiniteTruthValue.cc.

References confidence, confidenceLevel, count, diff, L, mean, symmetric, and U.

+ Here is the caller graph for this function:

static IndefiniteTruthValuePtr opencog::IndefiniteTruthValue::createITV ( TruthValuePtr  tv)
inlinestatic

Definition at line 123 of file IndefiniteTruthValue.h.

References opencog::INDEFINITE_TRUTH_VALUE.

+ Here is the caller graph for this function:

static IndefiniteTruthValuePtr opencog::IndefiniteTruthValue::createITV ( strength_t  l,
strength_t  u,
confidence_t  c = DEFAULT_CONFIDENCE_LEVEL 
)
inlinestatic

Definition at line 136 of file IndefiniteTruthValue.h.

static TruthValuePtr opencog::IndefiniteTruthValue::createTV ( TruthValuePtr  tv)
inlinestatic

Definition at line 131 of file IndefiniteTruthValue.h.

References createITV().

static TruthValuePtr opencog::IndefiniteTruthValue::createTV ( strength_t  l,
strength_t  u,
confidence_t  c = DEFAULT_CONFIDENCE_LEVEL 
)
inlinestatic

Definition at line 142 of file IndefiniteTruthValue.h.

References createITV().

strength_t IndefiniteTruthValue::findDiff ( strength_t  idiff)
private

find diff by dichotomy

Definition at line 162 of file IndefiniteTruthValue.cc.

References confidenceLevel, DEFAULT_K, DensityIntegral(), diffError, L, python.bindlink::result, s, and U.

+ Here is the caller graph for this function:

float IndefiniteTruthValue::getConfidence ( ) const
virtual

Implements opencog::TruthValue.

Definition at line 289 of file IndefiniteTruthValue.cc.

References confidence, DEFAULT_K, and getCount().

+ Here is the caller graph for this function:

confidence_t IndefiniteTruthValue::getConfidenceLevel ( ) const

Definition at line 198 of file IndefiniteTruthValue.cc.

References confidenceLevel.

+ Here is the caller graph for this function:

count_t IndefiniteTruthValue::getCount ( ) const
virtual

Implements opencog::TruthValue.

Definition at line 278 of file IndefiniteTruthValue.cc.

References count, DEFAULT_K, and W.

+ Here is the caller graph for this function:

strength_t IndefiniteTruthValue::getDiff ( )

Definition at line 147 of file IndefiniteTruthValue.cc.

References diff, findDiff(), L, and U.

const std::vector< strength_t * > & IndefiniteTruthValue::getFirstOrderDistribution ( ) const

Definition at line 203 of file IndefiniteTruthValue.cc.

References firstOrderDistribution.

strength_t IndefiniteTruthValue::getL ( ) const

Definition at line 138 of file IndefiniteTruthValue.cc.

References L.

+ Here is the caller graph for this function:

strength_t IndefiniteTruthValue::getL_ ( ) const

Definition at line 214 of file IndefiniteTruthValue.cc.

References diff, and L.

strength_t IndefiniteTruthValue::getMean ( ) const
virtual

Implements opencog::TruthValue.

Definition at line 270 of file IndefiniteTruthValue.cc.

References L, mean, and U.

+ Here is the caller graph for this function:

TruthValueType IndefiniteTruthValue::getType ( ) const
virtual

Implements opencog::TruthValue.

Definition at line 260 of file IndefiniteTruthValue.cc.

References opencog::INDEFINITE_TRUTH_VALUE.

strength_t IndefiniteTruthValue::getU ( ) const

Definition at line 142 of file IndefiniteTruthValue.cc.

References U.

+ Here is the caller graph for this function:

strength_t IndefiniteTruthValue::getU_ ( ) const

Definition at line 208 of file IndefiniteTruthValue.cc.

References diff, and U.

void IndefiniteTruthValue::init ( strength_t  l = 0.0f,
strength_t  u = 0.0f,
confidence_t  c = DEFAULT_CONFIDENCE_LEVEL 
)
private

Definition at line 82 of file IndefiniteTruthValue.cc.

References confidence, confidenceLevel, count, diff, firstOrderDistribution, L, mean, symmetric, and U.

+ Here is the caller graph for this function:

bool IndefiniteTruthValue::isSymmetric ( ) const

Definition at line 298 of file IndefiniteTruthValue.cc.

References symmetric.

TruthValuePtr IndefiniteTruthValue::merge ( TruthValuePtr  ,
TVMergeStyle  ms = DEFAULT 
) const
virtual

Merge this TV object with the given TV object argument. It always returns a new TV object with the result of the merge, even if it is equal to one of the merged TV objects.

Parameters
msthe merge style as described in https://github.com/opencog/opencog/issues/1295

Implements opencog::TruthValue.

Definition at line 304 of file IndefiniteTruthValue.cc.

References clone(), and getConfidence().

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

it is a strict equality comparison, without error interval tolerance

Implements opencog::TruthValue.

Definition at line 127 of file IndefiniteTruthValue.cc.

References confidenceLevel, L, and U.

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

Implements opencog::TruthValue.

Definition at line 153 of file IndefiniteTruthValue.h.

References IndefiniteTruthValue().

void IndefiniteTruthValue::setConfidenceLevel ( confidence_t  c)

Definition at line 245 of file IndefiniteTruthValue.cc.

References confidenceLevel.

static void opencog::IndefiniteTruthValue::setDefaultConfidenceLevel ( confidence_t  c)
inlinestatic

Definition at line 162 of file IndefiniteTruthValue.h.

References DEFAULT_CONFIDENCE_LEVEL.

static void opencog::IndefiniteTruthValue::setDefaultK ( count_t  k)
inlinestatic

Definition at line 165 of file IndefiniteTruthValue.h.

References DEFAULT_K.

void IndefiniteTruthValue::setDiff ( strength_t  diff)

Definition at line 250 of file IndefiniteTruthValue.cc.

References diff.

void IndefiniteTruthValue::setFirstOrderDistribution ( const std::vector< strength_t * > &  v)

Definition at line 255 of file IndefiniteTruthValue.cc.

References firstOrderDistribution.

void IndefiniteTruthValue::setL ( strength_t  l)

Definition at line 221 of file IndefiniteTruthValue.cc.

References confidence, count, diff, L, and mean.

void IndefiniteTruthValue::setMean ( strength_t  m)

Definition at line 265 of file IndefiniteTruthValue.cc.

References reorder_log::m, and mean.

void opencog::IndefiniteTruthValue::setSymmetric ( bool  s)
inline

Definition at line 109 of file IndefiniteTruthValue.h.

References s, and symmetric.

void IndefiniteTruthValue::setU ( strength_t  u)

Definition at line 233 of file IndefiniteTruthValue.cc.

References confidence, count, diff, mean, and U.

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

Implements opencog::TruthValue.

Definition at line 312 of file IndefiniteTruthValue.cc.

References confidenceLevel, diff, L, mean, symmetric, and U.

Member Data Documentation

confidence_t opencog::IndefiniteTruthValue::confidence
mutableprivate

Definition at line 75 of file IndefiniteTruthValue.h.

confidence_t opencog::IndefiniteTruthValue::confidenceLevel
private

referred as "b" in the paper

Definition at line 56 of file IndefiniteTruthValue.h.

count_t opencog::IndefiniteTruthValue::count
mutableprivate

Definition at line 74 of file IndefiniteTruthValue.h.

confidence_t IndefiniteTruthValue::DEFAULT_CONFIDENCE_LEVEL = 0.9
static

Definition at line 158 of file IndefiniteTruthValue.h.

count_t IndefiniteTruthValue::DEFAULT_K = 2.0
static

Definition at line 159 of file IndefiniteTruthValue.h.

strength_t opencog::IndefiniteTruthValue::diff
private

used in inference rule procedure in order to compute L1 and U1 when diff is negative it means that it is outdated and must be recalculated

Definition at line 62 of file IndefiniteTruthValue.h.

strength_t IndefiniteTruthValue::diffError = 0.001
static

Definition at line 160 of file IndefiniteTruthValue.h.

std::vector<strength_t*> opencog::IndefiniteTruthValue::firstOrderDistribution
private

Definition at line 78 of file IndefiniteTruthValue.h.

strength_t opencog::IndefiniteTruthValue::L
private

Definition at line 55 of file IndefiniteTruthValue.h.

strength_t opencog::IndefiniteTruthValue::mean
mutableprivate

Definition at line 73 of file IndefiniteTruthValue.h.

strength_t IndefiniteTruthValue::s = 0.5
static

Definition at line 161 of file IndefiniteTruthValue.h.

bool opencog::IndefiniteTruthValue::symmetric
private

Definition at line 57 of file IndefiniteTruthValue.h.

strength_t opencog::IndefiniteTruthValue::U
private

Definition at line 54 of file IndefiniteTruthValue.h.


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