Soar Kernel
9.3.2 08-06-12
|
Go to the source code of this file.
Data Structures | |
class | wma_activation_param |
class | wma_activation_predicate< T > |
struct | wma_cycle_reference_struct |
struct | wma_decay_element_struct |
class | wma_decay_param |
struct | wma_history_struct |
class | wma_param_container |
class | wma_stat_container |
class | wma_timer |
class | wma_timer_container |
class | wma_timer_level_predicate |
Macros | |
#define | WMA_ACTIVATION_LOW -1000000000 |
#define | WMA_ACTIVATION_NONE 1.0 |
#define | WMA_DECAY_HISTORY 10 |
#define | WMA_FORGOTTEN_CYCLE 0 |
#define | WMA_REFERENCES_PER_DECISION 50 |
#define | WMA_TIME_SUM_NONE 2.71828182845905 |
Enumerations | |
enum | wma_go_action |
Functions | |
void | wma_activate_wme (agent *my_agent, wme *w, wma_reference num_references=1, wma_pooled_wme_set *o_set=NULL, bool o_only=false) |
void | wma_activate_wmes_in_pref (agent *my_agent, preference *pref) |
void | wma_activate_wmes_tested_in_prods (agent *my_agent) |
bool | wma_enabled (agent *my_agent) |
double | wma_get_wme_activation (agent *my_agent, wme *w, bool log_result) |
void | wma_get_wme_history (agent *my_agent, wme *w, std::string &buffer) |
void | wma_go (agent *my_agent, wma_go_action go_action) |
void | wma_remove_decay_element (agent *my_agent, wme *w) |
void | wma_remove_pref_o_set (agent *my_agent, preference *pref) |
#define WMA_ACTIVATION_LOW -1000000000 |
If no history, this is a low number to report as activation
Definition at line 48 of file wma.h.
Referenced by wma_calculate_decay_activation().
#define WMA_ACTIVATION_NONE 1.0 |
If an external caller asks for the activation level/value of a WME that is not activated, then this is the value that is returned.
Definition at line 42 of file wma.h.
Referenced by wma_get_wme_activation().
#define WMA_DECAY_HISTORY 10 |
This is the size of the reference history.
Definition at line 29 of file wma.h.
Referenced by wma_activate_wme(), wma_history_next(), wma_history_prev(), and wma_update_decay_histories().
#define WMA_FORGOTTEN_CYCLE 0 |
If below decay thresh, but not forgotten, forget_cycle =
Definition at line 53 of file wma.h.
Referenced by wma_forgetting_update_p_queue().
#define WMA_REFERENCES_PER_DECISION 50 |
How many references are expected per decision (this affects creation of the power/approx cache)
Definition at line 35 of file wma.h.
Referenced by wma_forgetting_estimate_cycle(), and wma_init().
#define WMA_TIME_SUM_NONE 2.71828182845905 |
Definition at line 43 of file wma.h.
Referenced by wma_get_wme_activation().
typedef struct wma_cycle_reference_struct wma_cycle_reference |
typedef uint64_t wma_d_cycle |
typedef std::set< wma_d_cycle, std::less< wma_d_cycle >, soar_module::soar_memory_pool_allocator< wma_d_cycle > > wma_decay_cycle_set |
typedef struct wma_decay_element_struct wma_decay_element |
typedef std::set< wma_decay_element*, std::less< wma_decay_element* >, soar_module::soar_memory_pool_allocator< wma_decay_element* > > wma_decay_set |
typedef std::map< wma_d_cycle, wma_decay_set*, std::less< wma_d_cycle >, soar_module::soar_memory_pool_allocator< std::pair< wma_d_cycle, wma_decay_set* > > > wma_forget_p_queue |
typedef struct wma_history_struct wma_history |
typedef std::set< wme*, std::less< wme* >, soar_module::soar_memory_pool_allocator< wme* > > wma_pooled_wme_set |
typedef uint64_t wma_reference |
typedef std::map< Symbol*, uint64_t, std::less< Symbol* >, soar_module::soar_memory_pool_allocator< std::pair< Symbol*, uint64_t > > > wma_sym_reference_map |
typedef struct wme_struct wme |
enum wma_go_action |
Definition at line 220 of file wma.h.
void wma_activate_wme | ( | agent * | my_agent, |
wme * | w, | ||
wma_reference | num_references = 1 , |
||
wma_pooled_wme_set * | o_set = NULL , |
||
bool | o_only = false |
||
) |
Definition at line 470 of file wma.cpp.
References wma_history_struct::access_history, wme_struct::attr, wma_cycle_reference_struct::d_cycle, agent_struct::d_cycle_count, symbol_union::fc, wma_history_struct::first_reference, FLOAT_CONSTANT_SYMBOL_TYPE, wma_decay_element_struct::forget_cycle, wma_history_struct::history_ct, wma_history_struct::history_references, symbol_union::ic, wme_struct::id, symbol_union::id, preference_struct::inst, INT_CONSTANT_SYMBOL_TYPE, wma_decay_element_struct::just_created, wma_decay_element_struct::just_removed, sym_constant_struct::name, identifier_struct::name_letter, identifier_struct::name_number, condition_struct::next, wma_history_struct::next_p, wma_cycle_reference_struct::num_references, wma_decay_element_struct::num_references, POSITIVE_CONDITION, wme_struct::preference, print(), preference_struct::reference_count, symbol_union::sc, SYM_CONSTANT_SYMBOL_TYPE, agent_struct::sysparams, wma_decay_element_struct::this_wme, wme_struct::timetag, instantiation_struct::top_of_instantiated_conditions, wma_history_struct::total_references, wma_decay_element_struct::touches, TRACE_WMA_SYSPARAM, wme_struct::value, int_constant_struct::value, float_constant_struct::value, wma_activate_wme(), wma_calculate_initial_boost(), wme_struct::wma_decay_el, agent_struct::wma_decay_element_pool, WMA_DECAY_HISTORY, preference_struct::wma_o_set, wma_should_have_decay_element(), agent_struct::wma_touched_elements, agent_struct::wma_wme_oset_pool, wme_add_ref(), and xml_generate_warning().
Referenced by add_input_wme(), decide_non_context_slot(), wma_activate_wme(), wma_activate_wmes_in_pref(), and wma_activate_wmes_tested_in_prods().
void wma_activate_wmes_in_pref | ( | agent * | my_agent, |
preference * | pref | ||
) |
Given a preference, this routine increments the reference count of all its WMEs (as necessary).
Definition at line 1062 of file wma.cpp.
References ACCEPTABLE_PREFERENCE_TYPE, wme_struct::next, preference_struct::slot, preference_struct::type, wme_struct::value, preference_struct::value, wma_activate_wme(), and slot_struct::wmes.
Referenced by _epmem_process_buffered_wme_list(), _smem_process_buffered_wme_list(), and assert_new_preferences().
void wma_activate_wmes_tested_in_prods | ( | agent * | my_agent | ) |
Increments the reference count of all WMEs that have been referenced this cycle.
Definition at line 1082 of file wma.cpp.
References agent_struct::dummy_top_token, agent_struct::ms_i_assertions, agent_struct::ms_o_assertions, ms_change_struct::next, NIL, token_struct::parent, ms_change_struct::tok, ms_change_struct::w, token_struct::w, and wma_activate_wme().
Referenced by do_preference_phase().
bool wma_enabled | ( | agent * | my_agent | ) |
Definition at line 148 of file wma.cpp.
References wma_param_container::activation, soar_module::constant_param< T >::get_value(), soar_module::on, and agent_struct::wma_params.
Referenced by _epmem_process_buffered_wme_list(), _smem_process_buffered_wme_list(), add_input_wme(), add_preference_to_tm(), assert_new_preferences(), deallocate_wme(), decide_non_context_slot(), do_one_top_level_phase(), do_preference_phase(), wma_activation_predicate< T >::operator()(), print_wme(), and reinitialize_soar().
Retrieve wme activation exact/approximate
Definition at line 1212 of file wma.cpp.
References WMA_ACTIVATION_NONE, wma_calculate_decay_activation(), agent_struct::wma_d_cycle_count, wme_struct::wma_decay_el, and WMA_TIME_SUM_NONE.
Referenced by epmem_build_dnf(), print_wme(), and wma_calculate_initial_boost().
Debugging: get list of wme references
Definition at line 1245 of file wma.cpp.
References _wma_ref_to_str(), wma_history_struct::access_history, wma_param_container::approx, wma_param_container::bsearch, wma_history_struct::first_reference, wma_decay_element_struct::forget_cycle, wma_param_container::forgetting, soar_module::constant_param< T >::get_value(), wma_history_struct::history_ct, wma_history_struct::history_references, wma_history_struct::next_p, wma_history_struct::total_references, wma_decay_element_struct::touches, agent_struct::wma_d_cycle_count, wme_struct::wma_decay_el, wma_history_prev(), and agent_struct::wma_params.
void wma_go | ( | agent * | my_agent, |
wma_go_action | go_action | ||
) |
This routine performs WME activation and forgetting at the end of each cycle.
Definition at line 1308 of file wma.cpp.
References do_working_memory_phase(), wma_param_container::forgetting, wma_timer_container::forgetting, wma_stat_container::forgotten_wmes, soar_module::constant_param< T >::get_value(), soar_module::primitive_stat< T >::get_value(), wma_timer_container::history, wma_param_container::naive, wma_param_container::off, print(), soar_module::primitive_stat< T >::set_value(), soar_module::timer::start(), soar_module::timer::stop(), agent_struct::sysparams, TRACE_WM_CHANGES_SYSPARAM, wma_forgetting, wma_forgetting_naive_sweep(), wma_forgetting_update_p_queue(), wma_histories, agent_struct::wma_params, agent_struct::wma_stats, agent_struct::wma_timers, wma_update_decay_histories(), agent_struct::wme_removal_count, and xml_generate_message().
Referenced by do_one_top_level_phase().
Definition at line 667 of file wma.cpp.
References agent_struct::d_cycle_count, wma_decay_element_struct::just_removed, print(), agent_struct::sysparams, wme_struct::timetag, TRACE_WMA_SYSPARAM, wma_deactivate_element(), wme_struct::wma_decay_el, agent_struct::wma_decay_element_pool, and xml_generate_warning().
Referenced by deallocate_wme().
void wma_remove_pref_o_set | ( | agent * | my_agent, |
preference * | pref | ||
) |
Definition at line 705 of file wma.cpp.
References preference_struct::wma_o_set, agent_struct::wma_wme_oset_pool, and wme_remove_ref().
Referenced by deallocate_instantiation(), and deallocate_preference().