Soar Kernel
9.3.2 08-06-12
|
#include <portability.h>
#include <stack>
#include <set>
#include <list>
#include <vector>
#include <queue>
#include "soar_module.h"
#include "soar_db.h"
Go to the source code of this file.
Data Structures | |
struct | smem_chunk_struct |
struct | smem_chunk_value_constant |
struct | smem_chunk_value_lti |
union | smem_chunk_value_union |
struct | smem_compare_activated_lti |
struct | smem_compare_weighted_cue_elements |
struct | smem_data_struct |
class | smem_db_lib_version_stat |
class | smem_db_predicate< T > |
class | smem_mem_high_stat |
class | smem_mem_usage_stat |
class | smem_param_container |
class | smem_path_param |
class | smem_stat_container |
class | smem_statement_container |
class | smem_timer |
class | smem_timer_container |
class | smem_timer_level_predicate |
struct | smem_vis_lti_struct |
struct | smem_weighted_cue_element_struct |
Macros | |
#define | SMEM_ACT_HISTORY_ENTRIES 10 |
#define | SMEM_ACT_LOW -1000000000 |
#define | SMEM_ACT_MAX static_cast<uint64_t>( static_cast<uint64_t>( 0 - 1 ) / static_cast<uint64_t>(2) ) |
#define | SMEM_LTI_UNKNOWN_LEVEL 0 |
#define | SMEM_SCHEMA "smem7_" |
#define | SMEM_SIGNATURE SMEM_SCHEMA "signature" |
#define | SMEM_WEB_NULL 0 |
#define | SMEM_WEB_NULL_STR "0" |
Enumerations | |
enum | smem_cue_element_type |
enum | smem_query_levels |
enum | smem_storage_type |
enum | smem_variable_key |
Functions | |
void | smem_attach (agent *my_agent) |
bool | smem_backup_db (agent *my_agent, const char *file_name, std::string *err) |
void | smem_close (agent *my_agent) |
Bool | smem_count_ltis (agent *my_agent, void *item, void *userdata) |
bool | smem_enabled (agent *my_agent) |
void | smem_go (agent *my_agent, bool store_only) |
smem_lti_id | smem_lti_get_id (agent *my_agent, char name_letter, uint64_t name_number) |
Symbol * | smem_lti_soar_make (agent *my_agent, smem_lti_id lti, char name_letter, uint64_t name_number, goal_stack_level level) |
bool | smem_parse_chunks (agent *my_agent, const char *chunks, std::string **err_msg) |
void | smem_print_lti (agent *my_agent, smem_lti_id lti_id, unsigned int depth, std::string *return_val) |
void | smem_print_store (agent *my_agent, std::string *return_val) |
void | smem_reset (agent *my_agent, Symbol *state) |
void | smem_reset_id_counters (agent *my_agent) |
bool | smem_valid_production (condition *lhs_top, action *rhs_top) |
void | smem_visualize_lti (agent *my_agent, smem_lti_id lti_id, unsigned int depth, std::string *return_val) |
void | smem_visualize_store (agent *my_agent, std::string *return_val) |
#define SMEM_ACT_HISTORY_ENTRIES 10 |
Definition at line 298 of file semantic_memory.h.
Referenced by smem_lti_calc_base().
#define SMEM_ACT_LOW -1000000000 |
Definition at line 299 of file semantic_memory.h.
Referenced by smem_lti_calc_base().
#define SMEM_ACT_MAX static_cast<uint64_t>( static_cast<uint64_t>( 0 - 1 ) / static_cast<uint64_t>(2) ) |
Definition at line 291 of file semantic_memory.h.
Referenced by smem_lti_activate(), smem_process_query(), and smem_store_chunk().
#define SMEM_LTI_UNKNOWN_LEVEL 0 |
Definition at line 293 of file semantic_memory.h.
Referenced by add_wme_to_wm(), instantiate_rhs_value(), make_symbol_for_current_lexeme(), parse_rhs_action(), and smem_lti_soar_make().
#define SMEM_SCHEMA "smem7_" |
Definition at line 305 of file semantic_memory.h.
Referenced by smem_statement_container::smem_statement_container().
#define SMEM_SIGNATURE SMEM_SCHEMA "signature" |
Definition at line 308 of file semantic_memory.h.
Referenced by smem_init_db().
#define SMEM_WEB_NULL 0 |
Definition at line 295 of file semantic_memory.h.
Referenced by _smem_print_lti(), smem_disconnect_chunk(), smem_install_memory(), smem_store_chunk(), and smem_visualize_lti().
#define SMEM_WEB_NULL_STR "0" |
Definition at line 296 of file semantic_memory.h.
Referenced by smem_statement_container::smem_statement_container().
typedef struct action_struct action |
Definition at line 468 of file semantic_memory.h.
typedef struct condition_struct condition |
Definition at line 467 of file semantic_memory.h.
typedef std::pair< double, smem_lti_id > smem_activated_lti |
Definition at line 386 of file semantic_memory.h.
typedef struct smem_chunk_struct smem_chunk |
Definition at line 400 of file semantic_memory.h.
typedef std::set<smem_chunk *> smem_chunk_set |
Definition at line 401 of file semantic_memory.h.
typedef union smem_chunk_value_union smem_chunk_value |
Definition at line 402 of file semantic_memory.h.
typedef struct smem_data_struct smem_data |
typedef uint64_t smem_hash_id |
Definition at line 319 of file semantic_memory.h.
typedef uint64_t smem_lti_id |
Definition at line 316 of file semantic_memory.h.
typedef std::list<smem_lti_id> smem_lti_list |
Definition at line 322 of file semantic_memory.h.
typedef std::set<smem_lti_id> smem_lti_set |
Definition at line 323 of file semantic_memory.h.
typedef std::set< Symbol*, std::less< Symbol* >, soar_module::soar_memory_pool_allocator< Symbol* > > smem_pooled_symbol_set |
Definition at line 336 of file semantic_memory.h.
typedef std::priority_queue< smem_activated_lti, std::vector<smem_activated_lti>, smem_compare_activated_lti> smem_prioritized_activated_lti_queue |
Definition at line 396 of file semantic_memory.h.
typedef std::priority_queue<smem_weighted_cue_element *, std::vector<smem_weighted_cue_element *>, smem_compare_weighted_cue_elements> smem_prioritized_weighted_cue |
Definition at line 383 of file semantic_memory.h.
typedef std::list<smem_chunk_value *> smem_slot |
Definition at line 403 of file semantic_memory.h.
typedef std::map<Symbol *, smem_slot *> smem_slot_map |
Definition at line 404 of file semantic_memory.h.
typedef std::map<std::string, smem_chunk *> smem_str_to_chunk_map |
Definition at line 435 of file semantic_memory.h.
typedef std::list<Symbol *> smem_sym_list |
Definition at line 326 of file semantic_memory.h.
typedef std::map<Symbol *, smem_chunk *> smem_sym_to_chunk_map |
Definition at line 436 of file semantic_memory.h.
typedef struct smem_vis_lti_struct smem_vis_lti |
typedef struct smem_weighted_cue_element_struct smem_weighted_cue_element |
Definition at line 384 of file semantic_memory.h.
typedef std::list<wme *> smem_wme_list |
Definition at line 332 of file semantic_memory.h.
typedef std::list< preference*, soar_module::soar_memory_pool_allocator< preference* > > smem_wme_stack |
Definition at line 343 of file semantic_memory.h.
Definition at line 359 of file semantic_memory.h.
enum smem_query_levels |
Definition at line 450 of file semantic_memory.h.
enum smem_storage_type |
Definition at line 329 of file semantic_memory.h.
enum smem_variable_key |
Definition at line 286 of file semantic_memory.h.
void smem_attach | ( | agent * | my_agent | ) |
Definition at line 2786 of file semantic_memory.cpp.
References soar_module::disconnected, soar_module::status_object< T >::get_status(), agent_struct::smem_db, and smem_init_db().
Referenced by do_one_top_level_phase(), smem_lti_get_id(), smem_parse_chunks(), smem_print_lti(), smem_print_store(), smem_respond_to_cmd(), and smem_visualize_store().
bool smem_backup_db | ( | agent * | my_agent, |
const char * | file_name, | ||
std::string * | err | ||
) |
Definition at line 3812 of file semantic_memory.cpp.
References _smem_close_vars(), soar_module::sqlite_database::backup(), smem_statement_container::begin, smem_statement_container::commit, soar_module::connected, soar_module::statement::execute(), soar_module::status_object< T >::get_status(), soar_module::constant_param< T >::get_value(), smem_param_container::lazy_commit, soar_module::on, soar_module::op_reinit, agent_struct::smem_db, agent_struct::smem_params, and agent_struct::smem_stmts.
void smem_close | ( | agent * | my_agent | ) |
Definition at line 2805 of file semantic_memory.cpp.
References _smem_close_vars(), smem_statement_container::commit, soar_module::connected, soar_module::sqlite_database::disconnect(), soar_module::statement::execute(), soar_module::status_object< T >::get_status(), soar_module::constant_param< T >::get_value(), smem_param_container::lazy_commit, soar_module::on, soar_module::op_reinit, agent_struct::smem_db, agent_struct::smem_params, and agent_struct::smem_stmts.
Referenced by destroy_soar_agent().
Definition at line 1396 of file semantic_memory.cpp.
References symbol_union::id, NIL, and identifier_struct::smem_lti.
Referenced by reset_id_counters().
bool smem_enabled | ( | agent * | my_agent | ) |
Definition at line 194 of file semantic_memory.cpp.
References soar_module::constant_param< T >::get_value(), smem_param_container::learning, soar_module::on, and agent_struct::smem_params.
Referenced by add_wme_to_rete(), do_one_top_level_phase(), and remove_wme_from_rete().
void smem_go | ( | agent * | my_agent, |
bool | store_only | ||
) |
Definition at line 3797 of file semantic_memory.cpp.
References smem_respond_to_cmd(), agent_struct::smem_timers, soar_module::timer::start(), soar_module::timer::stop(), and smem_timer_container::total.
Referenced by do_one_top_level_phase().
smem_lti_id smem_lti_get_id | ( | agent * | my_agent, |
char | name_letter, | ||
uint64_t | name_number | ||
) |
Definition at line 1410 of file semantic_memory.cpp.
References soar_module::sqlite_statement::bind_int(), soar_module::sqlite_statement::column_int(), soar_module::statement::execute(), smem_statement_container::lti_get, NIL, soar_module::statement::reinitialize(), soar_module::row, smem_attach(), and agent_struct::smem_stmts.
Referenced by _epmem_install_id_wme(), make_symbol_for_current_lexeme(), parse_rhs_action(), smem_lti_soar_add(), and smem_parse_chunks().
Symbol* smem_lti_soar_make | ( | agent * | my_agent, |
smem_lti_id | lti, | ||
char | name_letter, | ||
uint64_t | name_number, | ||
goal_stack_level | level | ||
) |
Definition at line 1478 of file semantic_memory.cpp.
References find_identifier(), symbol_union::id, identifier_struct::level, make_new_identifier(), NIL, identifier_struct::promotion_level, identifier_struct::smem_lti, SMEM_LTI_UNKNOWN_LEVEL, and symbol_add_ref().
Referenced by _epmem_install_id_wme(), make_symbol_for_current_lexeme(), parse_rhs_action(), and smem_install_memory().
bool smem_parse_chunks | ( | agent * | my_agent, |
const char * | chunks, | ||
std::string ** | err_msg | ||
) |
Definition at line 3248 of file semantic_memory.cpp.
References agent_struct::alternate_input_exit, agent_struct::alternate_input_string, agent_struct::alternate_input_suffix, agent_struct::current_char, epmem_schedule_promotion(), agent_struct::epmem_stats, agent_struct::epmem_validation, find_identifier(), get_lexeme(), soar_module::primitive_stat< T >::get_value(), symbol_union::id, agent_struct::id_counter, L_PAREN_LEXEME, agent_struct::lexeme, NIL, set_lexer_allow_ids(), smem_attach(), smem_deallocate_chunk(), identifier_struct::smem_lti, smem_lti_add_id(), smem_lti_get_id(), smem_parse_chunk(), smem_store_chunk(), identifier_struct::smem_time_id, identifier_struct::smem_valid, epmem_stat_container::time, and lexeme_info::type.
void smem_print_lti | ( | agent * | my_agent, |
smem_lti_id | lti_id, | ||
unsigned int | depth, | ||
std::string * | return_val | ||
) |
Definition at line 4501 of file semantic_memory.cpp.
References _smem_print_lti(), soar_module::sqlite_statement::bind_int(), soar_module::sqlite_statement::column_double(), soar_module::sqlite_statement::column_int(), soar_module::statement::execute(), smem_statement_container::lti_letter_num, soar_module::statement::reinitialize(), smem_attach(), agent_struct::smem_stmts, and smem_statement_container::vis_lti_act.
void smem_print_store | ( | agent * | my_agent, |
std::string * | return_val | ||
) |
Definition at line 4487 of file semantic_memory.cpp.
References _smem_print_lti(), soar_module::sqlite_statement::column_double(), soar_module::sqlite_statement::column_int(), soar_module::statement::execute(), soar_module::statement::reinitialize(), soar_module::row, smem_attach(), agent_struct::smem_stmts, and smem_statement_container::vis_lti.
Definition at line 2543 of file semantic_memory.cpp.
References symbol_union::id, smem_data_struct::last_cmd_count, smem_data_struct::last_cmd_time, identifier_struct::lower_goal, identifier_struct::smem_info, smem_data_struct::smem_wmes, and agent_struct::top_goal.
Referenced by remove_existing_context_and_descendents().
void smem_reset_id_counters | ( | agent * | my_agent | ) |
Definition at line 1507 of file semantic_memory.cpp.
References soar_module::sqlite_statement::column_int(), soar_module::connected, soar_module::statement::execute(), soar_module::status_object< T >::get_status(), agent_struct::id_counter, smem_statement_container::lti_max, soar_module::statement::reinitialize(), soar_module::row, agent_struct::smem_db, and agent_struct::smem_stmts.
Referenced by reset_id_counters(), and smem_init_db().
Definition at line 1298 of file semantic_memory.cpp.
References _smem_lti_from_rhs_value(), _smem_lti_from_test(), action_struct::already_in_tc, action_struct::attr, action_struct::id, symbol_union::id, IDENTIFIER_SYMBOL_TYPE, MAKE_ACTION, action_struct::next, NIL, POSITIVE_CONDITION, rhs_value_to_symbol(), identifier_struct::smem_lti, action_struct::type, and action_struct::value.
Referenced by chunk_instantiation(), and make_production().
void smem_visualize_lti | ( | agent * | my_agent, |
smem_lti_id | lti_id, | ||
unsigned int | depth, | ||
std::string * | return_val | ||
) |
Definition at line 4095 of file semantic_memory.cpp.
References soar_module::sqlite_statement::bind_int(), soar_module::sqlite_statement::column_double(), soar_module::sqlite_statement::column_int(), soar_module::statement::execute(), FLOAT_CONSTANT_SYMBOL_TYPE, INT_CONSTANT_SYMBOL_TYPE, smem_vis_lti_struct::level, smem_vis_lti_struct::lti_id, smem_statement_container::lti_letter_num, smem_vis_lti_struct::lti_name, soar_module::statement::reinitialize(), soar_module::row, smem_reverse_hash_float(), smem_reverse_hash_int(), smem_reverse_hash_str(), agent_struct::smem_stmts, SMEM_WEB_NULL, SYM_CONSTANT_SYMBOL_TYPE, smem_statement_container::vis_lti_act, and smem_statement_container::web_expand.
void smem_visualize_store | ( | agent * | my_agent, |
std::string * | return_val | ||
) |
Definition at line 3847 of file semantic_memory.cpp.
References soar_module::sqlite_statement::column_double(), soar_module::sqlite_statement::column_int(), soar_module::statement::execute(), FLOAT_CONSTANT_SYMBOL_TYPE, INT_CONSTANT_SYMBOL_TYPE, soar_module::statement::reinitialize(), soar_module::row, smem_attach(), smem_reverse_hash_float(), smem_reverse_hash_int(), smem_reverse_hash_str(), agent_struct::smem_stmts, SYM_CONSTANT_SYMBOL_TYPE, smem_statement_container::vis_lti, smem_statement_container::vis_value_const, and smem_statement_container::vis_value_lti.