Soar Kernel
9.3.2 08-06-12
|
#include <portability.h>
#include "wma.h"
#include <set>
#include <cmath>
#include <cstdlib>
#include "agent.h"
#include "wmem.h"
#include "instantiations.h"
#include "explain.h"
#include "rete.h"
#include "decide.h"
#include "prefmem.h"
#include "misc.h"
#include "xml.h"
#include "print.h"
Go to the source code of this file.
|
inline |
Definition at line 1224 of file wma.cpp.
References wma_cycle_reference_struct::d_cycle, and wma_cycle_reference_struct::num_references.
Referenced by wma_get_wme_history().
void wma_activate_wme | ( | agent * | my_agent, |
wme * | w, | ||
wma_reference | num_references, | ||
wma_pooled_wme_set * | o_set, | ||
bool | o_only | ||
) |
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().
|
inline |
Definition at line 376 of file wma.cpp.
References wma_history_struct::history_ct, wma_decay_element_struct::touches, WMA_ACTIVATION_LOW, and wma_sum_history().
Referenced by wma_forgetting_estimate_cycle(), wma_forgetting_naive_sweep(), wma_forgetting_update_p_queue(), and wma_get_wme_activation().
|
inline |
Definition at line 404 of file wma.cpp.
References ACCEPTABLE_PREFERENCE_TYPE, condition_struct::bt, preference_struct::inst, wma_decay_element_struct::just_created, preference_struct::next, condition_struct::next, NIL, preference_struct::o_supported, POSITIVE_CONDITION, wme_struct::preference, slot_struct::preferences, preference_struct::slot, instantiation_struct::top_of_instantiated_conditions, condition_struct::type, wme_struct::value, preference_struct::value, wme_struct::wma_decay_el, wma_get_wme_activation(), preference_struct::wma_o_set, agent_struct::wma_tc_counter, wme_struct::wma_tc_value, and bt_info_struct::wme_.
Referenced by wma_activate_wme().
Definition at line 647 of file wma.cpp.
References wma_param_container::approx, wma_param_container::bsearch, wma_param_container::forgetting, soar_module::constant_param< T >::get_value(), wma_decay_element_struct::just_removed, wme_struct::wma_decay_el, wma_forgetting_remove_from_p_queue(), agent_struct::wma_params, and agent_struct::wma_touched_elements.
Referenced by wma_remove_decay_element().
void wma_deinit | ( | agent * | my_agent | ) |
Definition at line 265 of file wma.cpp.
References wma_param_container::approx, wma_param_container::forgetting, soar_module::constant_param< T >::get_value(), agent_struct::wma_approx_array, agent_struct::wma_decay_set_pool, agent_struct::wma_forget_pq, agent_struct::wma_initialized, agent_struct::wma_params, agent_struct::wma_power_array, agent_struct::wma_touched_elements, and agent_struct::wma_touched_sets.
Referenced by wma_activation_param::set_value().
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().
|
inline |
Definition at line 732 of file wma.cpp.
References wma_decay_element_struct::forget_cycle, agent_struct::wma_decay_set_pool, and agent_struct::wma_forget_pq.
Referenced by wma_forgetting_move_in_p_queue(), and wma_update_decay_histories().
|
inline |
Definition at line 790 of file wma.cpp.
References wma_history_struct::access_history, wma_param_container::approx, wma_cycle_reference_struct::d_cycle, wma_param_container::forgetting, soar_module::constant_param< T >::get_value(), wma_history_struct::history_ct, wma_history_struct::next_p, wma_cycle_reference_struct::num_references, wma_decay_element_struct::touches, agent_struct::wma_approx_array, wma_calculate_decay_activation(), agent_struct::wma_d_cycle_count, wma_history_prev(), agent_struct::wma_params, WMA_REFERENCES_PER_DECISION, and agent_struct::wma_thresh_exp.
Referenced by wma_forgetting_update_p_queue(), and wma_update_decay_histories().
Definition at line 890 of file wma.cpp.
References preference_struct::all_of_slot_next, slot_struct::all_preferences, wma_param_container::fake_forgetting, soar_module::constant_param< T >::get_value(), preference_struct::in_tm, preference_struct::o_supported, soar_module::on, wme_struct::preference, remove_preference_from_tm(), preference_struct::slot, wme_struct::value, preference_struct::value, and agent_struct::wma_params.
Referenced by wma_forgetting_naive_sweep(), and wma_forgetting_update_p_queue().
|
inline |
Definition at line 781 of file wma.cpp.
References wma_decay_element_struct::forget_cycle, wma_forgetting_add_to_p_queue(), and wma_forgetting_remove_from_p_queue().
Referenced by wma_forgetting_update_p_queue(), and wma_update_decay_histories().
|
inline |
Definition at line 1022 of file wma.cpp.
References agent_struct::all_wmes_in_rete, wma_param_container::forget_wme, soar_module::constant_param< T >::get_value(), wma_param_container::lti, NIL, wme_struct::rete_next, wma_calculate_decay_activation(), agent_struct::wma_d_cycle_count, wma_forgetting_forget_wme(), wma_history_prev(), agent_struct::wma_params, and agent_struct::wma_thresh_exp.
Referenced by wma_go().
|
inline |
Definition at line 759 of file wma.cpp.
References wma_decay_element_struct::forget_cycle, agent_struct::wma_forget_pq, and agent_struct::wma_touched_sets.
Referenced by wma_deactivate_element(), and wma_forgetting_move_in_p_queue().
|
inline |
Definition at line 920 of file wma.cpp.
References wma_decay_element_struct::forget_cycle, wma_param_container::forget_wme, soar_module::constant_param< T >::get_value(), symbol_union::id, slot_struct::id, wma_param_container::lti, wme_struct::next, slot_struct::next, NIL, identifier_struct::slots, wma_calculate_decay_activation(), agent_struct::wma_d_cycle_count, wme_struct::wma_decay_el, agent_struct::wma_decay_set_pool, agent_struct::wma_forget_pq, wma_forgetting_estimate_cycle(), wma_forgetting_forget_wme(), wma_forgetting_move_in_p_queue(), WMA_FORGOTTEN_CYCLE, agent_struct::wma_params, agent_struct::wma_thresh_exp, agent_struct::wma_touched_sets, and slot_struct::wmes.
Referenced by wma_go().
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 306 of file wma.cpp.
References WMA_DECAY_HISTORY.
Referenced by wma_update_decay_histories().
Definition at line 311 of file wma.cpp.
References WMA_DECAY_HISTORY.
Referenced by wma_forgetting_estimate_cycle(), wma_forgetting_naive_sweep(), wma_get_wme_history(), and wma_sum_history().
void wma_init | ( | agent * | my_agent | ) |
Definition at line 207 of file wma.cpp.
References wma_param_container::approx, wma_param_container::decay_rate, wma_param_container::decay_thresh, wma_param_container::forgetting, soar_module::primitive_param< T >::get_value(), soar_module::constant_param< T >::get_value(), wma_param_container::max_pow_cache, agent_struct::wma_approx_array, agent_struct::wma_initialized, agent_struct::wma_params, agent_struct::wma_power_array, agent_struct::wma_power_size, WMA_REFERENCES_PER_DECISION, and agent_struct::wma_thresh_exp.
Referenced by wma_activation_param::set_value().
|
inline |
Definition at line 321 of file wma.cpp.
References wma_param_container::decay_rate, soar_module::primitive_param< T >::get_value(), agent_struct::wma_params, and agent_struct::wma_power_array.
Referenced by wma_sum_history().
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().
|
inline |
Definition at line 316 of file wma.cpp.
References preference_struct::o_supported, wme_struct::preference, and preference_struct::reference_count.
Referenced by wma_activate_wme().
|
inline |
Definition at line 333 of file wma.cpp.
References wma_history_struct::access_history, wma_cycle_reference_struct::d_cycle, wma_param_container::decay_rate, wma_history_struct::first_reference, soar_module::primitive_param< T >::get_value(), soar_module::constant_param< T >::get_value(), wma_history_struct::history_ct, wma_history_struct::history_references, wma_history_struct::next_p, wma_cycle_reference_struct::num_references, soar_module::on, wma_param_container::petrov_approx, wma_history_struct::total_references, wma_history_prev(), agent_struct::wma_params, and wma_pow().
Referenced by wma_calculate_decay_activation().
|
inline |
Definition at line 1122 of file wma.cpp.
References wma_history_struct::access_history, wma_param_container::approx, wma_param_container::bsearch, wma_cycle_reference_struct::d_cycle, agent_struct::d_cycle_count, wma_history_struct::first_reference, wma_param_container::forgetting, soar_module::constant_param< T >::get_value(), wma_history_struct::history_ct, wma_history_struct::history_references, wma_decay_element_struct::just_created, wma_history_struct::next_p, wma_cycle_reference_struct::num_references, wma_decay_element_struct::num_references, print(), agent_struct::sysparams, wma_decay_element_struct::this_wme, wme_struct::timetag, wma_history_struct::total_references, wma_decay_element_struct::touches, TRACE_WMA_SYSPARAM, agent_struct::wma_d_cycle_count, WMA_DECAY_HISTORY, wma_forgetting_add_to_p_queue(), wma_forgetting_estimate_cycle(), wma_forgetting_move_in_p_queue(), wma_history_next(), agent_struct::wma_params, agent_struct::wma_touched_elements, and xml_generate_warning().
Referenced by wma_go().