Soar Kernel
9.3.2 08-06-12
|
#include <portability.h>
#include <cmath>
#include <algorithm>
#include <iterator>
#include <iostream>
#include <fstream>
#include <set>
#include <climits>
#include "episodic_memory.h"
#include "semantic_memory.h"
#include "agent.h"
#include "prefmem.h"
#include "symtab.h"
#include "wmem.h"
#include "print.h"
#include "xml.h"
#include "instantiations.h"
#include "decide.h"
Go to the source code of this file.
Macros | |
#define | QUERY_DEBUG 0 |
Functions | |
void | _epmem_install_id_wme (agent *my_agent, Symbol *parent, Symbol *attr, std::map< epmem_node_id, std::pair< Symbol *, bool > > *ids, epmem_node_id q1, bool val_is_short_term, char val_letter, uint64_t val_num, epmem_id_mapping *id_record, soar_module::symbol_triple_list &retrieval_wmes) |
std::string | _epmem_print_sti (epmem_node_id id) |
void | _epmem_process_buffered_wme_list (agent *my_agent, Symbol *state, soar_module::wme_set &cue_wmes, soar_module::symbol_triple_list &my_list, epmem_wme_stack *epmem_wmes) |
void | _epmem_promote_id (agent *my_agent, Symbol *id, epmem_time_id t) |
void | _epmem_respond_to_cmd_parse (agent *my_agent, epmem_wme_list *cmds, bool &good_cue, int &path, epmem_time_id &retrieve, Symbol *&next, Symbol *&previous, Symbol *&query, Symbol *&neg_query, epmem_time_list &prohibit, epmem_time_id &before, epmem_time_id &after, epmem_symbol_set ¤ts, soar_module::wme_set &cue_wmes) |
void | _epmem_store_level (agent *my_agent, std::queue< Symbol * > &parent_syms, std::queue< epmem_node_id > &parent_ids, tc_number tc, epmem_wme_list::iterator w_b, epmem_wme_list::iterator w_e, epmem_node_id parent_id, epmem_time_id time_counter, std::map< wme *, epmem_id_reservation * > &id_reservations, std::set< Symbol * > &new_identifiers, std::queue< epmem_node_id > &epmem_node, std::queue< epmem_node_id > &epmem_edge) |
bool | epmem_backup_db (agent *my_agent, const char *file_name, std::string *err) |
void | epmem_buffer_add_wme (soar_module::symbol_triple_list &my_list, Symbol *id, Symbol *attr, Symbol *value) |
epmem_literal * | epmem_build_dnf (wme *cue_wme, epmem_wme_literal_map &literal_cache, epmem_literal_set &leaf_literals, epmem_symbol_int_map &symbol_num_incoming, epmem_literal_deque &gm_ordering, epmem_symbol_set ¤ts, int query_type, std::set< Symbol * > &visiting, soar_module::wme_set &cue_wmes, agent *my_agent) |
void | epmem_clear_result (agent *my_agent, Symbol *state) |
void | epmem_close (agent *my_agent) |
bool | epmem_consider_new_episode (agent *my_agent) |
bool | epmem_enabled (agent *my_agent) |
epmem_wme_list * | epmem_get_augs_of_id (Symbol *id, tc_number tc) |
bool | epmem_get_variable (agent *my_agent, epmem_variable_key variable_id, int64_t *variable_value) |
bool | epmem_gm_mcv_comparator (const epmem_literal *a, const epmem_literal *b) |
void | epmem_go (agent *my_agent, bool allow_store) |
bool | epmem_graph_match (epmem_literal_deque::iterator &dnf_iter, epmem_literal_deque::iterator &iter_end, epmem_literal_node_pair_map &bindings, epmem_node_symbol_map bound_nodes[], agent *my_agent, int depth=0) |
void | epmem_init_db (agent *my_agent, bool readonly=false) |
void | epmem_install_memory (agent *my_agent, Symbol *state, epmem_time_id memory_id, soar_module::symbol_triple_list &meta_wmes, soar_module::symbol_triple_list &retrieval_wmes, epmem_id_mapping *id_record=NULL) |
void | epmem_new_episode (agent *my_agent) |
epmem_time_id | epmem_next_episode (agent *my_agent, epmem_time_id memory_id) |
epmem_time_id | epmem_previous_episode (agent *my_agent, epmem_time_id memory_id) |
void | epmem_print_episode (agent *my_agent, epmem_time_id memory_id, std::string *buf) |
void | epmem_print_retrieval_state (epmem_wme_literal_map &literals, epmem_triple_pedge_map pedge_caches[], epmem_triple_uedge_map uedge_caches[]) |
void | epmem_process_buffered_wmes (agent *my_agent, Symbol *state, soar_module::wme_set &cue_wmes, soar_module::symbol_triple_list &meta_wmes, soar_module::symbol_triple_list &retrieval_wmes) |
void | epmem_process_query (agent *my_agent, Symbol *state, Symbol *pos_query, Symbol *neg_query, epmem_time_list &prohibits, epmem_time_id before, epmem_time_id after, epmem_symbol_set ¤ts, soar_module::wme_set &cue_wmes, soar_module::symbol_triple_list &meta_wmes, soar_module::symbol_triple_list &retrieval_wmes, int level=3) |
bool | epmem_register_pedges (epmem_node_id parent, epmem_literal *literal, epmem_pedge_pq &pedge_pq, epmem_time_id after, epmem_triple_pedge_map pedge_caches[], epmem_triple_uedge_map uedge_caches[], agent *my_agent) |
void | epmem_reset (agent *my_agent, Symbol *state) |
void | epmem_respond_to_cmd (agent *my_agent) |
void | epmem_rit_add_left (agent *my_agent, epmem_time_id min, epmem_time_id max) |
void | epmem_rit_add_right (agent *my_agent, epmem_time_id id) |
void | epmem_rit_clear_left_right (agent *my_agent) |
int64_t | epmem_rit_fork_node (int64_t lower, int64_t upper, bool, int64_t *step_return, epmem_rit_state *rit_state) |
void | epmem_rit_insert_interval (agent *my_agent, int64_t lower, int64_t upper, epmem_node_id id, epmem_rit_state *rit_state) |
void | epmem_rit_prep_left_right (agent *my_agent, int64_t lower, int64_t upper, epmem_rit_state *rit_state) |
bool | epmem_satisfy_literal (epmem_literal *literal, epmem_node_id parent, epmem_node_id child, double ¤t_score, long int ¤t_cardinality, epmem_symbol_node_pair_int_map &symbol_node_count, epmem_triple_uedge_map uedge_caches[], epmem_symbol_int_map &symbol_num_incoming) |
void | epmem_schedule_promotion (agent *my_agent, Symbol *id) |
void | epmem_set_variable (agent *my_agent, epmem_variable_key variable_id, int64_t variable_value) |
epmem_hash_id | epmem_temporal_hash (agent *my_agent, Symbol *sym, bool add_on_fail=true) |
bool | epmem_unsatisfy_literal (epmem_literal *literal, epmem_node_id parent, epmem_node_id child, double ¤t_score, long int ¤t_cardinality, epmem_symbol_node_pair_int_map &symbol_node_count) |
bool | epmem_valid_episode (agent *my_agent, epmem_time_id memory_id) |
void | epmem_visualize_episode (agent *my_agent, epmem_time_id memory_id, std::string *buf) |
#define QUERY_DEBUG 0 |
Definition at line 3298 of file episodic_memory.cpp.
Referenced by epmem_graph_match(), epmem_process_query(), epmem_register_pedges(), epmem_satisfy_literal(), and epmem_unsatisfy_literal().
|
inline |
Definition at line 2761 of file episodic_memory.cpp.
References epmem_buffer_add_wme(), symbol_union::id, identifier_struct::impasse_wmes, identifier_struct::input_wmes, identifier_struct::level, make_new_identifier(), sym_constant_struct::name, symbol_union::sc, identifier_struct::slots, smem_lti_get_id(), smem_lti_soar_make(), SYM_CONSTANT_SYMBOL_TYPE, and symbol_remove_ref().
Referenced by epmem_install_memory().
|
inline |
Definition at line 4475 of file episodic_memory.cpp.
Referenced by epmem_print_episode().
|
inline |
Definition at line 908 of file episodic_memory.cpp.
References add_preference_to_tm(), chunk_instantiation(), symbol_union::id, insert_at_head_of_dll, preference_struct::inst_next, soar_module::make_fake_instantiation(), instantiation_struct::next, NIL, preference_add_ref(), preference_remove_ref(), identifier_struct::preferences_from_goal, instantiation_struct::preferences_generated, wma_activate_wmes_in_pref(), and wma_enabled().
Referenced by epmem_process_buffered_wmes().
|
inline |
Definition at line 2027 of file episodic_memory.cpp.
References soar_module::sqlite_statement::bind_int(), identifier_struct::epmem_id, agent_struct::epmem_stmts_graph, soar_module::statement::execute(), symbol_union::id, identifier_struct::name_letter, identifier_struct::name_number, soar_module::op_reinit, and epmem_graph_statement_container::promote_id.
Referenced by _epmem_store_level(), and epmem_new_episode().
|
inline |
Definition at line 5041 of file episodic_memory.cpp.
References EPMEM_MEMID_NONE, agent_struct::epmem_sym_after, agent_struct::epmem_sym_before, agent_struct::epmem_sym_current, agent_struct::epmem_sym_negquery, agent_struct::epmem_sym_next, agent_struct::epmem_sym_prev, agent_struct::epmem_sym_prohibit, agent_struct::epmem_sym_query, agent_struct::epmem_sym_retrieve, IDENTIFIER_SYMBOL_TYPE, and INT_CONSTANT_SYMBOL_TYPE.
Referenced by epmem_respond_to_cmd().
|
inline |
Definition at line 2041 of file episodic_memory.cpp.
References _epmem_promote_id(), epmem_graph_statement_container::add_edge_unique, epmem_graph_statement_container::add_node_unique, soar_module::sqlite_statement::bind_int(), soar_module::sqlite_statement::column_int(), agent_struct::epmem_db, agent_struct::epmem_edge_maxes, agent_struct::epmem_edge_mins, agent_struct::epmem_edge_removals, EPMEM_HASH_ACCEPTABLE, agent_struct::epmem_id_ref_counts, agent_struct::epmem_id_replacement, agent_struct::epmem_id_repository, agent_struct::epmem_node_maxes, agent_struct::epmem_node_mins, agent_struct::epmem_node_removals, EPMEM_NODEID_BAD, agent_struct::epmem_params, epmem_set_variable(), agent_struct::epmem_stats, agent_struct::epmem_stmts_graph, epmem_temporal_hash(), agent_struct::epmem_validation, epmem_param_container::exclusions, soar_module::statement::execute(), epmem_graph_statement_container::find_edge_unique_shared, epmem_graph_statement_container::find_lti, epmem_graph_statement_container::find_node_unique, soar_module::primitive_stat< T >::get_value(), IDENTIFIER_SYMBOL_TYPE, soar_module::sym_set_param::in_set(), soar_module::sqlite_database::last_insert_rowid(), epmem_id_reservation_struct::my_hash, epmem_id_reservation_struct::my_id, epmem_id_reservation_struct::my_pool, epmem_stat_container::next_id, NIL, soar_module::op_reinit, soar_module::statement::reinitialize(), soar_module::row, soar_module::primitive_stat< T >::set_value(), USE_MEM_POOL_ALLOCATORS, and var_next_id.
Referenced by epmem_new_episode().
bool epmem_backup_db | ( | agent * | my_agent, |
const char * | file_name, | ||
std::string * | err | ||
) |
Definition at line 5877 of file episodic_memory.cpp.
References soar_module::sqlite_database::backup(), epmem_common_statement_container::begin, epmem_common_statement_container::commit, soar_module::connected, agent_struct::epmem_db, agent_struct::epmem_params, agent_struct::epmem_stmts_common, soar_module::statement::execute(), soar_module::status_object< T >::get_status(), soar_module::constant_param< T >::get_value(), epmem_param_container::lazy_commit, soar_module::on, and soar_module::op_reinit.
|
inline |
Definition at line 994 of file episodic_memory.cpp.
References symbol_add_ref().
Referenced by _epmem_install_id_wme(), epmem_install_memory(), epmem_process_query(), and epmem_respond_to_cmd().
epmem_literal* epmem_build_dnf | ( | wme * | cue_wme, |
epmem_wme_literal_map & | literal_cache, | ||
epmem_literal_set & | leaf_literals, | ||
epmem_symbol_int_map & | symbol_num_incoming, | ||
epmem_literal_deque & | gm_ordering, | ||
epmem_symbol_set & | currents, | ||
int | query_type, | ||
std::set< Symbol * > & | visiting, | ||
soar_module::wme_set & | cue_wmes, | ||
agent * | my_agent | ||
) |
Definition at line 3413 of file episodic_memory.cpp.
References wme_struct::attr, epmem_param_container::balance, soar_module::sqlite_statement::bind_int(), epmem_literal_struct::children, soar_module::sqlite_statement::column_int(), epmem_get_augs_of_id(), agent_struct::epmem_literal_pool, EPMEM_NODEID_BAD, agent_struct::epmem_params, EPMEM_RIT_STATE_EDGE, EPMEM_RIT_STATE_NODE, agent_struct::epmem_stmts_graph, epmem_temporal_hash(), soar_module::statement::execute(), epmem_graph_statement_container::find_lti, get_new_tc_number(), soar_module::primitive_param< T >::get_value(), wme_struct::id, symbol_union::id, epmem_literal_struct::id_sym, IDENTIFIER_SYMBOL_TYPE, epmem_literal_struct::is_current, epmem_literal_struct::is_leaf, epmem_literal_struct::is_neg_q, epmem_literal_struct::matches, identifier_struct::name_letter, identifier_struct::name_number, epmem_literal_struct::parents, epmem_literal_struct::q1, soar_module::statement::reinitialize(), soar_module::row, identifier_struct::smem_lti, wme_struct::value, epmem_literal_struct::value_is_id, epmem_literal_struct::value_sym, epmem_literal_struct::values, epmem_literal_struct::w, epmem_literal_struct::weight, and wma_get_wme_activation().
Referenced by epmem_process_query().
Definition at line 1445 of file episodic_memory.cpp.
References identifier_struct::epmem_info, epmem_data_struct::epmem_wmes, symbol_union::id, preference_struct::in_tm, and remove_preference_from_tm().
Referenced by epmem_respond_to_cmd().
void epmem_close | ( | agent * | my_agent | ) |
Definition at line 1340 of file episodic_memory.cpp.
References epmem_common_statement_container::commit, soar_module::connected, soar_module::sqlite_database::disconnect(), agent_struct::epmem_db, agent_struct::epmem_id_ref_counts, agent_struct::epmem_id_replacement, agent_struct::epmem_id_repository, agent_struct::epmem_params, agent_struct::epmem_promotions, EPMEM_RANGE_END, EPMEM_RANGE_EP, EPMEM_RANGE_POINT, EPMEM_RANGE_START, EPMEM_RIT_STATE_EDGE, EPMEM_RIT_STATE_NODE, agent_struct::epmem_stmts_common, agent_struct::epmem_stmts_graph, agent_struct::epmem_wme_adds, soar_module::statement::execute(), soar_module::status_object< T >::get_status(), soar_module::constant_param< T >::get_value(), epmem_param_container::lazy_commit, soar_module::on, soar_module::op_reinit, epmem_graph_statement_container::pool_dummy, epmem_graph_statement_container::pool_find_edge_queries, epmem_graph_statement_container::pool_find_interval_queries, epmem_graph_statement_container::pool_find_lti_queries, and symbol_remove_ref().
Referenced by destroy_soar_agent().
bool epmem_consider_new_episode | ( | agent * | my_agent | ) |
Definition at line 4980 of file episodic_memory.cpp.
References epmem_param_container::dc, identifier_struct::epmem_info, epmem_new_episode(), agent_struct::epmem_params, agent_struct::epmem_timers, epmem_param_container::force, epmem_param_container::force_off, soar_module::constant_param< T >::get_value(), symbol_union::id, agent_struct::io_header_output, epmem_data_struct::last_ol_time, wme_struct::next, slot_struct::next, NIL, epmem_param_container::none, epmem_param_container::output, epmem_param_container::remember, soar_module::constant_param< T >::set_value(), identifier_struct::slots, soar_module::timer::start(), soar_module::timer::stop(), wme_struct::timetag, agent_struct::top_goal, epmem_param_container::trigger, epmem_timer_container::trigger, and slot_struct::wmes.
Referenced by epmem_go().
bool epmem_enabled | ( | agent * | my_agent | ) |
Definition at line 246 of file episodic_memory.cpp.
References agent_struct::epmem_params, soar_module::constant_param< T >::get_value(), epmem_param_container::learning, and soar_module::on.
Referenced by do_one_top_level_phase().
epmem_wme_list* epmem_get_augs_of_id | ( | Symbol * | id, |
tc_number | tc | ||
) |
Definition at line 866 of file episodic_memory.cpp.
References slot_struct::acceptable_preference_wmes, symbol_union::id, IDENTIFIER_SYMBOL_TYPE, identifier_struct::impasse_wmes, identifier_struct::input_wmes, wme_struct::next, slot_struct::next, NIL, identifier_struct::slots, identifier_struct::tc_num, and slot_struct::wmes.
Referenced by epmem_build_dnf(), epmem_new_episode(), epmem_process_query(), and epmem_respond_to_cmd().
bool epmem_get_variable | ( | agent * | my_agent, |
epmem_variable_key | variable_id, | ||
int64_t * | variable_value | ||
) |
Definition at line 1020 of file episodic_memory.cpp.
References soar_module::sqlite_statement::bind_int(), soar_module::sqlite_statement::column_int(), agent_struct::epmem_stmts_common, soar_module::statement::execute(), soar_module::statement::reinitialize(), soar_module::row, and epmem_common_statement_container::var_get.
Referenced by epmem_init_db().
bool epmem_gm_mcv_comparator | ( | const epmem_literal * | a, |
const epmem_literal * | b | ||
) |
Definition at line 3409 of file episodic_memory.cpp.
References epmem_literal_struct::matches.
Referenced by epmem_process_query().
void epmem_go | ( | agent * | my_agent, |
bool | allow_store | ||
) |
Definition at line 5853 of file episodic_memory.cpp.
References epmem_consider_new_episode(), epmem_respond_to_cmd(), agent_struct::epmem_timers, soar_module::timer::start(), soar_module::timer::stop(), and epmem_timer_container::total.
Referenced by do_one_top_level_phase().
bool epmem_graph_match | ( | epmem_literal_deque::iterator & | dnf_iter, |
epmem_literal_deque::iterator & | iter_end, | ||
epmem_literal_node_pair_map & | bindings, | ||
epmem_node_symbol_map | bound_nodes[], | ||
agent * | my_agent, | ||
int | depth = 0 |
||
) |
Definition at line 3734 of file episodic_memory.cpp.
References epmem_literal_struct::children, EPMEM_NODEID_BAD, epmem_literal_struct::matches, epmem_literal_struct::parents, epmem_literal_struct::q1, QUERY_DEBUG, epmem_literal_struct::value_is_id, and epmem_literal_struct::value_sym.
Referenced by epmem_process_query().
void epmem_init_db | ( | agent * | my_agent, |
bool | readonly = false |
||
) |
Definition at line 1509 of file episodic_memory.cpp.
References epmem_graph_statement_container::add_edge_point, epmem_graph_statement_container::add_edge_range, epmem_graph_statement_container::add_node_point, epmem_graph_statement_container::add_node_range, epmem_rit_state_struct::add_query, epmem_common_statement_container::begin, soar_module::sqlite_statement::bind_int(), epmem_param_container::cache_size, soar_module::sqlite_statement::column_int(), soar_module::sqlite_statement::column_type(), soar_module::sqlite_database::connect(), epmem_param_container::database, soar_module::disconnected, agent_struct::epmem_db, agent_struct::epmem_edge_maxes, agent_struct::epmem_edge_mins, agent_struct::epmem_edge_removals, epmem_get_variable(), identifier_struct::epmem_id, agent_struct::epmem_id_ref_counts, agent_struct::epmem_id_repository, agent_struct::epmem_node_maxes, agent_struct::epmem_node_mins, agent_struct::epmem_node_removals, EPMEM_NODEID_ROOT, agent_struct::epmem_params, epmem_rit_insert_interval(), EPMEM_RIT_OFFSET_INIT, EPMEM_RIT_STATE_EDGE, agent_struct::epmem_rit_state_graph, EPMEM_RIT_STATE_NODE, epmem_set_variable(), agent_struct::epmem_stats, agent_struct::epmem_stmts_common, agent_struct::epmem_stmts_graph, agent_struct::epmem_timers, identifier_struct::epmem_valid, agent_struct::epmem_validation, agent_struct::epmem_wme_adds, soar_module::statement::execute(), soar_module::status_object< T >::get_errmsg(), soar_module::status_object< T >::get_status(), soar_module::primitive_param< T >::get_string(), soar_module::string_param::get_value(), soar_module::constant_param< T >::get_value(), soar_module::primitive_stat< T >::get_value(), symbol_union::id, epmem_timer_container::init, epmem_param_container::lazy_commit, epmem_rit_state_struct::leftroot, epmem_param_container::memory, epmem_rit_state_struct::minstep, epmem_stat_container::next_id, NIL, soar_module::null_t, epmem_rit_state_struct::offset, soar_module::on, soar_module::op_reinit, epmem_param_container::opt, epmem_param_container::opt_speed, epmem_param_container::page_16k, epmem_param_container::page_1k, epmem_param_container::page_2k, epmem_param_container::page_32k, epmem_param_container::page_4k, epmem_param_container::page_64k, epmem_param_container::page_8k, epmem_param_container::page_size, epmem_param_container::path, soar_module::statement::prepare(), soar_module::statement_container::prepare(), print(), soar_module::problem, epmem_rit_state_struct::rightroot, soar_module::row, soar_module::primitive_stat< T >::set_value(), soar_module::timer::start(), epmem_rit_state_param_struct::stat, soar_module::timer::stop(), soar_module::sqlite_statement_container::structure(), epmem_stat_container::time, agent_struct::top_goal, agent_struct::top_state, epmem_graph_statement_container::update_edge_unique_last, epmem_rit_state_param_struct::var_key, var_next_id, and xml_generate_warning().
Referenced by epmem_new_episode(), epmem_print_episode(), epmem_respond_to_cmd(), and epmem_visualize_episode().
void epmem_install_memory | ( | agent * | my_agent, |
Symbol * | state, | ||
epmem_time_id | memory_id, | ||
soar_module::symbol_triple_list & | meta_wmes, | ||
soar_module::symbol_triple_list & | retrieval_wmes, | ||
epmem_id_mapping * | id_record = NULL |
||
) |
Definition at line 2829 of file episodic_memory.cpp.
References _epmem_install_id_wme(), epmem_buffer_add_wme(), identifier_struct::epmem_info, EPMEM_MEMID_NONE, EPMEM_NODEID_ROOT, agent_struct::epmem_params, identifier_struct::epmem_result_header, epmem_rit_clear_left_right(), epmem_rit_prep_left_right(), EPMEM_RIT_STATE_EDGE, agent_struct::epmem_rit_state_graph, EPMEM_RIT_STATE_NODE, agent_struct::epmem_stats, agent_struct::epmem_stmts_graph, agent_struct::epmem_sym_memory_id, agent_struct::epmem_sym_no_memory, agent_struct::epmem_sym_present_id, agent_struct::epmem_sym_retrieved, agent_struct::epmem_timers, epmem_valid_episode(), FLOAT_CONSTANT_SYMBOL_TYPE, epmem_graph_statement_container::get_edges, epmem_graph_statement_container::get_nodes, soar_module::constant_param< T >::get_value(), soar_module::primitive_stat< T >::get_value(), symbol_union::id, INT_CONSTANT_SYMBOL_TYPE, epmem_data_struct::last_memory, identifier_struct::level, make_float_constant(), make_int_constant(), make_new_identifier(), make_sym_constant(), epmem_param_container::merge, epmem_param_container::merge_add, epmem_timer_container::ncb_retrieval, epmem_stat_container::ncb_wmes, NIL, soar_module::null_t, epmem_edge_struct::q0, epmem_edge_struct::q1, soar_module::row, soar_module::primitive_stat< T >::set_value(), soar_module::timer::start(), soar_module::timer::stop(), SYM_CONSTANT_SYMBOL_TYPE, symbol_remove_ref(), epmem_stat_container::time, epmem_edge_struct::val_is_short_term, epmem_edge_struct::val_letter, epmem_edge_struct::val_num, and epmem_edge_struct::w.
Referenced by epmem_process_query(), and epmem_respond_to_cmd().
void epmem_new_episode | ( | agent * | my_agent | ) |
Definition at line 2455 of file episodic_memory.cpp.
References _epmem_promote_id(), _epmem_store_level(), epmem_graph_statement_container::add_edge_now, epmem_graph_statement_container::add_edge_point, soar_module::add_module_wme(), epmem_graph_statement_container::add_node_now, epmem_graph_statement_container::add_node_point, epmem_graph_statement_container::add_time, soar_module::sqlite_statement::bind_int(), agent_struct::bottom_goal, soar_module::connected, epmem_graph_statement_container::delete_edge_now, epmem_graph_statement_container::delete_node_now, soar_module::disconnected, agent_struct::epmem_db, agent_struct::epmem_edge_maxes, agent_struct::epmem_edge_mins, agent_struct::epmem_edge_removals, epmem_get_augs_of_id(), identifier_struct::epmem_header, epmem_init_db(), agent_struct::epmem_node_maxes, agent_struct::epmem_node_mins, agent_struct::epmem_node_removals, EPMEM_NODEID_BAD, agent_struct::epmem_promotions, epmem_rit_insert_interval(), EPMEM_RIT_STATE_EDGE, agent_struct::epmem_rit_state_graph, EPMEM_RIT_STATE_NODE, agent_struct::epmem_stats, agent_struct::epmem_stmts_graph, agent_struct::epmem_sym_present_id, identifier_struct::epmem_time_wme, agent_struct::epmem_timers, agent_struct::epmem_validation, agent_struct::epmem_wme_adds, soar_module::statement::execute(), get_new_tc_number(), soar_module::status_object< T >::get_status(), soar_module::primitive_stat< T >::get_value(), identifier_struct::higher_goal, symbol_union::id, make_int_constant(), NIL, soar_module::op_reinit, print(), soar_module::remove_module_wme(), soar_module::primitive_stat< T >::set_value(), soar_module::timer::start(), soar_module::timer::stop(), epmem_timer_container::storage, symbol_remove_ref(), agent_struct::sysparams, epmem_stat_container::time, TRACE_EPMEM_SYSPARAM, epmem_graph_statement_container::update_edge_unique_last, and xml_generate_warning().
Referenced by epmem_consider_new_episode().
epmem_time_id epmem_next_episode | ( | agent * | my_agent, |
epmem_time_id | memory_id | ||
) |
Definition at line 3147 of file episodic_memory.cpp.
References soar_module::sqlite_statement::bind_int(), soar_module::sqlite_statement::column_int(), EPMEM_MEMID_NONE, agent_struct::epmem_stmts_graph, agent_struct::epmem_timers, soar_module::statement::execute(), epmem_timer_container::next, epmem_graph_statement_container::next_episode, soar_module::statement::reinitialize(), soar_module::row, soar_module::timer::start(), and soar_module::timer::stop().
Referenced by epmem_respond_to_cmd().
epmem_time_id epmem_previous_episode | ( | agent * | my_agent, |
epmem_time_id | memory_id | ||
) |
Definition at line 3181 of file episodic_memory.cpp.
References soar_module::sqlite_statement::bind_int(), soar_module::sqlite_statement::column_int(), EPMEM_MEMID_NONE, agent_struct::epmem_stmts_graph, agent_struct::epmem_timers, soar_module::statement::execute(), epmem_timer_container::prev, epmem_graph_statement_container::prev_episode, soar_module::statement::reinitialize(), soar_module::row, soar_module::timer::start(), and soar_module::timer::stop().
Referenced by epmem_respond_to_cmd().
void epmem_print_episode | ( | agent * | my_agent, |
epmem_time_id | memory_id, | ||
std::string * | buf | ||
) |
Definition at line 4488 of file episodic_memory.cpp.
References _epmem_print_sti(), soar_module::sqlite_statement::bind_int(), soar_module::sqlite_statement::column_double(), soar_module::sqlite_statement::column_int(), soar_module::sqlite_statement::column_text(), soar_module::sqlite_statement::column_type(), soar_module::disconnected, agent_struct::epmem_db, epmem_init_db(), EPMEM_MEMID_NONE, epmem_rit_clear_left_right(), epmem_rit_prep_left_right(), EPMEM_RIT_STATE_EDGE, agent_struct::epmem_rit_state_graph, EPMEM_RIT_STATE_NODE, agent_struct::epmem_stmts_graph, epmem_valid_episode(), soar_module::statement::execute(), FLOAT_CONSTANT_SYMBOL_TYPE, epmem_graph_statement_container::get_edges, epmem_graph_statement_container::get_nodes, soar_module::status_object< T >::get_status(), INT_CONSTANT_SYMBOL_TYPE, soar_module::null_t, soar_module::statement::reinitialize(), soar_module::row, and SYM_CONSTANT_SYMBOL_TYPE.
void epmem_print_retrieval_state | ( | epmem_wme_literal_map & | literals, |
epmem_triple_pedge_map | pedge_caches[], | ||
epmem_triple_uedge_map | uedge_caches[] | ||
) |
Definition at line 3300 of file episodic_memory.cpp.
References EPMEM_NODEID_BAD, EPMEM_NODEID_ROOT, EPMEM_RIT_STATE_EDGE, EPMEM_RIT_STATE_NODE, epmem_literal_struct::id_sym, epmem_literal_struct::is_neg_q, epmem_pedge_struct::literals, epmem_literal_struct::matches, epmem_uedge_struct::pedges, epmem_triple_struct::q0, epmem_triple_struct::q1, epmem_literal_struct::q1, epmem_literal_struct::value_is_id, epmem_pedge_struct::value_is_id, epmem_literal_struct::value_sym, epmem_triple_struct::w, and epmem_literal_struct::w.
Referenced by epmem_process_query().
|
inline |
Definition at line 988 of file episodic_memory.cpp.
References _epmem_process_buffered_wme_list(), identifier_struct::epmem_info, epmem_data_struct::epmem_wmes, and symbol_union::id.
Referenced by epmem_respond_to_cmd().
void epmem_process_query | ( | agent * | my_agent, |
Symbol * | state, | ||
Symbol * | pos_query, | ||
Symbol * | neg_query, | ||
epmem_time_list & | prohibits, | ||
epmem_time_id | before, | ||
epmem_time_id | after, | ||
epmem_symbol_set & | currents, | ||
soar_module::wme_set & | cue_wmes, | ||
soar_module::symbol_triple_list & | meta_wmes, | ||
soar_module::symbol_triple_list & | retrieval_wmes, | ||
int | level = 3 |
||
) |
Definition at line 3847 of file episodic_memory.cpp.
References epmem_uedge_struct::activated, epmem_uedge_struct::activation_count, soar_module::sqlite_statement::bind_int(), epmem_literal_struct::children, soar_module::sqlite_statement::column_int(), epmem_buffer_add_wme(), epmem_build_dnf(), epmem_get_augs_of_id(), epmem_gm_mcv_comparator(), epmem_graph_match(), epmem_install_memory(), agent_struct::epmem_interval_pool, agent_struct::epmem_literal_pool, EPMEM_MEMID_NONE, EPMEM_NODE_NEG, EPMEM_NODE_POS, EPMEM_NODEID_BAD, EPMEM_NODEID_ROOT, agent_struct::epmem_params, agent_struct::epmem_pedge_pool, epmem_print_retrieval_state(), EPMEM_RANGE_END, EPMEM_RANGE_EP, EPMEM_RANGE_NOW, EPMEM_RANGE_POINT, EPMEM_RANGE_START, epmem_register_pedges(), identifier_struct::epmem_result_header, EPMEM_RIT_STATE_EDGE, EPMEM_RIT_STATE_NODE, epmem_satisfy_literal(), agent_struct::epmem_stats, agent_struct::epmem_stmts_graph, agent_struct::epmem_sym_bad_cmd, agent_struct::epmem_sym_cue_size, agent_struct::epmem_sym_failure, agent_struct::epmem_sym_graph_match, agent_struct::epmem_sym_graph_match_mapping, agent_struct::epmem_sym_graph_match_mapping_cue, agent_struct::epmem_sym_graph_match_mapping_node, agent_struct::epmem_sym_match_cardinality, agent_struct::epmem_sym_match_score, agent_struct::epmem_sym_normalized_match_score, agent_struct::epmem_sym_retrieved, agent_struct::epmem_sym_status, agent_struct::epmem_sym_success, agent_struct::epmem_timers, agent_struct::epmem_uedge_pool, epmem_unsatisfy_literal(), soar_module::statement::execute(), epmem_graph_statement_container::find_lti_promotion_time, get_new_tc_number(), soar_module::pooled_sqlite_statement::get_pool(), soar_module::constant_param< T >::get_value(), soar_module::primitive_stat< T >::get_value(), epmem_param_container::gm_order_mcv, epmem_param_container::gm_order_undefined, epmem_param_container::gm_ordering, epmem_param_container::graph_match, epmem_pedge_struct::has_noncurrent, epmem_uedge_struct::has_noncurrent, symbol_union::id, epmem_literal_struct::id_sym, epmem_uedge_struct::intervals, epmem_literal_struct::is_current, epmem_interval_struct::is_end_point, epmem_literal_struct::is_leaf, epmem_literal_struct::is_neg_q, identifier_struct::level, epmem_pedge_struct::literals, make_float_constant(), make_int_constant(), make_new_identifier(), epmem_literal_struct::matches, soar_module::on, soar_module::op_reinit, epmem_literal_struct::parents, epmem_uedge_struct::pedges, epmem_graph_statement_container::pool_dummy, epmem_graph_statement_container::pool_find_interval_queries, epmem_graph_statement_container::pool_find_lti_queries, soar_module::statement::prepare(), print(), epmem_triple_struct::q0, epmem_triple_struct::q1, epmem_literal_struct::q1, epmem_timer_container::query, epmem_timer_container::query_cleanup, QUERY_DEBUG, epmem_timer_container::query_dnf, epmem_timer_container::query_graph_match, epmem_timer_container::query_result, epmem_timer_container::query_sql_end_ep, epmem_timer_container::query_sql_end_now, epmem_timer_container::query_sql_end_point, epmem_timer_container::query_sql_start_ep, epmem_timer_container::query_sql_start_now, epmem_timer_container::query_sql_start_point, epmem_timer_container::query_walk, epmem_timer_container::query_walk_edge, epmem_timer_container::query_walk_interval, soar_module::statement::reinitialize(), soar_module::sqlite_statement_pool::release(), soar_module::sqlite_statement_pool::request(), soar_module::row, epmem_pedge_struct::sql, epmem_interval_struct::sql, soar_module::timer::start(), soar_module::timer::stop(), symbol_remove_ref(), agent_struct::sysparams, epmem_stat_container::time, epmem_pedge_struct::time, epmem_interval_struct::time, TRACE_EPMEM_SYSPARAM, epmem_pedge_struct::triple, epmem_uedge_struct::triple, epmem_interval_struct::uedge, epmem_literal_struct::value_is_id, epmem_pedge_struct::value_is_id, epmem_uedge_struct::value_is_id, epmem_literal_struct::value_sym, epmem_literal_struct::values, epmem_triple_struct::w, epmem_literal_struct::w, epmem_literal_struct::weight, and xml_generate_warning().
Referenced by epmem_respond_to_cmd().
bool epmem_register_pedges | ( | epmem_node_id | parent, |
epmem_literal * | literal, | ||
epmem_pedge_pq & | pedge_pq, | ||
epmem_time_id | after, | ||
epmem_triple_pedge_map | pedge_caches[], | ||
epmem_triple_uedge_map | uedge_caches[], | ||
agent * | my_agent | ||
) |
Definition at line 3521 of file episodic_memory.cpp.
References soar_module::sqlite_statement::bind_int(), epmem_literal_struct::children, soar_module::sqlite_statement::column_int(), EPMEM_NODEID_BAD, agent_struct::epmem_pedge_pool, agent_struct::epmem_stmts_graph, agent_struct::epmem_timers, soar_module::statement::execute(), soar_module::pooled_sqlite_statement::get_pool(), epmem_pedge_struct::has_noncurrent, epmem_literal_struct::is_current, epmem_literal_struct::is_leaf, epmem_pedge_struct::literals, epmem_graph_statement_container::pool_find_edge_queries, epmem_triple_struct::q0, epmem_triple_struct::q1, epmem_literal_struct::q1, QUERY_DEBUG, epmem_timer_container::query_sql_edge, soar_module::sqlite_statement_pool::release(), soar_module::sqlite_statement_pool::request(), soar_module::row, epmem_pedge_struct::sql, epmem_pedge_struct::time, epmem_pedge_struct::triple, epmem_literal_struct::value_is_id, epmem_pedge_struct::value_is_id, epmem_uedge_struct::value_is_id, epmem_triple_struct::w, and epmem_literal_struct::w.
Referenced by epmem_process_query().
Definition at line 1466 of file episodic_memory.cpp.
References identifier_struct::epmem_info, EPMEM_MEMID_NONE, epmem_data_struct::epmem_wmes, symbol_union::id, epmem_data_struct::last_cmd_count, epmem_data_struct::last_cmd_time, epmem_data_struct::last_memory, epmem_data_struct::last_ol_time, identifier_struct::lower_goal, and agent_struct::top_goal.
Referenced by remove_existing_context_and_descendents().
void epmem_respond_to_cmd | ( | agent * | my_agent | ) |
Definition at line 5216 of file episodic_memory.cpp.
References _epmem_respond_to_cmd_parse(), epmem_timer_container::api, agent_struct::bottom_goal, epmem_stat_container::cbr, soar_module::connected, soar_module::disconnected, do_working_memory_phase(), epmem_buffer_add_wme(), epmem_clear_result(), identifier_struct::epmem_cmd_header, agent_struct::epmem_db, epmem_get_augs_of_id(), identifier_struct::epmem_info, epmem_init_db(), epmem_install_memory(), EPMEM_MEMID_NONE, epmem_next_episode(), epmem_previous_episode(), epmem_process_buffered_wmes(), epmem_process_query(), identifier_struct::epmem_result_header, agent_struct::epmem_stats, agent_struct::epmem_sym_bad_cmd, agent_struct::epmem_sym_failure, agent_struct::epmem_sym_status, agent_struct::epmem_sym_success, agent_struct::epmem_timers, get_new_tc_number(), soar_module::status_object< T >::get_status(), soar_module::primitive_stat< T >::get_value(), identifier_struct::higher_goal, symbol_union::id, IDENTIFIER_SYMBOL_TYPE, epmem_data_struct::last_cmd_count, epmem_data_struct::last_cmd_time, epmem_data_struct::last_memory, epmem_stat_container::nexts, NIL, epmem_stat_container::prevs, soar_module::primitive_stat< T >::set_value(), soar_module::timer::start(), soar_module::timer::stop(), symbol_remove_ref(), and epmem_timer_container::wm_phase.
Referenced by epmem_go().
void epmem_rit_add_left | ( | agent * | my_agent, |
epmem_time_id | min, | ||
epmem_time_id | max | ||
) |
Definition at line 1128 of file episodic_memory.cpp.
References soar_module::sqlite_statement::bind_int(), agent_struct::epmem_stmts_common, soar_module::statement::execute(), soar_module::op_reinit, and epmem_common_statement_container::rit_add_left.
Referenced by epmem_rit_prep_left_right().
void epmem_rit_add_right | ( | agent * | my_agent, |
epmem_time_id | id | ||
) |
Definition at line 1140 of file episodic_memory.cpp.
References soar_module::sqlite_statement::bind_int(), agent_struct::epmem_stmts_common, soar_module::statement::execute(), soar_module::op_reinit, and epmem_common_statement_container::rit_add_right.
Referenced by epmem_rit_prep_left_right().
void epmem_rit_clear_left_right | ( | agent * | my_agent | ) |
Definition at line 1117 of file episodic_memory.cpp.
References agent_struct::epmem_stmts_common, soar_module::statement::execute(), soar_module::op_reinit, epmem_common_statement_container::rit_truncate_left, and epmem_common_statement_container::rit_truncate_right.
Referenced by epmem_install_memory(), epmem_print_episode(), and epmem_visualize_episode().
int64_t epmem_rit_fork_node | ( | int64_t | lower, |
int64_t | upper, | ||
bool | , | ||
int64_t * | step_return, | ||
epmem_rit_state * | rit_state | ||
) |
Definition at line 1064 of file episodic_memory.cpp.
References EPMEM_RIT_ROOT, soar_module::primitive_stat< T >::get_value(), epmem_rit_state_struct::leftroot, epmem_rit_state_struct::rightroot, and epmem_rit_state_param_struct::stat.
Referenced by epmem_rit_insert_interval().
void epmem_rit_insert_interval | ( | agent * | my_agent, |
int64_t | lower, | ||
int64_t | upper, | ||
epmem_node_id | id, | ||
epmem_rit_state * | rit_state | ||
) |
Definition at line 1252 of file episodic_memory.cpp.
References epmem_rit_state_struct::add_query, soar_module::sqlite_statement::bind_int(), EPMEM_LN_2, epmem_rit_fork_node(), EPMEM_RIT_OFFSET_INIT, EPMEM_RIT_ROOT, epmem_set_variable(), soar_module::statement::execute(), soar_module::primitive_stat< T >::get_value(), epmem_rit_state_struct::leftroot, epmem_rit_state_struct::minstep, epmem_rit_state_struct::offset, soar_module::op_reinit, epmem_rit_state_struct::rightroot, soar_module::primitive_stat< T >::set_value(), epmem_rit_state_param_struct::stat, and epmem_rit_state_param_struct::var_key.
Referenced by epmem_init_db(), and epmem_new_episode().
void epmem_rit_prep_left_right | ( | agent * | my_agent, |
int64_t | lower, | ||
int64_t | upper, | ||
epmem_rit_state * | rit_state | ||
) |
Definition at line 1152 of file episodic_memory.cpp.
References epmem_rit_add_left(), epmem_rit_add_right(), EPMEM_RIT_ROOT, soar_module::primitive_stat< T >::get_value(), epmem_rit_state_struct::leftroot, epmem_rit_state_struct::offset, epmem_rit_state_struct::rightroot, soar_module::timer::start(), epmem_rit_state_param_struct::stat, soar_module::timer::stop(), and epmem_rit_state_struct::timer.
Referenced by epmem_install_memory(), epmem_print_episode(), and epmem_visualize_episode().
bool epmem_satisfy_literal | ( | epmem_literal * | literal, |
epmem_node_id | parent, | ||
epmem_node_id | child, | ||
double & | current_score, | ||
long int & | current_cardinality, | ||
epmem_symbol_node_pair_int_map & | symbol_node_count, | ||
epmem_triple_uedge_map | uedge_caches[], | ||
epmem_symbol_int_map & | symbol_num_incoming | ||
) |
Definition at line 3595 of file episodic_memory.cpp.
References epmem_uedge_struct::activated, epmem_uedge_struct::activation_count, epmem_literal_struct::children, EPMEM_NODEID_BAD, epmem_literal_struct::id_sym, epmem_literal_struct::is_current, epmem_literal_struct::is_leaf, epmem_literal_struct::is_neg_q, epmem_literal_struct::matches, epmem_triple_struct::q0, epmem_triple_struct::q1, epmem_literal_struct::q1, QUERY_DEBUG, epmem_literal_struct::value_is_id, epmem_literal_struct::value_sym, epmem_literal_struct::values, epmem_triple_struct::w, epmem_literal_struct::w, and epmem_literal_struct::weight.
Referenced by epmem_process_query().
Definition at line 2015 of file episodic_memory.cpp.
References soar_module::connected, agent_struct::epmem_db, identifier_struct::epmem_id, EPMEM_NODEID_BAD, agent_struct::epmem_promotions, agent_struct::epmem_validation, soar_module::status_object< T >::get_status(), symbol_union::id, and symbol_add_ref().
Referenced by smem_lti_soar_add(), smem_parse_chunks(), and smem_store_chunk().
void epmem_set_variable | ( | agent * | my_agent, |
epmem_variable_key | variable_id, | ||
int64_t | variable_value | ||
) |
Definition at line 1043 of file episodic_memory.cpp.
References soar_module::sqlite_statement::bind_int(), agent_struct::epmem_stmts_common, soar_module::statement::execute(), soar_module::op_reinit, and epmem_common_statement_container::var_set.
Referenced by _epmem_store_level(), epmem_init_db(), and epmem_rit_insert_interval().
epmem_hash_id epmem_temporal_hash | ( | agent * | my_agent, |
Symbol * | sym, | ||
bool | add_on_fail = true |
||
) |
Definition at line 1924 of file episodic_memory.cpp.
References soar_module::sqlite_statement::bind_double(), soar_module::sqlite_statement::bind_int(), soar_module::sqlite_statement::bind_text(), soar_module::sqlite_statement::column_int(), agent_struct::epmem_db, agent_struct::epmem_stmts_common, agent_struct::epmem_timers, agent_struct::epmem_validation, soar_module::statement::execute(), symbol_union::fc, FLOAT_CONSTANT_SYMBOL_TYPE, epmem_timer_container::hash, epmem_common_statement_container::hash_add, epmem_common_statement_container::hash_get, symbol_union::ic, INT_CONSTANT_SYMBOL_TYPE, soar_module::sqlite_database::last_insert_rowid(), sym_constant_struct::name, NIL, soar_module::op_reinit, soar_module::statement::reinitialize(), soar_module::row, symbol_union::sc, soar_module::timer::start(), soar_module::timer::stop(), SYM_CONSTANT_SYMBOL_TYPE, int_constant_struct::value, and float_constant_struct::value.
Referenced by _epmem_store_level(), and epmem_build_dnf().
bool epmem_unsatisfy_literal | ( | epmem_literal * | literal, |
epmem_node_id | parent, | ||
epmem_node_id | child, | ||
double & | current_score, | ||
long int & | current_cardinality, | ||
epmem_symbol_node_pair_int_map & | symbol_node_count | ||
) |
Definition at line 3674 of file episodic_memory.cpp.
References epmem_literal_struct::children, EPMEM_NODEID_BAD, epmem_literal_struct::is_leaf, epmem_literal_struct::is_neg_q, epmem_literal_struct::matches, QUERY_DEBUG, epmem_literal_struct::value_sym, epmem_literal_struct::values, and epmem_literal_struct::weight.
Referenced by epmem_process_query().
bool epmem_valid_episode | ( | agent * | my_agent, |
epmem_time_id | memory_id | ||
) |
Definition at line 2745 of file episodic_memory.cpp.
References soar_module::sqlite_statement::bind_int(), soar_module::sqlite_statement::column_int(), agent_struct::epmem_stmts_graph, soar_module::statement::execute(), soar_module::statement::reinitialize(), and epmem_graph_statement_container::valid_episode.
Referenced by epmem_install_memory(), epmem_print_episode(), and epmem_visualize_episode().
void epmem_visualize_episode | ( | agent * | my_agent, |
epmem_time_id | memory_id, | ||
std::string * | buf | ||
) |
Definition at line 4672 of file episodic_memory.cpp.
References soar_module::sqlite_statement::bind_int(), soar_module::sqlite_statement::column_double(), soar_module::sqlite_statement::column_int(), soar_module::sqlite_statement::column_text(), soar_module::sqlite_statement::column_type(), soar_module::disconnected, agent_struct::epmem_db, epmem_init_db(), EPMEM_MEMID_NONE, epmem_rit_clear_left_right(), epmem_rit_prep_left_right(), EPMEM_RIT_STATE_EDGE, agent_struct::epmem_rit_state_graph, EPMEM_RIT_STATE_NODE, agent_struct::epmem_stmts_graph, epmem_valid_episode(), soar_module::statement::execute(), FLOAT_CONSTANT_SYMBOL_TYPE, epmem_graph_statement_container::get_edges, epmem_graph_statement_container::get_nodes, soar_module::status_object< T >::get_status(), INT_CONSTANT_SYMBOL_TYPE, soar_module::null_t, soar_module::statement::reinitialize(), soar_module::row, and SYM_CONSTANT_SYMBOL_TYPE.