Soar Kernel  9.3.2 08-06-12
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
init_soar.h
Go to the documentation of this file.
1 /*************************************************************************
2  * PLEASE SEE THE FILE "license.txt" (INCLUDED WITH THIS SOFTWARE PACKAGE)
3  * FOR LICENSE AND COPYRIGHT INFORMATION.
4  *************************************************************************/
5 
6 /* ========================================================================
7  init_soar.h
8 ======================================================================== */
9 
10 #ifndef INIT_SOAR_H
11 #define INIT_SOAR_H
12 
13 #ifdef __cplusplus
14 //extern "C"
15 //{
16 #endif
17 
18 typedef char Bool;
19 typedef signed short goal_stack_level;
20 typedef union symbol_union Symbol;
21 typedef struct agent_struct agent;
22 
23 /* added this prototype -ajc (5/3/02) */
24 extern void set_sysparam (agent* thisAgent, int param_number, int64_t new_value);
25 
26 extern void reset_statistics (agent* thisAgent);
27 extern void setup_signal_handling (void);
28 //extern void load_init_file (Kernel* thisKernel, agent* thisAgent);
29 
30 /* --- signal handler that gets invoked on SIGINT --- */
31 // (deprecated)
32 //extern void control_c_handler (int the_signal);
33 
34 /* Main pgm stuff -- moved here from soarkernel.h -ajc (5/7/02) */
35 
36 //extern int terminate_soar (void);
37 
38 /* ---------------------------------------------------------------------
39  Exiting Soar
40 
41  Exit_soar() and abort_with_fatal_error() both terminate Soar, closing
42  the log file before exiting. Abort_with_fatal_error() also prints
43  an error message before exiting. Just_before_exit_soar() calls the
44  Soar cleanup functions but does not actually exit. This is useful
45  for interfaces that do their own exiting.
46 --------------------------------------------------------------------- */
47 
48 //extern void exit_soar (agent* thisAgent);
49 extern void abort_with_fatal_error (agent* thisAgent, const char *);
50 //extern void just_before_exit_soar (agent* thisAgent);
51 
52 /* ---------------------------------------------------------------------
53  Adding and Removing Pwatchs
54 
55  Productions_being_traced is a (consed) list of all productions
56  on which a pwatch has been set. Pwatchs are added/removed via
57  calls to add_pwatch() and remove_pwatch().
58 --------------------------------------------------------------------- */
59 
60 extern void add_pwatch (agent* thisAgent, struct production_struct *prod);
61 extern void remove_pwatch (agent* thisAgent, struct production_struct *prod);
62 
63 /* ---------------------------------------------------------------------
64  Reinitializing Soar
65 
66  Reinitialize_soar() does all the work for an init-soar.
67 --------------------------------------------------------------------- */
68 
69 extern bool reinitialize_soar (agent* thisAgent);
70 
71 /* ---------------------------------------------------------------------
72  Reset Timers
73  This code was duplicated in three spots. It is now consolidated.
74  This stops and sets all timers to zero.
75 --------------------------------------------------------------------- */
76 extern void reset_timers (agent* thisAgent);
77 
78 /* ---------------------------------------------------------------------
79  Reset Timers
80  This code used to be in the CLI, it resets the per-cycle max stats.
81 --------------------------------------------------------------------- */
82 extern void reset_max_stats (agent* thisAgent);
83 
84 /* ---------------------------------------------------------------------
85  Reinitializing Soar
86 
87  This adds the top state (S1) and the io header symbols and wme's to the
88  agent's working memory. (This is a modification for the gSKI project).
89 --------------------------------------------------------------------- */
90 
91 extern void init_agent_memory (agent* thisAgent);
92 
93 /* ---------------------------------------------------------------------
94  Running Soar
95 
96  Each of the following routines runs Soar for a certain duration,
97  or until stop_soar gets set to TRUE.
98  - Run_forever() runs Soar forever.
99  - Run_for_n_phases() runs Soar for a given number (n) of top-level
100  phases. (If n==-1, it runs forever.)
101  - Run_for_n_elaboration_cycles() runs Soar for a given number (n)
102  of elaboration cycles. (Here, decision phase is counted as
103  an elaboration cycle.) (If n==-1, it runs forever.)
104  - Run_for_n_decision_cycles() runs Soar for a given number (n) of
105  decision cycles. (If n==-1, it runs forever.)
106  - Run_for_n_modifications_of_output runs soar by decision cycle
107  n times, where n starts at 0 and is incremented anytime the
108  output link is modified by the agent. n is not incremented when
109  the output-link is created nor when the output-link is modified
110  during the Input Cycle, ie when getting feedback from a simulator.
111  - Run_for_n_selections_of_slot (agent*, int64_t n, Symbol *attr_of_slot): this
112  runs Soar until the nth time a selection is made for a given
113  type of slot. Attr_of_slot should be either state_symbol or
114  operator_symbol.
115  - Run_for_n_selections_of_slot_at_level (agent*, int64_t n, Symbol *attr_of_slot,
116  goal_stack_level level): this runs Soar for n selections of the
117  given slot at the given level, or until the goal stack is popped
118  so that level no longer exists.
119 --------------------------------------------------------------------- */
120 
123 
124 extern void run_forever (agent* thisAgent);
125 extern void run_for_n_phases (agent* thisAgent, int64_t n);
126 extern void run_for_n_elaboration_cycles (agent* thisAgent, int64_t n);
127 extern void run_for_n_decision_cycles (agent* thisAgent, int64_t n);
128 extern void run_for_n_modifications_of_output (agent* thisAgent, int64_t n);
129 extern void run_for_n_selections_of_slot (agent*, int64_t n, Symbol *attr_of_slot);
130 extern void run_for_n_selections_of_slot_at_level (agent* thisAgent, int64_t n,
131  Symbol *attr_of_slot,
132  goal_stack_level level);
133 
134 extern void do_one_top_level_phase (agent* thisAgent);
135 
136 /* removed DETERMINE_LEVEL_PHASE for Soar 8.6
137  * added PROPOSE and APPLY. KJC May 2005
138  */
139 
148  };
149 
150 /* REW: end 05.05.97 */
151 
152 #ifdef __cplusplus
153 //}
154 #endif
155 
156 #endif
157