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

#include <TruthValue.h>

+ Inheritance diagram for opencog::TruthValue:
+ Collaboration diagram for opencog::TruthValue:

Public Member Functions

virtual ~TruthValue ()
 
virtual strength_t getMean () const =0
 
virtual confidence_t getConfidence () const =0
 
virtual count_t getCount () const =0
 
virtual std::string toString () const =0
 
virtual TruthValueType getType () const =0
 
virtual TruthValuePtr clone () const =0
 
virtual TruthValuerawclone () const =0
 
virtual bool operator== (const TruthValue &rhs) const =0
 
bool operator!= (const TruthValue &rhs) const
 
virtual TruthValuePtr merge (TruthValuePtr, TVMergeStyle ms=DEFAULT) const =0
 
virtual bool isNullTv () const
 
virtual bool isDefaultTV () const
 

Static Public Member Functions

static TruthValuePtr NULL_TV ()
 
static TruthValuePtr TRUE_TV ()
 
static TruthValuePtr DEFAULT_TV ()
 
static TruthValuePtr FALSE_TV ()
 
static TruthValuePtr TRIVIAL_TV ()
 

Private Member Functions

TruthValueoperator= (const TruthValue &rhs)
 

Friends

class SavingLoading
 
class Atom
 
class ::TruthValueUTest
 

Detailed Description

Definition at line 88 of file TruthValue.h.

Constructor & Destructor Documentation

virtual opencog::TruthValue::~TruthValue ( )
inlinevirtual

Definition at line 103 of file TruthValue.h.

Member Function Documentation

virtual TruthValuePtr opencog::TruthValue::clone ( ) const
pure virtual
TruthValuePtr TruthValue::DEFAULT_TV ( )
static

The shared reference to a special default (Simple) TruthValue object with MAX_TRUTH mean and 0 count. That is, its true, but with no confidence.

Definition at line 52 of file TruthValue.cc.

References MAX_TRUTH.

+ Here is the caller graph for this function:

TruthValuePtr TruthValue::FALSE_TV ( )
static

The shared reference to a special FALSE (Simple) TruthValue object with 0 mean and MAX_TV_CONFIDENCE count. That is, its false with absolute confidence.

Definition at line 66 of file TruthValue.cc.

+ Here is the caller graph for this function:

virtual confidence_t opencog::TruthValue::getConfidence ( ) const
pure virtual
virtual count_t opencog::TruthValue::getCount ( ) const
pure virtual
virtual strength_t opencog::TruthValue::getMean ( ) const
pure virtual
virtual TruthValueType opencog::TruthValue::getType ( ) const
pure virtual
bool TruthValue::isDefaultTV ( ) const
virtual

Check if this TV is equal to the default TV. operator!= only compares pointers

Definition at line 85 of file TruthValue.cc.

References DEFAULT_TV(), getCount(), getMean(), and getType().

bool TruthValue::isNullTv ( ) const
virtual

Check if this TV is a null TV.

Reimplemented in opencog::NullTruthValue.

Definition at line 80 of file TruthValue.cc.

virtual TruthValuePtr opencog::TruthValue::merge ( TruthValuePtr  ,
TVMergeStyle  ms = DEFAULT 
) const
pure 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

Implemented in opencog::IndefiniteTruthValue, opencog::FuzzyTruthValue, opencog::SimpleTruthValue, opencog::CountTruthValue, opencog::ProbabilisticTruthValue, and opencog::NullTruthValue.

TruthValuePtr TruthValue::NULL_TV ( )
static

The shared reference to a special NullTruthValue object. This is supposed to be used only for book-keeping, and it must not be used as a normal TV object. Calling methods on it will throw exceptions.

Definition at line 46 of file TruthValue.cc.

+ Here is the caller graph for this function:

bool opencog::TruthValue::operator!= ( const TruthValue rhs) const
inline

Definition at line 156 of file TruthValue.h.

TruthValue& opencog::TruthValue::operator= ( const TruthValue rhs)
inlineprivate

Definition at line 99 of file TruthValue.h.

virtual bool opencog::TruthValue::operator== ( const TruthValue rhs) const
pure 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.

Implemented in opencog::IndefiniteTruthValue, opencog::FuzzyTruthValue, opencog::SimpleTruthValue, opencog::CountTruthValue, opencog::ProbabilisticTruthValue, and opencog::NullTruthValue.

virtual std::string opencog::TruthValue::toString ( ) const
pure virtual
TruthValuePtr TruthValue::TRIVIAL_TV ( )
static

The shared reference to a special TRIVIAL (Simple) TruthValue object with 0 mean and 0 count. That is, its false, but with no confidence.

Definition at line 73 of file TruthValue.cc.

TruthValuePtr TruthValue::TRUE_TV ( )
static

The shared reference to a special TRUE (Simple) TruthValue object with MAX_TRUTH mean and MAX_TV_CONFIDENCE count. That is, its true with absolute confidence.

Definition at line 59 of file TruthValue.cc.

References MAX_TRUTH.

+ Here is the caller graph for this function:

Friends And Related Function Documentation

friend class ::TruthValueUTest
friend

Definition at line 96 of file TruthValue.h.

friend class Atom
friend

Definition at line 92 of file TruthValue.h.

friend class SavingLoading
friend

Definition at line 91 of file TruthValue.h.


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