Soar Kernel
9.3.2 08-06-12
|
#include <portability.h>
#include "soar_rand.h"
#include "decide.h"
#include "gdatastructs.h"
#include "instantiations.h"
#include "mem.h"
#include "kernel.h"
#include "agent.h"
#include "symtab.h"
#include "wmem.h"
#include "init_soar.h"
#include "prefmem.h"
#include "production.h"
#include "print.h"
#include "trace.h"
#include "explain.h"
#include "tempmem.h"
#include "io_soar.h"
#include "xml.h"
#include "soar_TraceNames.h"
#include "soar_module.h"
#include "exploration.h"
#include "reinforcement_learning.h"
#include "decision_manipulation.h"
#include "wma.h"
#include "misc.h"
#include "episodic_memory.h"
#include "semantic_memory.h"
#include "assert.h"
#include <list>
Go to the source code of this file.
Macros | |
#define | ALREADY_EXISTING_WME_DECIDER_FLAG 7 |
#define | BEST_DECIDER_FLAG 4 |
#define | CANDIDATE_DECIDER_FLAG 1 |
#define | CONFLICTED_DECIDER_FLAG 2 |
#define | FORMER_CANDIDATE_DECIDER_FLAG 3 |
#define | NEW_PREFERENCES_SCHEME 1 |
#define | NOTHING_DECIDER_FLAG 0 /* Warning: code relies in this being 0 */ |
#define | promote_if_needed(thisAgent, sym) |
#define | UNARY_INDIFFERENT_CONSTANT_DECIDER_FLAG 9 |
#define | UNARY_INDIFFERENT_DECIDER_FLAG 6 |
#define | UNARY_PARALLEL_DECIDER_FLAG 8 |
#define | WORST_DECIDER_FLAG 5 |
Typedefs | |
typedef std::list< Symbol *, soar_module::soar_memory_pool_allocator < Symbol * > > | symbol_list |
#define ALREADY_EXISTING_WME_DECIDER_FLAG 7 |
Definition at line 142 of file decide.cpp.
Referenced by decide_non_context_slot(), do_acceptable_preference_wme_changes_for_slot(), and update_impasse_items().
#define BEST_DECIDER_FLAG 4 |
Definition at line 139 of file decide.cpp.
Referenced by run_preference_semantics().
#define CANDIDATE_DECIDER_FLAG 1 |
Definition at line 136 of file decide.cpp.
Referenced by decide_non_context_slot(), do_acceptable_preference_wme_changes_for_slot(), require_preference_semantics(), run_preference_semantics(), and update_impasse_items().
#define CONFLICTED_DECIDER_FLAG 2 |
Definition at line 137 of file decide.cpp.
Referenced by run_preference_semantics().
#define FORMER_CANDIDATE_DECIDER_FLAG 3 |
Definition at line 138 of file decide.cpp.
Referenced by run_preference_semantics().
#define NEW_PREFERENCES_SCHEME 1 |
#define NOTHING_DECIDER_FLAG 0 /* Warning: code relies in this being 0 */ |
Definition at line 135 of file decide.cpp.
Referenced by decide_non_context_slot(), do_acceptable_preference_wme_changes_for_slot(), require_preference_semantics(), run_preference_semantics(), and update_impasse_items().
#define promote_if_needed | ( | thisAgent, | |
sym | |||
) |
Definition at line 343 of file decide.cpp.
Referenced by promote_id_and_tc().
#define UNARY_INDIFFERENT_CONSTANT_DECIDER_FLAG 9 |
Definition at line 147 of file decide.cpp.
Referenced by run_preference_semantics().
#define UNARY_INDIFFERENT_DECIDER_FLAG 6 |
Definition at line 141 of file decide.cpp.
Referenced by run_preference_semantics().
#define UNARY_PARALLEL_DECIDER_FLAG 8 |
Definition at line 143 of file decide.cpp.
Referenced by run_preference_semantics().
#define WORST_DECIDER_FLAG 5 |
Definition at line 140 of file decide.cpp.
Referenced by run_preference_semantics().
typedef std::list< Symbol*, soar_module::soar_memory_pool_allocator< Symbol* > > symbol_list |
Definition at line 72 of file decide.cpp.
void add_impasse_wme | ( | agent * | thisAgent, |
Symbol * | id, | ||
Symbol * | attr, | ||
Symbol * | value, | ||
preference * | p | ||
) |
Definition at line 1424 of file decide.cpp.
References add_wme_to_wm(), FALSE, symbol_union::id, identifier_struct::impasse_wmes, insert_at_head_of_dll, make_wme(), and wme_struct::preference.
Referenced by create_new_context(), create_new_impasse(), and update_impasse_items().
void add_wme_to_gds | ( | agent * | agentPtr, |
goal_dependency_set * | gds, | ||
wme * | wme_to_add | ||
) |
Definition at line 2902 of file decide.cpp.
References wme_struct::gds, gds_struct::goal, insert_at_head_of_dll, print_string(), print_wme(), snprintf_with_symbols(), agent_struct::soar_verbose_flag, agent_struct::sysparams, TRACE_GDS_SYSPARAM, gds_struct::wmes_in_gds, xml_att_val(), xml_begin_tag(), and xml_end_tag().
Referenced by elaborate_gds().
Definition at line 2432 of file decide.cpp.
References abort_with_fatal_error(), wme_struct::attr, agent_struct::attribute_symbol, BUFFER_MSG_SIZE, symbol_union::id, identifier_struct::impasse_wmes, identifier_struct::lower_goal, wme_struct::next, NIL, and wme_struct::value.
Referenced by decide_context_slot(), and decision_consistent_with_current_preferences().
void clear_goal_stack | ( | agent * | thisAgent | ) |
Definition at line 2791 of file decide.cpp.
References agent_struct::active_goal, do_buffered_wm_and_ownership_changes(), do_input_cycle(), do_output_cycle(), agent_struct::highest_goal_whose_context_changed, NIL, remove_existing_context_and_descendents(), agent_struct::top_goal, and agent_struct::top_state.
Referenced by reinitialize_soar().
Definition at line 2089 of file decide.cpp.
References slot_struct::changed, FALSE, preference_struct::next, NIL, slot_struct::preferences, RECONSIDER_PREFERENCE_TYPE, TRUE, wme_struct::value, preference_struct::value, and slot_struct::wmes.
Referenced by decide_context_slot(), and decide_context_slots().
Definition at line 3489 of file decide.cpp.
References identifier_struct::gds, agent_struct::gds_pool, gds_struct::goal, symbol_union::id, NIL, print_with_symbols(), and gds_struct::wmes_in_gds.
Referenced by decide_non_context_slot().
Definition at line 1520 of file decide.cpp.
References slot_struct::attr, ATTRIBUTE_IMPASSE_LEVEL, CREATE_NEW_ATTRIBUTE_IMPASSE_CALLBACK, create_new_impasse(), FALSE, symbol_union::id, slot_struct::id, slot_struct::impasse_id, slot_struct::impasse_type, identifier_struct::isa_impasse, soar_invoke_callbacks(), and TRUE.
Referenced by decide_non_context_slot().
Definition at line 2300 of file decide.cpp.
References add_impasse_wme(), agent_struct::bottom_goal, CREATE_NEW_CONTEXT_CALLBACK, create_new_impasse(), rl_data_struct::eligibility_traces, identifier_struct::epmem_info, agent_struct::epmem_info_pool, EPMEM_MEMID_NONE, epmem_data_struct::epmem_wmes, agent_struct::epmem_wmes_pool, identifier_struct::higher_goal, symbol_union::id, identifier_struct::level, identifier_struct::lower_goal, make_slot(), MAX_GOAL_DEPTH, NIL, agent_struct::nil_symbol, NO_CHANGE_IMPASSE_TYPE, NONE_IMPASSE_TYPE, agent_struct::operator_symbol, rl_data_struct::prev_op_rl_rules, print(), agent_struct::quiescence_symbol, agent_struct::reason_for_stopping, agent_struct::rl_et_pool, identifier_struct::rl_info, agent_struct::rl_info_pool, agent_struct::rl_rule_pool, identifier_struct::smem_info, agent_struct::smem_info_pool, smem_data_struct::smem_wmes, agent_struct::smem_wmes_pool, soar_invoke_callbacks(), agent_struct::stop_soar, agent_struct::sysparams, agent_struct::system_halted, agent_struct::t_symbol, agent_struct::top_goal, TOP_GOAL_LEVEL, agent_struct::top_state, TRUE, and xml_generate_warning().
Referenced by create_top_goal(), and decide_context_slot().
Symbol* create_new_impasse | ( | agent * | thisAgent, |
Bool | isa_goal, | ||
Symbol * | object, | ||
Symbol * | attr, | ||
byte | impasse_type, | ||
goal_stack_level | level | ||
) |
Definition at line 1441 of file decide.cpp.
References add_impasse_wme(), soar_module::add_module_wme(), agent_struct::attribute_symbol, agent_struct::choices_symbol, CONFLICT_IMPASSE_TYPE, agent_struct::conflict_symbol, CONSTRAINT_FAILURE_IMPASSE_TYPE, agent_struct::constraint_failure_symbol, identifier_struct::epmem_cmd_header, identifier_struct::epmem_header, identifier_struct::epmem_result_header, agent_struct::epmem_stats, agent_struct::epmem_sym, agent_struct::epmem_sym_cmd, agent_struct::epmem_sym_present_id, agent_struct::epmem_sym_result, soar_module::primitive_stat< T >::get_value(), symbol_union::id, agent_struct::impasse_symbol, make_int_constant(), make_new_identifier(), agent_struct::multiple_symbol, NIL, NO_CHANGE_IMPASSE_TYPE, agent_struct::no_change_symbol, NONE_IMPASSE_TYPE, agent_struct::none_symbol, agent_struct::object_symbol, post_link_addition(), identifier_struct::reward_header, agent_struct::rl_sym_reward_link, identifier_struct::smem_cmd_header, identifier_struct::smem_header, identifier_struct::smem_result_header, agent_struct::smem_sym, agent_struct::smem_sym_cmd, agent_struct::smem_sym_result, agent_struct::state_symbol, agent_struct::superstate_symbol, symbol_remove_ref(), TIE_IMPASSE_TYPE, agent_struct::tie_symbol, epmem_stat_container::time, and agent_struct::type_symbol.
Referenced by create_new_attribute_impasse_for_slot(), and create_new_context().
void create_top_goal | ( | agent * | thisAgent | ) |
Definition at line 2784 of file decide.cpp.
References create_new_context(), do_buffered_wm_and_ownership_changes(), agent_struct::highest_goal_whose_context_changed, NIL, and NONE_IMPASSE_TYPE.
Referenced by init_agent_memory().
Definition at line 2455 of file decide.cpp.
References abort_with_fatal_error(), add_wme_to_wm(), slot_struct::attr, attribute_of_existing_impasse(), BUFFER_MSG_SIZE, slot_struct::changed, CONFLICT_IMPASSE_TYPE, CONSTRAINT_FAILURE_IMPASSE_TYPE, context_slot_is_decidable(), create_new_context(), FALSE, symbol_union::id, slot_struct::id, IDENTIFIER_SYMBOL_TYPE, insert_at_head_of_dll, identifier_struct::lower_goal, make_wme(), identifier_struct::name_letter, identifier_struct::name_number, preference_struct::next_candidate, NIL, NO_CHANGE_IMPASSE_TYPE, NONE_IMPASSE_TYPE, identifier_struct::operator_slot, predict_set(), wme_struct::preference, preference_add_ref(), preference_remove_ref(), print_with_symbols(), remove_existing_context_and_descendents(), remove_wmes_for_context_slot(), rl_enabled(), rl_store_data(), run_preference_semantics(), agent_struct::soar_verbose_flag, agent_struct::state_symbol, agent_struct::sysparams, TIE_IMPASSE_TYPE, TRACE_WM_CHANGES_SYSPARAM, TRUE, type_of_existing_impasse(), update_impasse_items(), preference_struct::value, agent_struct::waitsnc, agent_struct::waitsnc_detect, and slot_struct::wmes.
Referenced by decide_context_slots().
void decide_context_slots | ( | agent * | thisAgent, |
bool | predict = false |
||
) |
Definition at line 2653 of file decide.cpp.
References agent_struct::bottom_goal, context_slot_is_decidable(), decide_context_slot(), agent_struct::highest_goal_whose_context_changed, symbol_union::id, identifier_struct::lower_goal, NIL, identifier_struct::operator_slot, TRUE, and slot_struct::wmes.
Referenced by do_decision_phase().
Definition at line 1782 of file decide.cpp.
References abort_with_fatal_error(), add_wme_to_wm(), ALREADY_EXISTING_WME_DECIDER_FLAG, preference_struct::attr, CANDIDATE_DECIDER_FLAG, create_gds_for_goal(), create_new_attribute_impasse_for_slot(), agent_struct::current_phase, elaborate_gds(), FALSE, free_parent_list(), wme_struct::gds, identifier_struct::gds, instantiation_struct::GDS_evaluated_already, gds_invalid_so_remove_goal(), gds_struct::goal, preference_struct::id, symbol_union::id, slot_struct::impasse_id, slot_struct::impasse_type, insert_at_head_of_dll, preference_struct::inst, identifier_struct::level, make_wme(), instantiation_struct::match_goal, instantiation_struct::match_goal_level, production_struct::name, wme_struct::next, preference_struct::next, preference_struct::next_candidate, NIL, NONE_IMPASSE_TYPE, NOTHING_DECIDER_FLAG, preference_struct::o_supported, agent_struct::parent_list_head, wme_struct::preference, print(), print_preference(), print_with_symbols(), instantiation_struct::prod, remove_existing_attribute_impasse_for_slot(), remove_from_dll, remove_wme_from_wm(), remove_wme_list_from_wm(), run_preference_semantics(), agent_struct::system_halted, TRUE, uniquely_add_to_head_of_dll(), update_impasse_items(), wme_struct::value, preference_struct::value, wma_activate_wme(), wma_enabled(), agent_struct::wma_slot_refs_pool, slot_struct::wma_val_references, and slot_struct::wmes.
Referenced by decide_non_context_slots().
void decide_non_context_slots | ( | agent * | thisAgent | ) |
Definition at line 2064 of file decide.cpp.
References slot_struct::changed, agent_struct::changed_slots, decide_non_context_slot(), agent_struct::dl_cons_pool, dl_cons_struct::item, dl_cons_struct::next, and NIL.
Referenced by do_decision_phase(), and do_working_memory_phase().
Definition at line 173 of file decide.cpp.
References ACCEPTABLE_PREFERENCE_TYPE, slot_struct::acceptable_preference_wmes, add_wme_to_wm(), ALREADY_EXISTING_WME_DECIDER_FLAG, preference_struct::attr, CANDIDATE_DECIDER_FLAG, preference_struct::id, insert_at_head_of_dll, make_wme(), wme_struct::next, preference_struct::next, NIL, NOTHING_DECIDER_FLAG, wme_struct::preference, slot_struct::preferences, remove_from_dll, remove_operator_if_necessary(), remove_wme_from_wm(), REQUIRE_PREFERENCE_TYPE, TRUE, wme_struct::value, and preference_struct::value.
Referenced by do_buffered_acceptable_preference_wme_changes().
void do_buffered_acceptable_preference_wme_changes | ( | agent * | thisAgent | ) |
Definition at line 246 of file decide.cpp.
References slot_struct::acceptable_preference_changed, agent_struct::context_slots_with_changed_acceptable_preferences, agent_struct::dl_cons_pool, do_acceptable_preference_wme_changes_for_slot(), dl_cons_struct::item, dl_cons_struct::next, and NIL.
Referenced by do_buffered_wm_and_ownership_changes().
void do_buffered_link_changes | ( | agent * | thisAgent | ) |
Definition at line 834 of file decide.cpp.
References agent_struct::current_phase, agent_struct::disconnected_ids, do_demotion(), do_promotion(), agent_struct::ids_with_unknown_level, agent_struct::promoted_ids, agent_struct::sysparams, and TIMERS_ENABLED.
Referenced by do_buffered_wm_and_ownership_changes().
void do_buffered_wm_and_ownership_changes | ( | agent * | thisAgent | ) |
Definition at line 2729 of file decide.cpp.
References do_buffered_acceptable_preference_wme_changes(), do_buffered_link_changes(), do_buffered_wm_changes(), and remove_garbage_slots().
Referenced by clear_goal_stack(), create_top_goal(), do_decision_phase(), do_input_cycle(), do_working_memory_phase(), and remove_current_decision().
void do_decision_phase | ( | agent * | thisAgent, |
bool | predict | ||
) |
Definition at line 2761 of file decide.cpp.
References decide_context_slots(), decide_non_context_slots(), do_buffered_wm_and_ownership_changes(), exploration_update_parameters(), and predict_srand_restore_snapshot().
Referenced by do_one_top_level_phase(), and predict_get().
void do_demotion | ( | agent * | thisAgent | ) |
Definition at line 755 of file decide.cpp.
References agent_struct::disconnected_ids, agent_struct::dl_cons_pool, garbage_collect_id(), get_new_tc_number(), agent_struct::highest_level_anything_could_fall_from, symbol_union::id, agent_struct::ids_with_unknown_level, insert_at_head_of_dll, dl_cons_struct::item, JUST_UPDATE_COUNT, identifier_struct::level, agent_struct::level_at_which_marking_started, identifier_struct::link_count, agent_struct::link_update_mode, identifier_struct::lower_goal, agent_struct::lowest_level_anything_could_fall_to, LOWEST_POSSIBLE_GOAL_LEVEL, mark_id_and_tc_as_unknown_level(), agent_struct::mark_tc_number, dl_cons_struct::next, NIL, remove_from_dll, symbol_remove_ref(), agent_struct::top_goal, TRUE, UPDATE_DISCONNECTED_IDS_LIST, UPDATE_LINKS_NORMALLY, walk_and_update_levels(), agent_struct::walk_level, and agent_struct::walk_tc_number.
Referenced by do_buffered_link_changes().
void do_promotion | ( | agent * | thisAgent | ) |
Definition at line 389 of file decide.cpp.
References cons_struct::first, free_cons(), symbol_union::id, promote_id_and_tc(), agent_struct::promoted_ids, identifier_struct::promotion_level, cons_struct::rest, and symbol_remove_ref().
Referenced by do_buffered_link_changes().
void do_working_memory_phase | ( | agent * | thisAgent | ) |
Definition at line 2737 of file decide.cpp.
References APPLY_PHASE, agent_struct::current_phase, decide_non_context_slots(), do_buffered_wm_and_ownership_changes(), agent_struct::FIRING_TYPE, IE_PRODS, PE_PRODS, print(), agent_struct::sysparams, TRACE_PHASES_SYSPARAM, xml_att_val(), xml_begin_tag(), and xml_end_tag().
Referenced by do_one_top_level_phase(), epmem_respond_to_cmd(), smem_respond_to_cmd(), and wma_go().
void elaborate_gds | ( | agent * | thisAgent | ) |
Definition at line 2928 of file decide.cpp.
References ACCEPTABLE_PREFERENCE_TYPE, add_wme_to_gds(), preference_struct::attr, condition_struct::bt, elaborate_gds(), FALSE, fast_remove_from_dll, find_slot(), free_parent_list(), wme_struct::gds, identifier_struct::gds, instantiation_struct::GDS_evaluated_already, agent_struct::gds_pool, wme_struct::gds_prev, gds_struct::goal, preference_struct::id, symbol_union::id, pi_struct::inst, preference_struct::inst, identifier_struct::level, bt_info_struct::level, instantiation_struct::match_goal, instantiation_struct::match_goal_level, production_struct::name, pi_struct::next, preference_struct::next, condition_struct::next, NIL, preference_struct::o_supported, agent_struct::parent_list_head, POSITIVE_CONDITION, wme_struct::preference, slot_struct::preferences, pi_struct::prev, print(), print_instantiation_with_wmes(), print_preference(), print_with_symbols(), print_wme(), instantiation_struct::prod, TIMETAG_WME_TRACE, instantiation_struct::top_of_instantiated_conditions, TRUE, condition_struct::type, uniquely_add_to_head_of_dll(), wme_struct::value, preference_struct::value, bt_info_struct::wme_, and gds_struct::wmes_in_gds.
Referenced by decide_non_context_slot(), and elaborate_gds().
void free_parent_list | ( | agent * | thisAgent | ) |
Definition at line 3477 of file decide.cpp.
References pi_struct::next, NIL, and agent_struct::parent_list_head.
Referenced by decide_non_context_slot(), and elaborate_gds().
Definition at line 497 of file decide.cpp.
References preference_struct::all_of_slot_next, slot_struct::all_preferences, symbol_union::id, slot_struct::impasse_type, identifier_struct::input_wmes, mark_slot_for_possible_removal(), slot_struct::next, NIL, NONE_IMPASSE_TYPE, print_with_symbols(), remove_existing_attribute_impasse_for_slot(), remove_preference_from_tm(), remove_wme_list_from_wm(), identifier_struct::slots, and slot_struct::wmes.
Referenced by do_demotion().
Definition at line 3386 of file decide.cpp.
References agent_struct::current_phase, wme_struct::gds, gds_struct::goal, identifier_struct::higher_goal, agent_struct::highest_goal_whose_context_changed, symbol_union::id, identifier_struct::level, slot_struct::next, print_string(), print_with_symbols(), print_wme(), remove_existing_context_and_descendents(), identifier_struct::slots, snprintf_with_symbols(), agent_struct::soar_verbose_flag, agent_struct::sysparams, TRACE_GDS_SYSPARAM, TRACE_OPERAND2_REMOVALS_SYSPARAM, xml_att_val(), xml_begin_tag(), and xml_end_tag().
Referenced by decide_non_context_slot(), remove_input_wme(), and soar_module::remove_module_wme().
void init_decider | ( | agent * | thisAgent | ) |
Definition at line 2721 of file decide.cpp.
References init_memory_pool(), agent_struct::preference_pool, agent_struct::slot_pool, and agent_struct::wme_pool.
Referenced by init_soar_agent().
Definition at line 664 of file decide.cpp.
References symbol_union::id, IDENTIFIER_SYMBOL_TYPE, identifier_struct::tc_num, and agent_struct::walk_tc_number.
Referenced by walk_and_update_levels().
preference* make_fake_preference_for_goal_item | ( | agent * | thisAgent, |
Symbol * | goal, | ||
preference * | cand | ||
) |
Definition at line 1577 of file decide.cpp.
References abort_with_fatal_error(), ACCEPTABLE_PREFERENCE_TYPE, slot_struct::acceptable_preference_wmes, wme_struct::attr, preference_struct::attr, three_field_tests_struct::attr_test, instantiation_struct::backtrace_number, instantiation_struct::bottom_of_instantiated_conditions, condition_struct::bt, BUFFER_MSG_SIZE, agent_struct::condition_pool, condition_struct::data, FALSE, wme_struct::id, preference_struct::id, symbol_union::id, three_field_tests_struct::id_test, instantiation_struct::in_ms, insert_at_head_of_dll, preference_struct::inst, preference_struct::inst_next, preference_struct::inst_prev, agent_struct::instantiation_pool, agent_struct::item_symbol, identifier_struct::level, bt_info_struct::level, make_equality_test(), make_preference(), instantiation_struct::match_goal, instantiation_struct::match_goal_level, instantiation_struct::next, wme_struct::next, condition_struct::next, NIL, instantiation_struct::nots, preference_struct::on_goal_list, POSITIVE_CONDITION, preference_add_ref(), identifier_struct::preferences_from_goal, instantiation_struct::preferences_generated, instantiation_struct::prev, condition_struct::prev, instantiation_struct::prod, bt_info_struct::prohibits, instantiation_struct::reliable, instantiation_struct::rete_token, instantiation_struct::rete_wme, preference_struct::slot, symbol_add_ref(), condition_struct::test_for_acceptable_preference, condition_struct::condition_main_data_union::tests, TOP_GOAL_LEVEL, instantiation_struct::top_of_instantiated_conditions, bt_info_struct::trace, TRUE, condition_struct::type, wme_struct::value, preference_struct::value, three_field_tests_struct::value_test, bt_info_struct::wme_, and wme_add_ref().
Referenced by update_impasse_items().
Definition at line 161 of file decide.cpp.
References slot_struct::acceptable_preference_changed, agent_struct::context_slots_with_changed_acceptable_preferences, agent_struct::dl_cons_pool, insert_at_head_of_dll, and dl_cons_struct::item.
Referenced by add_preference_to_tm(), and remove_preference_from_tm().
Definition at line 563 of file decide.cpp.
References preference_struct::all_of_slot_next, slot_struct::all_preferences, identifier_struct::could_be_a_link_from_below, agent_struct::dl_cons_pool, agent_struct::highest_level_anything_could_fall_from, symbol_union::id, agent_struct::ids_with_unknown_level, slot_struct::impasse_id, identifier_struct::input_wmes, insert_at_head_of_dll, dl_cons_struct::item, identifier_struct::level, agent_struct::level_at_which_marking_started, agent_struct::lowest_level_anything_could_fall_to, LOWEST_POSSIBLE_GOAL_LEVEL, mark_level_unknown_needed(), agent_struct::mark_tc_number, wme_struct::next, slot_struct::next, NIL, preference_is_binary(), preference_struct::referent, identifier_struct::slots, symbol_add_ref(), identifier_struct::tc_num, preference_struct::type, identifier_struct::unknown_level, wme_struct::value, preference_struct::value, and slot_struct::wmes.
Referenced by do_demotion().
Definition at line 558 of file decide.cpp.
References IDENTIFIER_SYMBOL_TYPE.
Referenced by mark_id_and_tc_as_unknown_level().
Definition at line 302 of file decide.cpp.
References identifier_struct::could_be_a_link_from_below, symbol_union::id, identifier_struct::isa_goal, identifier_struct::isa_impasse, identifier_struct::link_count, print(), print_with_symbols(), agent_struct::promoted_ids, identifier_struct::promotion_level, push(), symbol_add_ref(), and TRUE.
Referenced by add_preference_to_tm(), add_wme_to_wm(), and create_new_impasse().
Definition at line 438 of file decide.cpp.
References agent_struct::disconnected_ids, agent_struct::dl_cons_pool, symbol_union::id, agent_struct::ids_with_unknown_level, insert_at_head_of_dll, identifier_struct::isa_goal, identifier_struct::isa_impasse, dl_cons_struct::item, JUST_UPDATE_COUNT, identifier_struct::level, identifier_struct::link_count, agent_struct::link_update_mode, print(), print_with_symbols(), remove_from_dll, symbol_add_ref(), identifier_struct::unknown_level, and UPDATE_DISCONNECTED_IDS_LIST.
Referenced by remove_existing_attribute_impasse_for_slot(), remove_existing_context_and_descendents(), remove_preference_from_tm(), and remove_wme_from_wm().
void print_candidates | ( | agent * | thisAgent, |
preference * | candidates | ||
) |
Definition at line 80 of file decide.cpp.
References preference_struct::attr, preference_struct::id, preference_struct::next_candidate, NIL, print(), print_with_symbols(), and preference_struct::value.
void print_lowest_slot_in_context_stack | ( | agent * | thisAgent | ) |
Definition at line 2805 of file decide.cpp.
References agent_struct::bottom_goal, agent_struct::d_cycle_count, FOR_OPERATORS_TF, FOR_STATES_TF, identifier_struct::higher_goal, symbol_union::id, identifier_struct::operator_slot, print_stack_trace(), TRUE, wme_struct::value, and slot_struct::wmes.
Referenced by do_one_top_level_phase(), and init_agent_memory().
void promote_id_and_tc | ( | agent * | thisAgent, |
Symbol * | id, | ||
goal_stack_level | new_level | ||
) |
Definition at line 347 of file decide.cpp.
References abort_with_fatal_error(), preference_struct::all_of_slot_next, slot_struct::all_preferences, BUFFER_MSG_SIZE, wme_struct::id, symbol_union::id, identifier_struct::input_wmes, identifier_struct::isa_goal, identifier_struct::isa_impasse, identifier_struct::level, wme_struct::next, slot_struct::next, NIL, preference_is_binary(), promote_if_needed, identifier_struct::promotion_level, preference_struct::referent, identifier_struct::slots, TRUE, preference_struct::type, wme_struct::value, preference_struct::value, and slot_struct::wmes.
Referenced by do_promotion().
Definition at line 1534 of file decide.cpp.
References symbol_union::id, slot_struct::impasse_id, slot_struct::impasse_type, identifier_struct::impasse_wmes, NIL, NONE_IMPASSE_TYPE, post_link_removal(), REMOVE_ATTRIBUTE_IMPASSE_CALLBACK, remove_wme_list_from_wm(), soar_invoke_callbacks(), and symbol_remove_ref().
Referenced by decide_non_context_slot(), and garbage_collect_id().
Definition at line 2134 of file decide.cpp.
References preference_struct::all_of_goal_next, preference_struct::all_of_goal_prev, agent_struct::bottom_goal, agent_struct::chunk_free_problem_spaces, agent_struct::chunky_problem_spaces, cons_equality_fn(), rl_data_struct::eligibility_traces, identifier_struct::epmem_cmd_header, identifier_struct::epmem_header, identifier_struct::epmem_info, agent_struct::epmem_info_pool, epmem_reset(), identifier_struct::epmem_result_header, epmem_data_struct::epmem_wmes, agent_struct::epmem_wmes_pool, extract_list_elements(), FALSE, free_list(), identifier_struct::gds, gds_struct::goal, ms_change_struct::goal, identifier_struct::higher_goal, symbol_union::id, identifier_struct::impasse_wmes, preference_struct::in_tm, identifier_struct::level, identifier_struct::lower_goal, identifier_struct::ms_retractions, ms_change_struct::next_in_level, NIL, agent_struct::nil_goal_retractions, preference_struct::on_goal_list, identifier_struct::operator_slot, POP_CONTEXT_STACK_CALLBACK, post_link_removal(), identifier_struct::preferences_from_goal, ms_change_struct::prev_in_level, rl_data_struct::prev_op_rl_rules, agent_struct::reason_for_stopping, remove_existing_context_and_descendents(), remove_from_dll, remove_preference_from_clones(), remove_preference_from_tm(), remove_wme_list_from_wm(), remove_wmes_for_context_slot(), identifier_struct::reward_header, rl_clear_refs(), rl_enabled(), agent_struct::rl_et_pool, identifier_struct::rl_info, agent_struct::rl_info_pool, rl_perform_update(), agent_struct::rl_rule_pool, rl_tabulate_reward_value_for_goal(), identifier_struct::smem_cmd_header, identifier_struct::smem_header, identifier_struct::smem_info, agent_struct::smem_info_pool, smem_reset(), identifier_struct::smem_result_header, smem_data_struct::smem_wmes, agent_struct::smem_wmes_pool, soar_invoke_callbacks(), agent_struct::stop_soar, agent_struct::substate_break_level, symbol_remove_ref(), agent_struct::top_goal, and update_impasse_items().
Referenced by clear_goal_stack(), decide_context_slot(), gds_invalid_so_remove_goal(), remove_current_decision(), remove_existing_context_and_descendents(), and remove_operator_if_necessary().
void remove_fake_preference_for_goal_item | ( | agent * | thisAgent, |
preference * | pref | ||
) |
Definition at line 1646 of file decide.cpp.
References preference_remove_ref().
Referenced by update_impasse_items().
Definition at line 2114 of file decide.cpp.
References NIL, wme_struct::preference, preference_remove_ref(), remove_wme_from_wm(), and slot_struct::wmes.
Referenced by decide_context_slot(), remove_current_decision(), remove_existing_context_and_descendents(), and remove_operator_if_necessary().
byte require_preference_semantics | ( | agent * | thisAgent, |
slot * | s, | ||
preference ** | result_candidates, | ||
bool | consistency | ||
) |
Definition at line 895 of file decide.cpp.
References CANDIDATE_DECIDER_FLAG, CONSTRAINT_FAILURE_IMPASSE_TYPE, exploration_compute_value_of_candidate(), slot_struct::id, preference_struct::next, preference_struct::next_candidate, NIL, NONE_IMPASSE_TYPE, NOTHING_DECIDER_FLAG, preference_struct::numeric_value, slot_struct::preferences, PROHIBIT_PREFERENCE_TYPE, REQUIRE_PREFERENCE_TYPE, preference_struct::rl_contribution, rl_enabled(), rl_perform_update(), rl_tabulate_reward_values(), and preference_struct::value.
Referenced by run_preference_semantics().
byte run_preference_semantics | ( | agent * | thisAgent, |
slot * | s, | ||
preference ** | result_candidates, | ||
bool | consistency = false , |
||
bool | predict = false |
||
) |
Definition at line 933 of file decide.cpp.
References ACCEPTABLE_PREFERENCE_TYPE, slot_struct::all_preferences, BEST_DECIDER_FLAG, BEST_PREFERENCE_TYPE, BETTER_PREFERENCE_TYPE, BINARY_INDIFFERENT_PREFERENCE_TYPE, BINARY_PARALLEL_PREFERENCE_TYPE, CANDIDATE_DECIDER_FLAG, float_constant_struct::common_symbol_info, CONFLICT_IMPASSE_TYPE, CONFLICTED_DECIDER_FLAG, exploration_choose_according_to_policy(), exploration_compute_value_of_candidate(), FALSE, symbol_union::fc, FLOAT_CONSTANT_SYMBOL_TYPE, FORMER_CANDIDATE_DECIDER_FLAG, slot_struct::id, INT_CONSTANT_SYMBOL_TYPE, slot_struct::isa_context_slot, mark_slot_for_possible_removal(), preference_struct::next, preference_struct::next_candidate, NIL, NONE_IMPASSE_TYPE, NOTHING_DECIDER_FLAG, NUMERIC_INDIFFERENT_PREFERENCE_TYPE, preference_struct::numeric_value, slot_struct::preferences, PROHIBIT_PREFERENCE_TYPE, preference_struct::referent, REJECT_PREFERENCE_TYPE, require_preference_semantics(), REQUIRE_PREFERENCE_TYPE, preference_struct::rl_contribution, rl_enabled(), rl_perform_update(), rl_tabulate_reward_values(), select_force(), select_get_operator(), symbol_common_data_struct::symbol_type, TIE_IMPASSE_TYPE, TRUE, UNARY_INDIFFERENT_CONSTANT_DECIDER_FLAG, UNARY_INDIFFERENT_DECIDER_FLAG, UNARY_INDIFFERENT_PREFERENCE_TYPE, UNARY_PARALLEL_DECIDER_FLAG, UNARY_PARALLEL_PREFERENCE_TYPE, preference_struct::value, WORSE_PREFERENCE_TYPE, WORST_DECIDER_FLAG, and WORST_PREFERENCE_TYPE.
Referenced by decide_context_slot(), decide_non_context_slot(), and run_preference_semantics_for_consistency_check().
byte run_preference_semantics_for_consistency_check | ( | agent * | thisAgent, |
slot * | s, | ||
preference ** | result_candidates | ||
) |
Definition at line 1404 of file decide.cpp.
References run_preference_semantics().
Referenced by decision_consistent_with_current_preferences().
Definition at line 2405 of file decide.cpp.
References abort_with_fatal_error(), wme_struct::attr, BUFFER_MSG_SIZE, CONFLICT_IMPASSE_TYPE, agent_struct::conflict_symbol, CONSTRAINT_FAILURE_IMPASSE_TYPE, agent_struct::constraint_failure_symbol, symbol_union::id, agent_struct::impasse_symbol, identifier_struct::impasse_wmes, identifier_struct::lower_goal, wme_struct::next, NIL, NO_CHANGE_IMPASSE_TYPE, agent_struct::no_change_symbol, NONE_IMPASSE_TYPE, agent_struct::none_symbol, TIE_IMPASSE_TYPE, agent_struct::tie_symbol, and wme_struct::value.
Referenced by decide_context_slot(), decision_consistent_with_current_preferences(), and generate_chunk_name_sym_constant().
void uniquely_add_to_head_of_dll | ( | agent * | thisAgent, |
instantiation * | inst | ||
) |
Definition at line 2862 of file decide.cpp.
References pi_struct::inst, production_struct::name, pi_struct::next, NIL, agent_struct::parent_list_head, pi_struct::prev, print_with_symbols(), and instantiation_struct::prod.
Referenced by decide_non_context_slot(), and elaborate_gds().
void update_impasse_items | ( | agent * | thisAgent, |
Symbol * | id, | ||
preference * | items | ||
) |
Definition at line 1662 of file decide.cpp.
References add_impasse_wme(), ALREADY_EXISTING_WME_DECIDER_FLAG, wme_struct::attr, CANDIDATE_DECIDER_FLAG, wme_struct::id, symbol_union::id, identifier_struct::impasse_wmes, identifier_struct::isa_goal, agent_struct::item_count_symbol, agent_struct::item_symbol, make_fake_preference_for_goal_item(), make_int_constant(), wme_struct::next, preference_struct::next, preference_struct::next_candidate, NIL, agent_struct::non_numeric_count_symbol, agent_struct::non_numeric_symbol, NOTHING_DECIDER_FLAG, NUMERIC_INDIFFERENT_PREFERENCE_TYPE, wme_struct::preference, slot_struct::preferences, remove_fake_preference_for_goal_item(), remove_from_dll, remove_wme_from_wm(), preference_struct::slot, symbol_remove_ref(), wme_struct::value, and preference_struct::value.
Referenced by decide_context_slot(), decide_non_context_slot(), and remove_existing_context_and_descendents().
Definition at line 669 of file decide.cpp.
References preference_struct::all_of_slot_next, slot_struct::all_preferences, agent_struct::dl_cons_pool, symbol_union::id, agent_struct::ids_with_unknown_level, slot_struct::impasse_id, identifier_struct::input_wmes, identifier_struct::level, level_update_needed(), wme_struct::next, slot_struct::next, NIL, preference_is_binary(), preference_struct::referent, remove_from_dll, identifier_struct::slots, symbol_remove_ref(), preference_struct::type, identifier_struct::unknown_level, wme_struct::value, preference_struct::value, agent_struct::walk_level, agent_struct::walk_tc_number, and slot_struct::wmes.
Referenced by do_demotion().