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

#include <AttentionValue.h>

+ Inheritance diagram for opencog::AttentionValue:
+ Collaboration diagram for opencog::AttentionValue:

Classes

struct  LTIAndTVAscendingSort
 functor for comparing atom's attention value More...
 
struct  LTIThenTVAscendingSort
 functor for comparing atom's attention value More...
 
struct  STISort
 functor for comparing atom's attention value More...
 

Public Types

typedef short sti_t
 short-term importance type More...
 
typedef short lti_t
 long-term importance type More...
 
typedef short vlti_t
 very long-term importance type More...
 

Public Member Functions

 AttentionValue (sti_t STI=DEFAULTATOMSTI, lti_t LTI=DEFAULTATOMLTI, vlti_t VLTI=DEFAULTATOMVLTI)
 
 ~AttentionValue ()
 
sti_t getSTI () const
 return STI property value More...
 
float getScaledSTI () const
 
lti_t getLTI () const
 return LTI property value More...
 
vlti_t getVLTI () const
 return VLTI property value More...
 
std::string toString () const
 Returns const string "[sti_val, lti_val, vlti_val]". More...
 
AttentionValuePtr clone () const
 Returns An AttentionValue* cloned from this AttentionValue. More...
 
AttentionValuerawclone () const
 
bool operator== (const AttentionValue &av) const
 
bool operator!= (const AttentionValue &rhs) const
 

Static Public Member Functions

static AttentionValuePtr DEFAULT_AV ()
 to be used as default attention value More...
 

Static Public Attributes

static const int DISPOSABLE = 0
 Status flag for vlti. More...
 
static const sti_t DEFAULTATOMSTI = 0
 short-term importance default More...
 
static const lti_t DEFAULTATOMLTI = 0
 long-term importance default More...
 
static const vlti_t DEFAULTATOMVLTI = 0
 very long-term default More...
 
static const sti_t MAXSTI = SHRT_MAX
 
static const lti_t MAXLTI = SHRT_MAX
 
static const sti_t MINSTI = SHRT_MIN
 
static const lti_t MINLTI = SHRT_MIN
 

Private Member Functions

void decaySTI ()
 default attention value More...
 

Private Attributes

sti_t m_STI
 short-term importance More...
 
lti_t m_LTI
 long-term importance More...
 
vlti_t m_VLTI
 

Static Private Attributes

static AttentionValuePtr m_defaultAV
 

Friends

class ImportanceIndex
 

Detailed Description

Definition at line 44 of file AttentionValue.h.

Member Typedef Documentation

long-term importance type

Definition at line 49 of file AttentionValue.h.

short-term importance type

Definition at line 48 of file AttentionValue.h.

very long-term importance type

Definition at line 50 of file AttentionValue.h.

Constructor & Destructor Documentation

opencog::AttentionValue::AttentionValue ( sti_t  STI = DEFAULTATOMSTI,
lti_t  LTI = DEFAULTATOMLTI,
vlti_t  VLTI = DEFAULTATOMVLTI 
)
inline
Parameters
STI(int): The STI value to set for the atom
LTI(int): The LTI value to set for the atom
VLTI(unsigned short): The VLTI value to set for this atom

Definition at line 93 of file AttentionValue.h.

+ Here is the caller graph for this function:

opencog::AttentionValue::~AttentionValue ( )
inline

Definition at line 98 of file AttentionValue.h.

Member Function Documentation

AttentionValuePtr opencog::AttentionValue::clone ( ) const
inline

Returns An AttentionValue* cloned from this AttentionValue.

Definition at line 116 of file AttentionValue.h.

References createAV, m_LTI, m_STI, and m_VLTI.

+ Here is the caller graph for this function:

void AttentionValue::decaySTI ( )
private

default attention value

Decays short term importance Private, because changing the AV without emitting a signal will confuse everyone, so we sharply limit who is allowed to do this.

Definition at line 34 of file AttentionValue.cc.

References m_STI.

static AttentionValuePtr opencog::AttentionValue::DEFAULT_AV ( )
inlinestatic

to be used as default attention value

Definition at line 65 of file AttentionValue.h.

References createAV.

+ Here is the caller graph for this function:

lti_t opencog::AttentionValue::getLTI ( ) const
inline

return LTI property value

Definition at line 105 of file AttentionValue.h.

References m_LTI.

+ Here is the caller graph for this function:

float opencog::AttentionValue::getScaledSTI ( ) const
inline

Definition at line 102 of file AttentionValue.h.

References m_STI.

sti_t opencog::AttentionValue::getSTI ( ) const
inline

return STI property value

Definition at line 101 of file AttentionValue.h.

References m_STI.

+ Here is the caller graph for this function:

vlti_t opencog::AttentionValue::getVLTI ( ) const
inline

return VLTI property value

Definition at line 108 of file AttentionValue.h.

References m_VLTI.

+ Here is the caller graph for this function:

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

Definition at line 125 of file AttentionValue.h.

bool opencog::AttentionValue::operator== ( const AttentionValue av) const
inline

Compares two AttentionValues and returns true if the elements are equal false otherwise

Definition at line 122 of file AttentionValue.h.

References getLTI(), getSTI(), getVLTI(), m_LTI, m_STI, and m_VLTI.

AttentionValue* opencog::AttentionValue::rawclone ( ) const
inline

Definition at line 117 of file AttentionValue.h.

References AttentionValue(), m_LTI, m_STI, and m_VLTI.

std::string AttentionValue::toString ( ) const

Returns const string "[sti_val, lti_val, vlti_val]".

Definition at line 41 of file AttentionValue.cc.

References m_LTI, m_STI, and m_VLTI.

Friends And Related Function Documentation

friend class ImportanceIndex
friend

Definition at line 85 of file AttentionValue.h.

Member Data Documentation

const AttentionValue::lti_t AttentionValue::DEFAULTATOMLTI = 0
static

long-term importance default

Definition at line 56 of file AttentionValue.h.

const AttentionValue::sti_t AttentionValue::DEFAULTATOMSTI = 0
static

short-term importance default

Definition at line 55 of file AttentionValue.h.

const AttentionValue::vlti_t AttentionValue::DEFAULTATOMVLTI = 0
static

very long-term default

Definition at line 57 of file AttentionValue.h.

const int opencog::AttentionValue::DISPOSABLE = 0
static

Status flag for vlti.

Definition at line 52 of file AttentionValue.h.

AttentionValuePtr opencog::AttentionValue::m_defaultAV
staticprivate

Definition at line 77 of file AttentionValue.h.

lti_t opencog::AttentionValue::m_LTI
private

long-term importance

Definition at line 74 of file AttentionValue.h.

sti_t opencog::AttentionValue::m_STI
private

short-term importance

Definition at line 73 of file AttentionValue.h.

vlti_t opencog::AttentionValue::m_VLTI
private

represents the number of processes that currently need the atom as nondisposable. So it's only disposable if this is 0

Definition at line 75 of file AttentionValue.h.

const lti_t opencog::AttentionValue::MAXLTI = SHRT_MAX
static

Definition at line 60 of file AttentionValue.h.

const sti_t opencog::AttentionValue::MAXSTI = SHRT_MAX
static

Definition at line 59 of file AttentionValue.h.

const lti_t opencog::AttentionValue::MINLTI = SHRT_MIN
static

Definition at line 62 of file AttentionValue.h.

const sti_t opencog::AttentionValue::MINSTI = SHRT_MIN
static

Definition at line 61 of file AttentionValue.h.


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