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

#include <ImportanceIndex.h>

+ Inheritance diagram for opencog::ImportanceIndex:
+ Collaboration diagram for opencog::ImportanceIndex:

Public Member Functions

 ImportanceIndex (void)
 
void insertAtom (Atom *)
 
void removeAtom (Atom *)
 
void updateImportance (Atom *, int)
 
UnorderedHandleSet getHandleSet (const AtomTable *, AttentionValue::sti_t, AttentionValue::sti_t) const
 
- Public Member Functions inherited from opencog::FixedIntegerIndex
 ~FixedIntegerIndex ()
 
void insert (size_t i, Atom *a)
 
void remove (size_t i, Atom *a)
 
size_t size (size_t i) const
 
size_t size (void) const
 

Static Public Member Functions

static unsigned int importanceBin (short)
 

Additional Inherited Members

- Protected Member Functions inherited from opencog::FixedIntegerIndex
void resize (size_t sz)
 
- Protected Attributes inherited from opencog::FixedIntegerIndex
std::vector< UnorderedAtomSetidx
 

Detailed Description

Implements an index with additional routines needed for managing short-term importance. This index is not thread-safe, by itself. Users of this class must gauarantee single-threaded access!

Definition at line 42 of file ImportanceIndex.h.

Constructor & Destructor Documentation

ImportanceIndex::ImportanceIndex ( void  )

Member Function Documentation

UnorderedHandleSet ImportanceIndex::getHandleSet ( const AtomTable atomtable,
AttentionValue::sti_t  lowerBound,
AttentionValue::sti_t  upperBound 
) const

Definition at line 73 of file ImportanceIndex.cc.

References python.atom_type_names::atom, opencog::FixedIntegerIndex::idx, and importanceBin().

+ Here is the caller graph for this function:

unsigned int ImportanceIndex::importanceBin ( short  importance)
static

This method returns which importance bin an atom with the given importance should be placed.

Parameters
Importancevalue to be mapped.
Returns
The importance bin which an atom of the given importance should be placed.

Definition at line 43 of file ImportanceIndex.cc.

References IMPORTANCE_INDEX_SIZE.

+ Here is the caller graph for this function:

void ImportanceIndex::insertAtom ( Atom atom)

Definition at line 59 of file ImportanceIndex.cc.

References opencog::Atom::getAttentionValue(), importanceBin(), and opencog::FixedIntegerIndex::insert().

+ Here is the caller graph for this function:

void ImportanceIndex::removeAtom ( Atom atom)

Definition at line 66 of file ImportanceIndex.cc.

References python.atom_type_names::atom, opencog::Atom::getAttentionValue(), and importanceBin().

+ Here is the caller graph for this function:

void ImportanceIndex::updateImportance ( Atom atom,
int  bin 
)

Updates the importance index for the given atom. According to the new importance of the atom, it may change importance bins.

Parameters
Theatom whose importance index will be updated.
Theold importance bin where the atom originally was.

Definition at line 50 of file ImportanceIndex.cc.

References python.atom_type_names::atom, opencog::Atom::getAttentionValue(), importanceBin(), and opencog::FixedIntegerIndex::insert().

+ Here is the caller graph for this function:


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