Soar Kernel
9.3.2 08-06-12
|
#include <portability.h>
#include <stdlib.h>
#include "io_soar.h"
#include "callback.h"
#include "agent.h"
#include "print.h"
#include "init_soar.h"
#include "gdatastructs.h"
#include "wmem.h"
#include "symtab.h"
#include "decide.h"
#include "production.h"
#include "lexer.h"
#include "xml.h"
#include "soar_TraceNames.h"
#include "utilities.h"
#include "wma.h"
#include <ctype.h>
#include <assert.h>
Go to the source code of this file.
Macros | |
#define | LINK_NAME_SIZE 1024 |
#define | MAX_TEXT_INPUT_LINE_LENGTH 1000 /* used to be in soarkernel.h */ |
#define | MODIFIED_BUT_SAME_TC_OL_STATUS |
#define | MODIFIED_OL_STATUS |
#define | NEW_OL_STATUS 0 /* just created it */ |
#define | REMOVED_OL_STATUS 4 /* link has just been removed */ |
#define | UNCHANGED_OL_STATUS 1 /* normal status */ |
Variables | |
char | extra_tio_constituents [] = "+-._" |
Bool | tio_constituent_char [256] |
Bool | tio_whitespace [256] |
#define LINK_NAME_SIZE 1024 |
Definition at line 411 of file io.cpp.
Referenced by update_for_top_state_wme_addition().
#define MAX_TEXT_INPUT_LINE_LENGTH 1000 /* used to be in soarkernel.h */ |
Definition at line 867 of file io.cpp.
Referenced by get_next_io_symbol_from_text_input_line().
#define MODIFIED_BUT_SAME_TC_OL_STATUS |
Definition at line 381 of file io.cpp.
Referenced by do_output_cycle().
#define MODIFIED_OL_STATUS |
Definition at line 382 of file io.cpp.
Referenced by do_output_cycle().
#define NEW_OL_STATUS 0 /* just created it */ |
Definition at line 379 of file io.cpp.
Referenced by do_output_cycle(), and update_for_top_state_wme_addition().
#define REMOVED_OL_STATUS 4 /* link has just been removed */ |
Definition at line 383 of file io.cpp.
Referenced by do_output_cycle().
#define UNCHANGED_OL_STATUS 1 /* normal status */ |
Definition at line 380 of file io.cpp.
Referenced by do_output_cycle().
Definition at line 564 of file io.cpp.
void add_input_function | ( | agent * | thisAgent, |
soar_callback_fn | f, | ||
soar_callback_data | cb_data, | ||
soar_callback_free_fn | free_fn, | ||
const char * | name | ||
) |
Definition at line 81 of file io.cpp.
References INPUT_PHASE_CALLBACK, and soar_add_callback().
Definition at line 199 of file io.cpp.
References add_wme_to_wm(), FALSE, symbol_union::id, identifier_struct::input_wmes, insert_at_head_of_dll, make_wme(), pi_struct::next, NIL, pi_struct::prev, print(), wma_activate_wme(), and wma_enabled().
Referenced by init_agent_memory().
void add_output_function | ( | agent * | thisAgent, |
soar_callback_fn | f, | ||
soar_callback_data | cb_data, | ||
soar_callback_free_fn | free_fn, | ||
int | eventID, | ||
const char * | output_link_name | ||
) |
Definition at line 91 of file io.cpp.
References OUTPUT_PHASE_CALLBACK, print(), soar_add_callback(), and soar_exists_callback_id().
Definition at line 614 of file io.cpp.
References wme_struct::attr, io_wme_struct::attr, agent_struct::collected_io_wmes, wme_struct::id, io_wme_struct::id, agent_struct::io_wme_pool, io_wme_struct::next, wme_struct::value, and io_wme_struct::value.
void calculate_output_link_tc_info | ( | agent * | thisAgent, |
output_link * | ol | ||
) |
Definition at line 594 of file io.cpp.
Referenced by do_output_cycle().
Definition at line 645 of file io.cpp.
Referenced by do_output_cycle().
void do_input_cycle | ( | agent * | thisAgent | ) |
Definition at line 287 of file io.cpp.
References do_buffered_wm_and_ownership_changes(), FALSE, INPUT_PHASE_CALLBACK, agent_struct::io_header, agent_struct::io_header_input, agent_struct::io_header_link, agent_struct::io_header_output, NIL, NORMAL_INPUT_CYCLE, agent_struct::output_link_changed, agent_struct::prev_top_state, release_io_symbol(), soar_invoke_callbacks(), agent_struct::top_state, and TOP_STATE_JUST_REMOVED.
Referenced by clear_goal_stack(), do_one_top_level_phase(), and init_agent_memory().
void do_output_cycle | ( | agent * | thisAgent | ) |
Definition at line 665 of file io.cpp.
References ADDED_OUTPUT_COMMAND, calculate_output_link_tc_info(), output_link_struct::cb, agent_struct::current_phase, callback_struct::data, deallocate_io_wme_list(), callback_struct::eventid, agent_struct::existing_output_links, callback_struct::function, get_io_wmes_for_output_link(), output_link_struct::link_wme, output_call_info_struct::mode, MODIFIED_BUT_SAME_TC_OL_STATUS, MODIFIED_OL_STATUS, MODIFIED_OUTPUT_COMMAND, NEW_OL_STATUS, pi_struct::next, output_link_struct::next, NIL, agent_struct::output_link_pool, output_call_info_struct::outputs, pi_struct::prev, remove_from_dll, remove_output_link_tc_info(), REMOVED_OL_STATUS, REMOVED_OUTPUT_COMMAND, output_link_struct::status, agent_struct::timers_decision_cycle_phase, agent_struct::timers_kernel, agent_struct::timers_output_function_cpu_time, agent_struct::timers_phase, agent_struct::timers_total_kernel_time, UNCHANGED_OL_STATUS, and wme_remove_ref().
Referenced by clear_goal_stack(), do_one_top_level_phase(), and init_agent_memory().
wme* find_input_wme_by_timetag_from_id | ( | agent * | thisAgent, |
Symbol * | idSym, | ||
uint64_t | timetag, | ||
tc_number | tc | ||
) |
Definition at line 224 of file io.cpp.
References symbol_union::id, IDENTIFIER_SYMBOL_TYPE, identifier_struct::input_wmes, wme_struct::next, NIL, identifier_struct::tc_num, wme_struct::timetag, and wme_struct::value.
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().
Definition at line 191 of file io.cpp.
References make_float_constant().
Referenced by get_io_symbol_from_tio_constituent_string().
Definition at line 166 of file io.cpp.
References find_identifier(), make_new_identifier(), symbol_add_ref(), and TOP_GOAL_LEVEL.
Definition at line 187 of file io.cpp.
References make_int_constant().
Referenced by get_io_symbol_from_tio_constituent_string().
Definition at line 183 of file io.cpp.
References make_sym_constant().
Referenced by get_next_io_symbol_from_text_input_line().
Definition at line 826 of file io.cpp.
References determine_possible_symbol_types_for_string(), get_io_float_constant(), get_io_int_constant(), NIL, and print().
Referenced by get_next_io_symbol_from_text_input_line().
io_wme* get_io_wmes_for_output_link | ( | agent * | thisAgent, |
output_link * | ol | ||
) |
Definition at line 626 of file io.cpp.
Referenced by do_output_cycle().
Definition at line 161 of file io.cpp.
References make_new_identifier(), and TOP_GOAL_LEVEL.
Referenced by init_agent_memory().
Definition at line 869 of file io.cpp.
References get_io_sym_constant(), get_io_symbol_from_tio_constituent_string(), MAX_TEXT_INPUT_LINE_LENGTH, NIL, tio_constituent_char, and tio_whitespace.
Referenced by accept_rhs_function_code().
Definition at line 793 of file io.cpp.
References io_wme_struct::attr, io_wme_struct::id, io_wme_struct::next, NIL, and io_wme_struct::value.
void inform_output_module_of_wm_changes | ( | agent * | thisAgent, |
list * | wmes_being_added, | ||
list * | wmes_being_removed | ||
) |
Definition at line 485 of file io.cpp.
Referenced by do_buffered_wm_changes().
void init_soar_io | ( | agent * | thisAgent | ) |
Definition at line 910 of file io.cpp.
References extra_tio_constituents, FALSE, init_memory_pool(), agent_struct::io_wme_pool, agent_struct::output_link_pool, tio_constituent_char, tio_whitespace, and TRUE.
Referenced by init_soar_agent().
Definition at line 195 of file io.cpp.
References symbol_remove_ref().
Referenced by accept_rhs_function_code(), and do_input_cycle().
void remove_input_function | ( | agent * | thisAgent, |
const char * | name | ||
) |
Definition at line 87 of file io.cpp.
References INPUT_PHASE_CALLBACK, and soar_remove_callback().
Definition at line 251 of file io.cpp.
References FALSE, wme_struct::gds, gds_invalid_so_remove_goal(), gds_struct::goal, wme_struct::id, symbol_union::id, identifier_struct::input_wmes, pi_struct::next, wme_struct::next, NIL, pi_struct::prev, print(), remove_from_dll, remove_wme_from_wm(), and TRUE.
void remove_output_function | ( | agent * | thisAgent, |
const char * | name | ||
) |
Definition at line 114 of file io.cpp.
References output_link_struct::cb, agent_struct::existing_output_links, output_link_struct::link_wme, pi_struct::next, output_link_struct::next, NIL, wme_struct::output_link, agent_struct::output_link_pool, OUTPUT_PHASE_CALLBACK, pi_struct::prev, remove_from_dll, soar_exists_callback_id(), soar_remove_callback(), and wme_remove_ref().
void remove_output_link_tc_info | ( | agent * | thisAgent, |
output_link * | ol | ||
) |
Definition at line 536 of file io.cpp.
References abort_with_fatal_error(), identifier_struct::associated_output_links, BUFFER_MSG_SIZE, cons_struct::first, free_cons(), symbol_union::id, output_link_struct::ids_in_tc, NIL, cons_struct::rest, and symbol_remove_ref().
Referenced by do_output_cycle().
void update_for_io_wme_change | ( | wme * | w | ) |
Definition at line 466 of file io.cpp.
Definition at line 412 of file io.cpp.
References wme_struct::attr, output_link_struct::cb, agent_struct::existing_output_links, FALSE, output_link_struct::ids_in_tc, insert_at_head_of_dll, LINK_NAME_SIZE, output_link_struct::link_wme, NEW_OL_STATUS, pi_struct::next, NIL, wme_struct::output_link, agent_struct::output_link_pool, OUTPUT_PHASE_CALLBACK, pi_struct::prev, soar_exists_callback_id(), output_link_struct::status, symbol_to_string(), and wme_add_ref().
char extra_tio_constituents[] = "+-._" |
Definition at line 908 of file io.cpp.
Referenced by init_soar_io().
Bool tio_constituent_char[256] |
Definition at line 823 of file io.cpp.
Referenced by get_next_io_symbol_from_text_input_line(), and init_soar_io().
Bool tio_whitespace[256] |
Definition at line 824 of file io.cpp.
Referenced by get_next_io_symbol_from_text_input_line(), and init_soar_io().