Soar Kernel
9.3.2 08-06-12
|
#include "gdatastructs.h"
Go to the source code of this file.
Data Structures | |
struct | exploration_parameter_struct |
Macros | |
#define | EXPLORATION_PARAM_EPSILON 0 |
#define | EXPLORATION_PARAM_TEMPERATURE 1 |
#define | EXPLORATION_PARAMS 2 |
#define | EXPLORATION_REDUCTION_EXPONENTIAL 0 |
#define | EXPLORATION_REDUCTION_LINEAR 1 |
#define | EXPLORATION_REDUCTIONS 2 |
Typedefs | |
typedef struct exploration_parameter_struct | exploration_parameter |
Functions | |
exploration_parameter * | exploration_add_parameter (double value, bool(*val_func)(double), const char *name) |
preference * | exploration_boltzmann_select (agent *my_agent, preference *candidates) |
preference * | exploration_choose_according_to_policy (agent *my_agent, slot *s, preference *candidates) |
void | exploration_compute_value_of_candidate (agent *my_agent, preference *cand, slot *s, double default_value=0) |
const int | exploration_convert_parameter (agent *my_agent, const char *name) |
const char * | exploration_convert_parameter (agent *my_agent, const int parameter) |
const int | exploration_convert_policy (const char *policy_name) |
const char * | exploration_convert_policy (const int policy) |
const int | exploration_convert_reduction_policy (const char *policy_name) |
const char * | exploration_convert_reduction_policy (const int policy) |
preference * | exploration_epsilon_greedy_select (agent *my_agent, preference *candidates) |
bool | exploration_get_auto_update (agent *my_agent) |
preference * | exploration_get_highest_q_value_pref (preference *candidates) |
double | exploration_get_parameter_value (agent *my_agent, const char *parameter) |
double | exploration_get_parameter_value (agent *my_agent, const int parameter) |
const int | exploration_get_policy (agent *my_agent) |
const int | exploration_get_reduction_policy (agent *my_agent, const char *parameter) |
const int | exploration_get_reduction_policy (agent *my_agent, const int parameter) |
double | exploration_get_reduction_rate (agent *my_agent, const char *parameter, const char *policy_name) |
double | exploration_get_reduction_rate (agent *my_agent, const int parameter, const int policy) |
preference * | exploration_probabilistically_select (preference *candidates) |
double | exploration_probability_according_to_policy (agent *my_agent, slot *s, preference *candidates, preference *selection) |
preference * | exploration_randomly_select (preference *candidates) |
bool | exploration_set_auto_update (agent *my_agent, bool setting) |
bool | exploration_set_parameter_value (agent *my_agent, const char *name, double value) |
bool | exploration_set_parameter_value (agent *my_agent, const int parameter, double value) |
bool | exploration_set_policy (agent *my_agent, const char *policy_name) |
bool | exploration_set_policy (agent *my_agent, const int policy) |
bool | exploration_set_reduction_policy (agent *my_agent, const char *parameter, const char *policy_name) |
bool | exploration_set_reduction_policy (agent *my_agent, const int parameter, const int policy) |
bool | exploration_set_reduction_rate (agent *my_agent, const char *parameter, const char *policy_name, double reduction_rate) |
bool | exploration_set_reduction_rate (agent *my_agent, const int parameter, const int policy, double reduction_rate) |
void | exploration_update_parameters (agent *my_agent) |
bool | exploration_valid_exponential (double reduction_rate) |
bool | exploration_valid_linear (double reduction_rate) |
const bool | exploration_valid_parameter (agent *my_agent, const char *name) |
const bool | exploration_valid_parameter (agent *my_agent, const int parameter) |
bool | exploration_valid_parameter_value (agent *my_agent, const char *name, double value) |
bool | exploration_valid_parameter_value (agent *my_agent, const int parameter, double value) |
bool | exploration_valid_policy (const char *policy_name) |
bool | exploration_valid_policy (const int policy) |
bool | exploration_valid_reduction_policy (agent *my_agent, const char *parameter, const char *policy_name) |
bool | exploration_valid_reduction_policy (agent *my_agent, const char *parameter, const int policy) |
bool | exploration_valid_reduction_policy (agent *my_agent, const int parameter, const int policy) |
bool | exploration_valid_reduction_rate (agent *my_agent, const char *parameter, const char *policy_name, double reduction_rate) |
bool | exploration_valid_reduction_rate (agent *my_agent, const int parameter, const int policy, double reduction_rate) |
bool | exploration_validate_epsilon (double value) |
bool | exploration_validate_temperature (double value) |
#define EXPLORATION_PARAM_EPSILON 0 |
Definition at line 25 of file exploration.h.
Referenced by create_soar_agent(), exploration_epsilon_greedy_select(), and exploration_probability_according_to_policy().
#define EXPLORATION_PARAM_TEMPERATURE 1 |
Definition at line 26 of file exploration.h.
Referenced by create_soar_agent(), exploration_boltzmann_select(), and exploration_probability_according_to_policy().
#define EXPLORATION_PARAMS 2 |
Definition at line 27 of file exploration.h.
Referenced by destroy_soar_agent(), exploration_convert_parameter(), exploration_get_parameter_value(), exploration_get_reduction_policy(), exploration_get_reduction_rate(), exploration_set_parameter_value(), exploration_set_reduction_policy(), exploration_set_reduction_rate(), exploration_update_parameters(), exploration_valid_parameter(), exploration_valid_parameter_value(), and exploration_valid_reduction_rate().
#define EXPLORATION_REDUCTION_EXPONENTIAL 0 |
Definition at line 21 of file exploration.h.
Referenced by exploration_add_parameter(), exploration_convert_reduction_policy(), exploration_update_parameters(), and exploration_valid_reduction_rate().
#define EXPLORATION_REDUCTION_LINEAR 1 |
Definition at line 22 of file exploration.h.
Referenced by exploration_add_parameter(), exploration_convert_reduction_policy(), exploration_update_parameters(), and exploration_valid_reduction_rate().
#define EXPLORATION_REDUCTIONS 2 |
Definition at line 23 of file exploration.h.
Referenced by exploration_convert_reduction_policy(), exploration_get_reduction_policy(), exploration_get_reduction_rate(), exploration_set_reduction_policy(), exploration_set_reduction_rate(), exploration_valid_reduction_policy(), and exploration_valid_reduction_rate().
typedef struct exploration_parameter_struct exploration_parameter |
exploration_parameter* exploration_add_parameter | ( | double | value, |
bool(*)(double) | val_func, | ||
const char * | name | ||
) |
Definition at line 126 of file exploration.cpp.
References EXPLORATION_REDUCTION_EXPONENTIAL, EXPLORATION_REDUCTION_LINEAR, exploration_parameter_struct::name, exploration_parameter_struct::rates, exploration_parameter_struct::reduction_policy, exploration_parameter_struct::val_func, and exploration_parameter_struct::value.
Referenced by create_soar_agent().
preference* exploration_boltzmann_select | ( | agent * | my_agent, |
preference * | candidates | ||
) |
Definition at line 753 of file exploration.cpp.
References exploration_get_parameter_value(), EXPLORATION_PARAM_TEMPERATURE, preference_struct::next_candidate, NIL, preference_struct::numeric_value, print(), print_with_symbols(), SoarRand(), agent_struct::sysparams, TRACE_INDIFFERENT_SYSPARAM, preference_struct::value, xml_att_val(), xml_begin_tag(), and xml_end_tag().
Referenced by exploration_choose_according_to_policy().
preference* exploration_choose_according_to_policy | ( | agent * | my_agent, |
slot * | s, | ||
preference * | candidates | ||
) |
Definition at line 503 of file exploration.cpp.
References exploration_boltzmann_select(), exploration_compute_value_of_candidate(), exploration_epsilon_greedy_select(), exploration_get_policy(), exploration_probabilistically_select(), exploration_randomly_select(), soar_module::constant_param< T >::get_value(), slot_struct::id, rl_param_container::learning_policy, preference_struct::next_candidate, preference_struct::numeric_value, rl_param_container::q, preference_struct::rl_contribution, rl_enabled(), agent_struct::rl_params, rl_perform_update(), rl_tabulate_reward_values(), rl_watkins_clear(), rl_param_container::sarsa, USER_SELECT_BOLTZMANN, USER_SELECT_E_GREEDY, USER_SELECT_FIRST, USER_SELECT_LAST, USER_SELECT_RANDOM, and USER_SELECT_SOFTMAX.
Referenced by run_preference_semantics().
void exploration_compute_value_of_candidate | ( | agent * | my_agent, |
preference * | cand, | ||
slot * | s, | ||
double | default_value = 0 |
||
) |
Definition at line 877 of file exploration.cpp.
References BINARY_INDIFFERENT_PREFERENCE_TYPE, get_number_from_symbol(), preference_struct::next, agent_struct::numeric_indifferent_mode, NUMERIC_INDIFFERENT_MODE_AVG, NUMERIC_INDIFFERENT_PREFERENCE_TYPE, preference_struct::numeric_value, slot_struct::preferences, preference_struct::rl_contribution, preference_struct::total_preferences_for_candidate, and preference_struct::value.
Referenced by exploration_choose_according_to_policy(), exploration_probability_according_to_policy(), require_preference_semantics(), and run_preference_semantics().
Definition at line 143 of file exploration.cpp.
References EXPLORATION_PARAMS, agent_struct::exploration_params, and exploration_parameter_struct::name.
Referenced by exploration_get_parameter_value(), exploration_get_reduction_policy(), exploration_get_reduction_rate(), exploration_set_parameter_value(), exploration_set_reduction_policy(), exploration_set_reduction_rate(), exploration_valid_parameter(), exploration_valid_parameter_value(), and exploration_valid_reduction_rate().
Definition at line 152 of file exploration.cpp.
References EXPLORATION_PARAMS, agent_struct::exploration_params, and exploration_parameter_struct::name.
const int exploration_convert_policy | ( | const char * | policy_name | ) |
Definition at line 55 of file exploration.cpp.
References USER_SELECT_BOLTZMANN, USER_SELECT_E_GREEDY, USER_SELECT_FIRST, USER_SELECT_LAST, USER_SELECT_RANDOM, and USER_SELECT_SOFTMAX.
Referenced by exploration_set_policy(), and exploration_valid_policy().
const char* exploration_convert_policy | ( | const int | policy | ) |
Definition at line 73 of file exploration.cpp.
References USER_SELECT_BOLTZMANN, USER_SELECT_E_GREEDY, USER_SELECT_FIRST, USER_SELECT_LAST, USER_SELECT_RANDOM, and USER_SELECT_SOFTMAX.
const int exploration_convert_reduction_policy | ( | const char * | policy_name | ) |
Definition at line 304 of file exploration.cpp.
References EXPLORATION_REDUCTION_EXPONENTIAL, EXPLORATION_REDUCTION_LINEAR, and EXPLORATION_REDUCTIONS.
Referenced by exploration_get_reduction_rate(), exploration_set_reduction_policy(), exploration_set_reduction_rate(), exploration_valid_reduction_policy(), and exploration_valid_reduction_rate().
const char* exploration_convert_reduction_policy | ( | const int | policy | ) |
Definition at line 314 of file exploration.cpp.
References EXPLORATION_REDUCTION_EXPONENTIAL, and EXPLORATION_REDUCTION_LINEAR.
preference* exploration_epsilon_greedy_select | ( | agent * | my_agent, |
preference * | candidates | ||
) |
Definition at line 808 of file exploration.cpp.
References exploration_get_highest_q_value_pref(), exploration_get_parameter_value(), EXPLORATION_PARAM_EPSILON, exploration_randomly_select(), preference_struct::next_candidate, print(), print_with_symbols(), SoarRand(), agent_struct::sysparams, TRACE_INDIFFERENT_SYSPARAM, xml_att_val(), xml_begin_tag(), and xml_end_tag().
Referenced by exploration_choose_according_to_policy().
bool exploration_get_auto_update | ( | agent * | my_agent | ) |
Definition at line 254 of file exploration.cpp.
References FALSE, agent_struct::sysparams, and USER_SELECT_REDUCE_SYSPARAM.
Referenced by exploration_update_parameters().
preference* exploration_get_highest_q_value_pref | ( | preference * | candidates | ) |
Definition at line 835 of file exploration.cpp.
References preference_struct::next_candidate, preference_struct::numeric_value, SoarRandInt(), and uint32_t().
Referenced by exploration_epsilon_greedy_select().
double exploration_get_parameter_value | ( | agent * | my_agent, |
const char * | parameter | ||
) |
Definition at line 173 of file exploration.cpp.
References exploration_convert_parameter(), EXPLORATION_PARAMS, agent_struct::exploration_params, and exploration_parameter_struct::value.
Referenced by exploration_boltzmann_select(), exploration_epsilon_greedy_select(), exploration_probability_according_to_policy(), and exploration_update_parameters().
Definition at line 182 of file exploration.cpp.
References agent_struct::exploration_params, exploration_valid_parameter(), and exploration_parameter_struct::value.
Definition at line 118 of file exploration.cpp.
References agent_struct::sysparams, and USER_SELECT_MODE_SYSPARAM.
Referenced by exploration_choose_according_to_policy(), and exploration_probability_according_to_policy().
Definition at line 327 of file exploration.cpp.
References exploration_convert_parameter(), EXPLORATION_PARAMS, agent_struct::exploration_params, EXPLORATION_REDUCTIONS, and exploration_parameter_struct::reduction_policy.
Referenced by exploration_update_parameters().
Definition at line 336 of file exploration.cpp.
References agent_struct::exploration_params, EXPLORATION_REDUCTIONS, exploration_valid_parameter(), and exploration_parameter_struct::reduction_policy.
double exploration_get_reduction_rate | ( | agent * | my_agent, |
const char * | parameter, | ||
const char * | policy_name | ||
) |
Definition at line 449 of file exploration.cpp.
References exploration_convert_parameter(), exploration_convert_reduction_policy(), exploration_get_reduction_rate(), EXPLORATION_PARAMS, and EXPLORATION_REDUCTIONS.
Referenced by exploration_get_reduction_rate(), and exploration_update_parameters().
Definition at line 462 of file exploration.cpp.
References agent_struct::exploration_params, exploration_valid_parameter(), exploration_valid_reduction_policy(), and exploration_parameter_struct::rates.
preference* exploration_probabilistically_select | ( | preference * | candidates | ) |
Definition at line 700 of file exploration.cpp.
References exploration_randomly_select(), preference_struct::next_candidate, NIL, preference_struct::numeric_value, and SoarRand().
Referenced by exploration_choose_according_to_policy().
double exploration_probability_according_to_policy | ( | agent * | my_agent, |
slot * | s, | ||
preference * | candidates, | ||
preference * | selection | ||
) |
Definition at line 584 of file exploration.cpp.
References exploration_compute_value_of_candidate(), exploration_get_parameter_value(), exploration_get_policy(), EXPLORATION_PARAM_EPSILON, EXPLORATION_PARAM_TEMPERATURE, preference_struct::next_candidate, preference_struct::numeric_value, USER_SELECT_BOLTZMANN, USER_SELECT_E_GREEDY, USER_SELECT_FIRST, USER_SELECT_LAST, USER_SELECT_RANDOM, and USER_SELECT_SOFTMAX.
preference* exploration_randomly_select | ( | preference * | candidates | ) |
Definition at line 684 of file exploration.cpp.
References preference_struct::next_candidate, SoarRandInt(), and uint32_t().
Referenced by exploration_choose_according_to_policy(), exploration_epsilon_greedy_select(), and exploration_probabilistically_select().
bool exploration_set_auto_update | ( | agent * | my_agent, |
bool | setting | ||
) |
Definition at line 262 of file exploration.cpp.
References FALSE, agent_struct::sysparams, TRUE, and USER_SELECT_REDUCE_SYSPARAM.
bool exploration_set_parameter_value | ( | agent * | my_agent, |
const char * | name, | ||
double | value | ||
) |
Definition at line 229 of file exploration.cpp.
References exploration_convert_parameter(), EXPLORATION_PARAMS, agent_struct::exploration_params, and exploration_parameter_struct::value.
Referenced by exploration_update_parameters().
Definition at line 240 of file exploration.cpp.
References agent_struct::exploration_params, exploration_valid_parameter(), and exploration_parameter_struct::value.
bool exploration_set_policy | ( | agent * | my_agent, |
const char * | policy_name | ||
) |
Definition at line 94 of file exploration.cpp.
References exploration_convert_policy(), and exploration_set_policy().
Referenced by exploration_set_policy().
Definition at line 104 of file exploration.cpp.
References exploration_valid_policy(), set_sysparam(), and USER_SELECT_MODE_SYSPARAM.
bool exploration_set_reduction_policy | ( | agent * | my_agent, |
const char * | parameter, | ||
const char * | policy_name | ||
) |
Definition at line 365 of file exploration.cpp.
References exploration_convert_parameter(), exploration_convert_reduction_policy(), EXPLORATION_PARAMS, agent_struct::exploration_params, EXPLORATION_REDUCTIONS, and exploration_parameter_struct::reduction_policy.
Definition at line 380 of file exploration.cpp.
References agent_struct::exploration_params, exploration_valid_parameter(), exploration_valid_reduction_policy(), and exploration_parameter_struct::reduction_policy.
bool exploration_set_reduction_rate | ( | agent * | my_agent, |
const char * | parameter, | ||
const char * | policy_name, | ||
double | reduction_rate | ||
) |
Definition at line 474 of file exploration.cpp.
References exploration_convert_parameter(), exploration_convert_reduction_policy(), EXPLORATION_PARAMS, EXPLORATION_REDUCTIONS, and exploration_set_reduction_rate().
Referenced by exploration_set_reduction_rate().
bool exploration_set_reduction_rate | ( | agent * | my_agent, |
const int | parameter, | ||
const int | policy, | ||
double | reduction_rate | ||
) |
Definition at line 487 of file exploration.cpp.
References agent_struct::exploration_params, exploration_valid_parameter(), exploration_valid_reduction_policy(), exploration_valid_reduction_rate(), and exploration_parameter_struct::rates.
void exploration_update_parameters | ( | agent * | my_agent | ) |
Definition at line 272 of file exploration.cpp.
References exploration_get_auto_update(), exploration_get_parameter_value(), exploration_get_reduction_policy(), exploration_get_reduction_rate(), EXPLORATION_PARAMS, EXPLORATION_REDUCTION_EXPONENTIAL, EXPLORATION_REDUCTION_LINEAR, and exploration_set_parameter_value().
Referenced by do_decision_phase().
bool exploration_valid_exponential | ( | double | reduction_rate | ) |
Definition at line 433 of file exploration.cpp.
Referenced by exploration_valid_reduction_rate().
bool exploration_valid_linear | ( | double | reduction_rate | ) |
Definition at line 441 of file exploration.cpp.
Referenced by exploration_valid_reduction_rate().
const bool exploration_valid_parameter | ( | agent * | my_agent, |
const char * | name | ||
) |
Definition at line 160 of file exploration.cpp.
References exploration_convert_parameter(), and EXPLORATION_PARAMS.
Referenced by exploration_get_parameter_value(), exploration_get_reduction_policy(), exploration_get_reduction_rate(), exploration_set_parameter_value(), exploration_set_reduction_policy(), exploration_set_reduction_rate(), and exploration_valid_parameter_value().
Definition at line 165 of file exploration.cpp.
References exploration_convert_parameter().
bool exploration_valid_parameter_value | ( | agent * | my_agent, |
const char * | name, | ||
double | value | ||
) |
Definition at line 209 of file exploration.cpp.
References exploration_convert_parameter(), EXPLORATION_PARAMS, agent_struct::exploration_params, and exploration_parameter_struct::val_func.
Definition at line 218 of file exploration.cpp.
References agent_struct::exploration_params, exploration_valid_parameter(), and exploration_parameter_struct::val_func.
bool exploration_valid_policy | ( | const char * | policy_name | ) |
Definition at line 42 of file exploration.cpp.
References exploration_convert_policy().
Referenced by exploration_set_policy().
bool exploration_valid_policy | ( | const int | policy | ) |
Definition at line 47 of file exploration.cpp.
References USER_SELECT_INVALID.
bool exploration_valid_reduction_policy | ( | agent * | my_agent, |
const char * | parameter, | ||
const char * | policy_name | ||
) |
Definition at line 347 of file exploration.cpp.
References exploration_convert_reduction_policy(), and EXPLORATION_REDUCTIONS.
Referenced by exploration_get_reduction_rate(), exploration_set_reduction_policy(), exploration_set_reduction_rate(), and exploration_valid_reduction_rate().
bool exploration_valid_reduction_policy | ( | agent * | my_agent, |
const char * | parameter, | ||
const int | policy | ||
) |
Definition at line 352 of file exploration.cpp.
References exploration_convert_reduction_policy().
Definition at line 357 of file exploration.cpp.
References exploration_convert_reduction_policy().
bool exploration_valid_reduction_rate | ( | agent * | my_agent, |
const char * | parameter, | ||
const char * | policy_name, | ||
double | reduction_rate | ||
) |
Definition at line 395 of file exploration.cpp.
References exploration_convert_parameter(), exploration_convert_reduction_policy(), EXPLORATION_PARAMS, EXPLORATION_REDUCTIONS, and exploration_valid_reduction_rate().
Referenced by exploration_set_reduction_rate(), and exploration_valid_reduction_rate().
bool exploration_valid_reduction_rate | ( | agent * | my_agent, |
const int | parameter, | ||
const int | policy, | ||
double | reduction_rate | ||
) |
Definition at line 408 of file exploration.cpp.
References EXPLORATION_REDUCTION_EXPONENTIAL, EXPLORATION_REDUCTION_LINEAR, exploration_valid_exponential(), exploration_valid_linear(), and exploration_valid_reduction_policy().
bool exploration_validate_epsilon | ( | double | value | ) |
Definition at line 193 of file exploration.cpp.
Referenced by create_soar_agent().
bool exploration_validate_temperature | ( | double | value | ) |
Definition at line 201 of file exploration.cpp.
Referenced by create_soar_agent().