Soar Kernel
9.3.2 08-06-12
|
#include <portability.h>
#include <map>
#include <list>
#include <stack>
#include <set>
#include <queue>
#include "soar_module.h"
#include "soar_db.h"
Go to the source code of this file.
Data Structures | |
class | epmem_common_statement_container |
struct | epmem_data_struct |
class | epmem_db_lib_version_stat |
class | epmem_db_predicate< T > |
struct | epmem_edge_struct |
class | epmem_graph_statement_container |
struct | epmem_id_reservation_struct |
struct | epmem_interval_comparator |
struct | epmem_interval_struct |
struct | epmem_literal_struct |
class | epmem_mem_high_stat |
class | epmem_mem_usage_stat |
class | epmem_param_container |
class | epmem_path_param |
struct | epmem_pedge_comparator |
struct | epmem_pedge_struct |
struct | epmem_rit_state_param_struct |
struct | epmem_rit_state_struct |
class | epmem_stat_container |
class | epmem_timer |
class | epmem_timer_container |
class | epmem_timer_level_predicate |
struct | epmem_triple_struct |
struct | epmem_uedge_struct |
Macros | |
#define | EPMEM_DNF 2 |
#define | EPMEM_HASH_ACCEPTABLE 1 |
#define | EPMEM_LN_2 0.693147180559945 |
#define | EPMEM_MEMID_NONE 0 |
#define | EPMEM_NODE_NEG 1 |
#define | EPMEM_NODE_POS 0 |
#define | EPMEM_NODEID_BAD -1 |
#define | EPMEM_NODEID_ROOT 0 |
#define | EPMEM_RANGE_END 1 |
#define | EPMEM_RANGE_EP 0 |
#define | EPMEM_RANGE_NOW 1 |
#define | EPMEM_RANGE_POINT 2 |
#define | EPMEM_RANGE_START 0 |
#define | EPMEM_RIT_OFFSET_INIT -1 |
#define | EPMEM_RIT_ROOT 0 |
#define | EPMEM_RIT_STATE_EDGE 1 |
#define | EPMEM_RIT_STATE_NODE 0 |
Enumerations | |
enum | epmem_variable_key |
Functions | |
bool | epmem_backup_db (agent *my_agent, const char *file_name, std::string *err) |
void | epmem_close (agent *my_agent) |
bool | epmem_enabled (agent *my_agent) |
void | epmem_go (agent *my_agent, bool allow_store=true) |
void | epmem_print_episode (agent *my_agent, epmem_time_id memory_id, std::string *buf) |
void | epmem_reset (agent *my_agent, Symbol *state=NULL) |
void | epmem_schedule_promotion (agent *my_agent, Symbol *id) |
void | epmem_visualize_episode (agent *my_agent, epmem_time_id memory_id, std::string *buf) |
#define EPMEM_DNF 2 |
Definition at line 67 of file episodic_memory.h.
#define EPMEM_HASH_ACCEPTABLE 1 |
Definition at line 53 of file episodic_memory.h.
Referenced by _epmem_store_level().
#define EPMEM_LN_2 0.693147180559945 |
Definition at line 65 of file episodic_memory.h.
Referenced by epmem_rit_insert_interval().
#define EPMEM_MEMID_NONE 0 |
Definition at line 50 of file episodic_memory.h.
Referenced by _epmem_respond_to_cmd_parse(), create_new_context(), epmem_install_memory(), epmem_next_episode(), epmem_previous_episode(), epmem_print_episode(), epmem_process_query(), epmem_reset(), epmem_respond_to_cmd(), epmem_visualize_episode(), and make_new_identifier().
#define EPMEM_NODE_NEG 1 |
Definition at line 56 of file episodic_memory.h.
Referenced by epmem_process_query().
#define EPMEM_NODE_POS 0 |
Definition at line 55 of file episodic_memory.h.
Referenced by epmem_process_query().
#define EPMEM_NODEID_BAD -1 |
Definition at line 52 of file episodic_memory.h.
Referenced by _epmem_process_ids(), _epmem_remove_wme(), _epmem_store_level(), add_wme_to_rete(), epmem_build_dnf(), epmem_graph_match(), epmem_new_episode(), epmem_print_retrieval_state(), epmem_process_query(), epmem_register_pedges(), epmem_satisfy_literal(), epmem_schedule_promotion(), epmem_unsatisfy_literal(), make_new_identifier(), and make_wme().
#define EPMEM_NODEID_ROOT 0 |
Definition at line 51 of file episodic_memory.h.
Referenced by epmem_init_db(), epmem_install_memory(), epmem_print_retrieval_state(), and epmem_process_query().
#define EPMEM_RANGE_END 1 |
Definition at line 58 of file episodic_memory.h.
Referenced by epmem_close(), epmem_graph_statement_container::epmem_graph_statement_container(), and epmem_process_query().
#define EPMEM_RANGE_EP 0 |
Definition at line 59 of file episodic_memory.h.
Referenced by epmem_close(), epmem_graph_statement_container::epmem_graph_statement_container(), and epmem_process_query().
#define EPMEM_RANGE_NOW 1 |
Definition at line 60 of file episodic_memory.h.
Referenced by epmem_process_query().
#define EPMEM_RANGE_POINT 2 |
Definition at line 61 of file episodic_memory.h.
Referenced by epmem_close(), epmem_graph_statement_container::epmem_graph_statement_container(), and epmem_process_query().
#define EPMEM_RANGE_START 0 |
Definition at line 57 of file episodic_memory.h.
Referenced by epmem_close(), epmem_graph_statement_container::epmem_graph_statement_container(), epmem_process_query(), and epmem_interval_comparator::operator()().
#define EPMEM_RIT_OFFSET_INIT -1 |
Definition at line 64 of file episodic_memory.h.
Referenced by epmem_init_db(), and epmem_rit_insert_interval().
#define EPMEM_RIT_ROOT 0 |
Definition at line 63 of file episodic_memory.h.
Referenced by epmem_rit_fork_node(), epmem_rit_insert_interval(), and epmem_rit_prep_left_right().
#define EPMEM_RIT_STATE_EDGE 1 |
Definition at line 70 of file episodic_memory.h.
Referenced by epmem_build_dnf(), epmem_close(), epmem_graph_statement_container::epmem_graph_statement_container(), epmem_init_db(), epmem_install_memory(), epmem_new_episode(), epmem_print_episode(), epmem_print_retrieval_state(), epmem_process_query(), epmem_stat_container::epmem_stat_container(), epmem_timer_container::epmem_timer_container(), and epmem_visualize_episode().
#define EPMEM_RIT_STATE_NODE 0 |
Definition at line 69 of file episodic_memory.h.
Referenced by epmem_build_dnf(), epmem_close(), epmem_graph_statement_container::epmem_graph_statement_container(), epmem_init_db(), epmem_install_memory(), epmem_new_episode(), epmem_print_episode(), epmem_print_retrieval_state(), epmem_process_query(), epmem_stat_container::epmem_stat_container(), epmem_timer_container::epmem_timer_container(), and epmem_visualize_episode().
typedef struct epmem_data_struct epmem_data |
typedef struct epmem_edge_struct epmem_edge |
typedef uint64_t epmem_hash_id |
Definition at line 81 of file episodic_memory.h.
typedef std::map<epmem_node_id, epmem_id_pool *> epmem_hashed_id_pool |
Definition at line 445 of file episodic_memory.h.
typedef std::map<epmem_node_id, Symbol *> epmem_id_mapping |
Definition at line 440 of file episodic_memory.h.
typedef std::pair<epmem_node_id, epmem_node_id> epmem_id_pair |
Definition at line 443 of file episodic_memory.h.
typedef std::list<epmem_id_pair> epmem_id_pool |
Definition at line 444 of file episodic_memory.h.
typedef std::map<epmem_node_id, epmem_wme_set*> epmem_id_ref_counter |
Definition at line 465 of file episodic_memory.h.
typedef std::map< epmem_node_id, bool, std::less< epmem_node_id >, soar_module::soar_memory_pool_allocator< std::pair< epmem_node_id, bool > > > epmem_id_removal_map |
Definition at line 454 of file episodic_memory.h.
typedef struct epmem_id_reservation_struct epmem_id_reservation |
typedef struct epmem_interval_struct epmem_interval |
Definition at line 522 of file episodic_memory.h.
typedef std::priority_queue<epmem_interval*, std::vector<epmem_interval*>, epmem_interval_comparator> epmem_interval_pq |
Definition at line 638 of file episodic_memory.h.
typedef std::set<epmem_interval*, std::less<epmem_interval*>, soar_module::soar_memory_pool_allocator<epmem_interval*> > epmem_interval_set |
Definition at line 547 of file episodic_memory.h.
typedef struct epmem_literal_struct epmem_literal |
Definition at line 519 of file episodic_memory.h.
typedef std::deque<epmem_literal*> epmem_literal_deque |
Definition at line 531 of file episodic_memory.h.
typedef struct std::pair< epmem_literal *, epmem_node_id > epmem_literal_node_pair |
Definition at line 527 of file episodic_memory.h.
typedef std::map<epmem_literal_node_pair, int> epmem_literal_node_pair_int_map |
Definition at line 535 of file episodic_memory.h.
typedef std::map<epmem_literal*, epmem_node_pair> epmem_literal_node_pair_map |
Definition at line 534 of file episodic_memory.h.
typedef std::set<epmem_literal*> epmem_literal_set |
Definition at line 542 of file episodic_memory.h.
typedef std::deque<epmem_node_id> epmem_node_deque |
Definition at line 532 of file episodic_memory.h.
typedef int64_t epmem_node_id |
Definition at line 78 of file episodic_memory.h.
Definition at line 170 of file episodic_memory.h.
typedef std::map<epmem_node_id, int> epmem_node_int_map |
Definition at line 537 of file episodic_memory.h.
typedef struct std::pair< epmem_node_id, epmem_node_id > epmem_node_pair |
Definition at line 528 of file episodic_memory.h.
typedef std::set<epmem_node_pair, std::less<epmem_node_pair>, soar_module::soar_memory_pool_allocator<epmem_node_pair> > epmem_node_pair_set |
Definition at line 549 of file episodic_memory.h.
typedef std::set<epmem_node_id, std::less<epmem_node_id>, soar_module::soar_memory_pool_allocator<epmem_node_id> > epmem_node_set |
Definition at line 548 of file episodic_memory.h.
typedef std::map<epmem_node_id, Symbol*> epmem_node_symbol_map |
Definition at line 536 of file episodic_memory.h.
typedef std::map<epmem_node_id, epmem_hashed_id_pool *> epmem_parent_id_pool |
Definition at line 446 of file episodic_memory.h.
typedef struct epmem_pedge_struct epmem_pedge |
Definition at line 520 of file episodic_memory.h.
typedef std::priority_queue<epmem_pedge*, std::vector<epmem_pedge*>, epmem_pedge_comparator> epmem_pedge_pq |
Definition at line 625 of file episodic_memory.h.
typedef std::set<epmem_pedge*> epmem_pedge_set |
Definition at line 543 of file episodic_memory.h.
typedef std::map<epmem_node_id, epmem_id_pool *> epmem_return_id_pool |
Definition at line 447 of file episodic_memory.h.
typedef struct epmem_rit_state_struct epmem_rit_state |
typedef struct epmem_rit_state_param_struct epmem_rit_state_param |
typedef std::map<Symbol*, int> epmem_symbol_int_map |
Definition at line 533 of file episodic_memory.h.
typedef struct std::pair< Symbol *, epmem_literal * > epmem_symbol_literal_pair |
Definition at line 525 of file episodic_memory.h.
typedef std::map<epmem_symbol_literal_pair, int> epmem_symbol_literal_pair_int_map |
Definition at line 538 of file episodic_memory.h.
typedef struct std::pair< Symbol *, epmem_node_id > epmem_symbol_node_pair |
Definition at line 526 of file episodic_memory.h.
typedef std::map<epmem_symbol_node_pair, int> epmem_symbol_node_pair_int_map |
Definition at line 539 of file episodic_memory.h.
typedef std::set< Symbol*, std::less< Symbol* >, soar_module::soar_memory_pool_allocator< Symbol* > > epmem_symbol_set |
Definition at line 455 of file episodic_memory.h.
typedef std::list< Symbol*, soar_module::soar_memory_pool_allocator< Symbol* > > epmem_symbol_stack |
Definition at line 451 of file episodic_memory.h.
typedef uint64_t epmem_time_id |
Definition at line 84 of file episodic_memory.h.
Definition at line 169 of file episodic_memory.h.
typedef std::vector<epmem_time_id> epmem_time_list |
Definition at line 391 of file episodic_memory.h.
typedef struct epmem_triple_struct epmem_triple |
Definition at line 518 of file episodic_memory.h.
typedef std::map<epmem_triple, epmem_pedge*> epmem_triple_pedge_map |
Definition at line 540 of file episodic_memory.h.
typedef std::map<epmem_triple, epmem_uedge*, std::less<epmem_triple>, soar_module::soar_memory_pool_allocator<std::pair<const epmem_triple, epmem_uedge*> > > epmem_triple_uedge_map |
Definition at line 546 of file episodic_memory.h.
typedef struct epmem_uedge_struct epmem_uedge |
Definition at line 521 of file episodic_memory.h.
typedef std::list<wme *> epmem_wme_list |
Definition at line 394 of file episodic_memory.h.
typedef std::map<wme*, epmem_literal*> epmem_wme_literal_map |
Definition at line 541 of file episodic_memory.h.
typedef std::set< wme*, std::less< wme* >, soar_module::soar_memory_pool_allocator< wme* > > epmem_wme_set |
Definition at line 450 of file episodic_memory.h.
typedef std::list< preference*, soar_module::soar_memory_pool_allocator< preference* > > epmem_wme_stack |
Definition at line 420 of file episodic_memory.h.
enum epmem_variable_key |
var_rit_offset_1 | |
var_rit_leftroot_1 | |
var_rit_rightroot_1 | |
var_rit_minstep_1 | |
var_rit_offset_2 | |
var_rit_leftroot_2 | |
var_rit_rightroot_2 | |
var_rit_minstep_2 | |
var_next_id |
Definition at line 42 of file episodic_memory.h.
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.
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_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().
void epmem_go | ( | agent * | my_agent, |
bool | allow_store = true |
||
) |
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().
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.
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().
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_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.