OpenCog Framework
Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
|
#include <ImportanceIndex.h>
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 |
![]() | |
~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 | |
![]() | |
void | resize (size_t sz) |
![]() | |
std::vector< UnorderedAtomSet > | idx |
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.
ImportanceIndex::ImportanceIndex | ( | void | ) |
Definition at line 38 of file ImportanceIndex.cc.
References IMPORTANCE_INDEX_SIZE, and opencog::FixedIntegerIndex::resize().
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().
|
static |
This method returns which importance bin an atom with the given importance should be placed.
Importance | value to be mapped. |
Definition at line 43 of file ImportanceIndex.cc.
References IMPORTANCE_INDEX_SIZE.
void ImportanceIndex::insertAtom | ( | Atom * | atom | ) |
Definition at line 59 of file ImportanceIndex.cc.
References opencog::Atom::getAttentionValue(), importanceBin(), and opencog::FixedIntegerIndex::insert().
void ImportanceIndex::removeAtom | ( | Atom * | atom | ) |
Definition at line 66 of file ImportanceIndex.cc.
References python.atom_type_names::atom, opencog::Atom::getAttentionValue(), and importanceBin().
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.
The | atom whose importance index will be updated. |
The | old 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().