Soar Kernel
9.3.2 08-06-12
|
#include <map>
#include <string>
#include <list>
#include <vector>
#include "soar_module.h"
#include "chunk.h"
#include "production.h"
Go to the source code of this file.
Data Structures | |
class | param_accessor< T > |
class | rl_apoptosis_param |
class | rl_apoptosis_predicate< T > |
class | rl_apoptosis_thresh_param |
struct | rl_data_struct |
class | rl_dbd_h_accessor |
class | rl_learning_param |
class | rl_param_container |
class | rl_stat_container |
class | rl_updates_accessor |
Macros | |
#define | OP_NO_CHANGE_IMPASSE_TYPE -2 |
#define | STATE_NO_CHANGE_IMPASSE_TYPE -1 |
Typedefs | |
typedef struct rl_data_struct | rl_data |
typedef std::map< production *, double, std::less < production * > , soar_module::soar_memory_pool_allocator < std::pair< production *, double > > > | rl_et_map |
typedef soar_module::bla_object_memory < production, 10, 50 > | rl_production_memory |
typedef std::list< production *, soar_module::soar_memory_pool_allocator < production * > > | rl_rule_list |
typedef std::map< Symbol *, Symbol * > | rl_symbol_map |
typedef std::set< rl_symbol_map > | rl_symbol_map_set |
#define OP_NO_CHANGE_IMPASSE_TYPE -2 |
Definition at line 33 of file reinforcement_learning.h.
#define STATE_NO_CHANGE_IMPASSE_TYPE -1 |
Definition at line 32 of file reinforcement_learning.h.
typedef struct rl_data_struct rl_data |
typedef std::map< production*, double, std::less< production* >, soar_module::soar_memory_pool_allocator< std::pair< production*, double > > > rl_et_map |
Definition at line 170 of file reinforcement_learning.h.
typedef soar_module::bla_object_memory< production, 10, 50 > rl_production_memory |
Definition at line 198 of file reinforcement_learning.h.
typedef std::list< production*, soar_module::soar_memory_pool_allocator< production* > > rl_rule_list |
Definition at line 177 of file reinforcement_learning.h.
typedef std::map< Symbol*, Symbol* > rl_symbol_map |
Definition at line 194 of file reinforcement_learning.h.
typedef std::set< rl_symbol_map > rl_symbol_map_set |
Definition at line 195 of file reinforcement_learning.h.
Definition at line 692 of file reinforcement_learning.cpp.
References add_new_test_to_test(), agent_struct::complex_test_pool, get_new_tc_number(), GOAL_ID_TEST, wme_struct::id, symbol_union::id, IMPASSE_ID_TEST, identifier_struct::isa_goal, identifier_struct::isa_impasse, make_test_from_complex_test(), NIL, POSITIVE_CONDITION, referent_of_equality_test(), identifier_struct::tc_num, and complex_test_struct::type.
Referenced by rl_build_template_instantiation().
Symbol* rl_build_template_instantiation | ( | agent * | my_agent, |
instantiation * | my_template_instance, | ||
struct token_struct * | tok, | ||
wme * | w | ||
) |
Definition at line 540 of file reinforcement_learning.cpp.
References production_struct::action_list, add_production_to_rete(), wme_struct::attr, action_struct::attr, copy_condition_list(), deallocate_condition_list(), DUPLICATE_PRODUCTION, excise_production(), FALSE, symbol_union::fc, find_sym_constant(), first_letter_from_symbol(), FLOAT_CONSTANT_SYMBOL_TYPE, get_new_tc_number(), symbol_union::ic, wme_struct::id, action_struct::id, symbol_union::id, instantiate_rhs_value(), INT_CONSTANT_SYMBOL_TYPE, identifier_struct::level, make_production(), make_sym_constant(), production_struct::name, sym_constant_struct::name, NIL, instantiation_struct::nots, NUMERIC_INDIFFERENT_PREFERENCE_TYPE, production_struct::p_node, p_node_to_conditions_and_nots(), action_struct::preference_type, instantiation_struct::prod, action_struct::referent, reset_variable_generator(), rl_add_goal_or_impasse_tests_to_conds(), production_struct::rl_ecr, production_struct::rl_efr, rl_get_template_constants(), rl_make_simple_action(), rl_next_template_id(), rl_revert_template_id(), production_struct::rl_template_conds, production_struct::rl_template_instantiations, symbol_union::sc, symbol_remove_ref(), instantiation_struct::top_of_instantiated_conditions, TRUE, USER_PRODUCTION_TYPE, wme_struct::value, int_constant_struct::value, float_constant_struct::value, action_struct::value, agent_struct::variablization_tc, variablize_condition_list(), and variablize_nots_and_insert_into_conditions().
Referenced by create_instantiation().
void rl_clear_refs | ( | Symbol * | goal | ) |
Definition at line 253 of file reinforcement_learning.cpp.
References symbol_union::id, rl_data_struct::prev_op_rl_rules, and identifier_struct::rl_info.
Referenced by remove_existing_context_and_descendents(), rl_reset_data(), and rl_store_data().
bool rl_enabled | ( | agent * | my_agent | ) |
Definition at line 224 of file reinforcement_learning.cpp.
References soar_module::constant_param< T >::get_value(), rl_param_container::learning, soar_module::on, and agent_struct::rl_params.
Referenced by decide_context_slot(), do_one_top_level_phase(), exploration_choose_according_to_policy(), remove_existing_context_and_descendents(), require_preference_semantics(), and run_preference_semantics().
int rl_get_template_id | ( | const char * | prod_name | ) |
Definition at line 395 of file reinforcement_learning.cpp.
References wme_struct::id, and is_whole_number().
Referenced by rl_update_template_tracking().
void rl_initialize_template_tracking | ( | agent * | my_agent | ) |
Definition at line 428 of file reinforcement_learning.cpp.
References agent_struct::rl_template_count.
Referenced by create_soar_agent().
action* rl_make_simple_action | ( | agent * | my_gent, |
Symbol * | id_sym, | ||
Symbol * | attr_sym, | ||
Symbol * | val_sym, | ||
Symbol * | ref_sym | ||
) |
Definition at line 656 of file reinforcement_learning.cpp.
References agent_struct::action_pool, action_struct::attr, action_struct::id, MAKE_ACTION, action_struct::next, NIL, action_struct::referent, symbol_add_ref(), symbol_to_rhs_value(), action_struct::type, action_struct::value, and variablize_symbol().
Referenced by rl_build_template_instantiation().
Definition at line 443 of file reinforcement_learning.cpp.
References agent_struct::rl_template_count.
Referenced by rl_build_template_instantiation().
void rl_perform_update | ( | agent * | my_agent, |
double | op_value, | ||
bool | op_rl, | ||
Symbol * | goal, | ||
bool | update_efr = true |
||
) |
Definition at line 849 of file reinforcement_learning.cpp.
References production_struct::action_list, rl_param_container::decay_mode, rl_param_container::delta_bar_delta_decay, rl_param_container::discount_rate, production_struct::documentation, rl_data_struct::eligibility_traces, rl_param_container::et_decay_rate, rl_param_container::et_tolerance, rl_param_container::exponential_decay, free_memory_block_for_string(), rl_data_struct::gap_age, rl_param_container::get_documentation_params(), soar_module::primitive_param< T >::get_value(), soar_module::string_param::get_value(), soar_module::constant_param< T >::get_value(), rl_data_struct::hrl_age, symbol_union::id, preference_struct::inst_next, production_struct::instantiations, rl_param_container::learning_rate, rl_param_container::logarithmic_decay, make_float_constant(), make_memory_block_for_string(), rl_param_container::meta, rl_param_container::meta_learning_rate, production_struct::name, sym_constant_struct::name, identifier_struct::name_letter, identifier_struct::name_number, instantiation_struct::next, rl_param_container::normal_decay, soar_module::on, rl_data_struct::prev_op_rl_rules, print(), action_struct::referent, rl_data_struct::reward, rhs_value_to_symbol(), production_struct::rl_delta_bar_delta_beta, production_struct::rl_delta_bar_delta_h, production_struct::rl_ecr, production_struct::rl_efr, identifier_struct::rl_info, agent_struct::rl_params, production_struct::rl_update_count, symbol_union::sc, symbol_remove_ref(), symbol_to_rhs_value(), agent_struct::sysparams, rl_param_container::temporal_discount, rl_param_container::temporal_extension, TRACE_RL_SYSPARAM, rl_param_container::update_log_path, xml_generate_message(), and xml_generate_warning().
Referenced by do_one_top_level_phase(), exploration_choose_according_to_policy(), remove_existing_context_and_descendents(), require_preference_semantics(), and run_preference_semantics().
void rl_remove_refs_for_prod | ( | agent * | my_agent, |
production * | prod | ||
) |
Definition at line 290 of file reinforcement_learning.cpp.
References symbol_union::id, identifier_struct::lower_goal, rl_remove_ref(), and agent_struct::top_state.
Referenced by excise_production().
void rl_revert_template_id | ( | agent * | my_agent | ) |
Definition at line 449 of file reinforcement_learning.cpp.
References agent_struct::rl_template_count.
Referenced by rl_build_template_instantiation().
void rl_rule_meta | ( | agent * | my_agent, |
production * | prod | ||
) |
Definition at line 350 of file reinforcement_learning.cpp.
References production_struct::documentation, rl_param_container::get_documentation_params(), soar_module::constant_param< T >::get_value(), rl_param_container::meta, soar_module::on, agent_struct::rl_params, and param_accessor< T >::set_param().
Referenced by parse_production(), and reteload_node_and_children().
void rl_store_data | ( | agent * | my_agent, |
Symbol * | goal, | ||
preference * | cand | ||
) |
Definition at line 790 of file reinforcement_learning.cpp.
References rl_data_struct::gap_age, soar_module::constant_param< T >::get_value(), symbol_union::id, identifier_struct::name_letter, identifier_struct::name_number, preference_struct::next, NUMERIC_INDIFFERENT_PREFERENCE_TYPE, preference_struct::numeric_value, soar_module::on, identifier_struct::operator_slot, slot_struct::preferences, rl_data_struct::prev_op_rl_rules, rl_data_struct::previous_q, print(), rl_add_ref(), rl_clear_refs(), identifier_struct::rl_info, agent_struct::rl_params, agent_struct::sysparams, rl_param_container::temporal_extension, TRACE_RL_SYSPARAM, preference_struct::value, and xml_generate_warning().
Referenced by decide_context_slot().
Definition at line 723 of file reinforcement_learning.cpp.
References agent_struct::bottom_goal, rl_param_container::discount_rate, find_slot(), FLOAT_CONSTANT_SYMBOL_TYPE, rl_data_struct::gap_age, get_number_from_symbol(), soar_module::primitive_param< T >::get_value(), soar_module::constant_param< T >::get_value(), soar_module::primitive_stat< T >::get_value(), rl_stat_container::global_reward, rl_data_struct::hrl_age, rl_param_container::hrl_discount, symbol_union::id, IDENTIFIER_SYMBOL_TYPE, INT_CONSTANT_SYMBOL_TYPE, wme_struct::next, soar_module::on, rl_data_struct::prev_op_rl_rules, rl_data_struct::reward, identifier_struct::reward_header, identifier_struct::rl_info, agent_struct::rl_params, agent_struct::rl_stats, agent_struct::rl_sym_reward, agent_struct::rl_sym_value, soar_module::primitive_stat< T >::set_value(), rl_param_container::temporal_discount, rl_stat_container::total_reward, wme_struct::value, and slot_struct::wmes.
Referenced by do_one_top_level_phase(), remove_existing_context_and_descendents(), and rl_tabulate_reward_values().
void rl_tabulate_reward_values | ( | agent * | my_agent | ) |
Definition at line 778 of file reinforcement_learning.cpp.
References symbol_union::id, identifier_struct::lower_goal, rl_tabulate_reward_value_for_goal(), and agent_struct::top_goal.
Referenced by exploration_choose_according_to_policy(), require_preference_semantics(), and run_preference_semantics().
void rl_update_template_tracking | ( | agent * | my_agent, |
const char * | rule_name | ||
) |
Definition at line 434 of file reinforcement_learning.cpp.
References rl_get_template_id(), and agent_struct::rl_template_count.
Referenced by make_production().
bool rl_valid_rule | ( | production * | prod | ) |
Definition at line 331 of file reinforcement_learning.cpp.
References production_struct::action_list, MAKE_ACTION, action_struct::next, and NUMERIC_INDIFFERENT_PREFERENCE_TYPE.
Referenced by make_production(), and reteload_node_and_children().
bool rl_valid_template | ( | production * | prod | ) |
Definition at line 304 of file reinforcement_learning.cpp.
References production_struct::action_list, BINARY_INDIFFERENT_PREFERENCE_TYPE, identifier_struct::common_symbol_info, symbol_union::id, MAKE_ACTION, action_struct::next, NUMERIC_INDIFFERENT_PREFERENCE_TYPE, rhs_value_is_symbol(), rhs_value_to_symbol(), symbol_common_data_struct::symbol_type, and VARIABLE_SYMBOL_TYPE.
Referenced by parse_production().
Definition at line 1071 of file reinforcement_learning.cpp.
References rl_data_struct::eligibility_traces, symbol_union::id, and identifier_struct::rl_info.
Referenced by exploration_choose_according_to_policy().