24 #include <opencog/util/random.h>
30 using namespace opencog;
80 if (
_varmap.count(p.first) == 1)
81 _varmap[p.first].insert(p.second.begin(), p.second.end());
94 if (
_varmap.count(p.first) == 1)
95 _varmap[p.first].insert(p.second);
113 return std::count(q.begin(), q.end(), hname);
181 std::vector<double> weights;
184 handles.push_back(p.first);
190 Target&
t = _targets_map.at(handles[randGen().randDiscrete(weights)]);
Handle add_node(Type t, const std::string &name="", bool async=false)
std::vector< Handle > HandleSeq
a list of handles
HandleSeq get_neighbors(const Handle &h, bool fanin, bool fanout, Type desiredLinkType, bool subClasses)
void store_varmap(VarMultimap &vm)
void emplace(Handle h, Handle hvardecl)
unsigned int _selection_count
unsigned int _total_selection
void increment_selection_count()
std::map< Handle, UnorderedHandleSet > VarMultimap
static VariableListPtr VariableListCast(const Handle &h)
unsigned int rule_count(const Rule &r)
std::map< Handle, Handle > VarMap
void store_step(const Rule &r, const HandleSeq &premises)
Target(AtomSpace &as, const Handle &h, const Handle &hvardecl)
std::map< Handle, Target > _targets_map
std::unordered_set< Handle, handle_hash > UnorderedHandleSet
a hash that associates the handle to its unique identificator
Handle add_link(Type t, const HandleSeq &outgoing, bool async=false)
void clear()
Clear the atomspace, remove all atoms.
Handle add_atom(AtomPtr atom, bool async=false)