Soar Kernel  9.3.2 08-06-12
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
gsysparam.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 /* gsysparam.h */
7 
8 /* ====================================================================
9  Global System Parameters and Related Definitions
10 
11  A set of system parameters (sysparam's for short) affect many operations
12  of Soar, including learning, tracing, deciding, etc. In order to
13  provide a simple, uniform update mechanism (a single callback routine that
14  gets called when any parameter changes), we store these parameters in
15  an array sysparams[]. Below, we #define various indices into this array
16  corresponding to various system parameters.
17 
18  Most of the parameters are of type "int64_t". A few parameters are more
19  naturally handled as lists; for these, the array value is just a dummy,
20  and callback routines must inspect a global variable to get the real
21  value. Chunk_free_problem_spaces is an example of this.
22 
23  The array of sysparams[] can be read directly, but should be modified
24  ONLY via calls to set_sysparam(), which is defined in init-soar.c.
25 ==================================================================== */
26 
27 #ifndef GSYSPARAM_H
28 #define GSYSPARAM_H
29 
30 #ifdef __cplusplus
31 //extern "C"
32 //{
33 #endif
34 
35 typedef char Bool;
36 typedef unsigned char byte;
37 typedef struct agent_struct agent;
38 
39 /* -------------------------------
40  Types of Productions
41 ------------------------------- */
42 
43 #define USER_PRODUCTION_TYPE 0
44 #define DEFAULT_PRODUCTION_TYPE 1
45 #define CHUNK_PRODUCTION_TYPE 2
46 #define JUSTIFICATION_PRODUCTION_TYPE 3
47 #define TEMPLATE_PRODUCTION_TYPE 4
48 
49 #define NUM_PRODUCTION_TYPES 5
50 // Soar-RL assumes that the production types start at 0 and go to (NUM_PRODUCTION_TYPES-1) sequentially
51 
52 /* ---------------------------------------
53  Match Set print parameters
54 --------------------------------------- */
55 
56 #define MS_ASSERT_RETRACT 0 /* print both retractions and assertions */
57 #define MS_ASSERT 1 /* print just assertions */
58 #define MS_RETRACT 2 /* print just retractions */
59 
60 typedef byte ms_trace_type; /* must be one of the above constants */
61 
62 /* ---------------------------------------
63  How much information to print about
64  the wmes matching an instantiation
65 --------------------------------------- */
66 
67 #define NONE_WME_TRACE 1 /* don't print anything */
68 #define TIMETAG_WME_TRACE 2 /* print just timetag */
69 #define FULL_WME_TRACE 3 /* print whole wme */
70 #define NO_WME_TRACE_SET 4
71 
72 typedef byte wme_trace_type; /* must be one of the above constants */
73 
74 /* -------------------------------
75  Ways to Do User-Select
76 ------------------------------- */
77 
78 #define USER_SELECT_BOLTZMANN 1 /* boltzmann algorithm, with respect to temperature */
79 #define USER_SELECT_E_GREEDY 2 /* with probability epsilon choose random, otherwise greedy */
80 #define USER_SELECT_FIRST 3 /* just choose the first candidate item */
81 #define USER_SELECT_LAST 4 /* choose the last item AGR 615 */
82 #define USER_SELECT_RANDOM 5 /* pick one at random */
83 #define USER_SELECT_SOFTMAX 6 /* pick one at random, probabalistically biased by numeric preferences */
84 #define USER_SELECT_INVALID 7 /* should be 1+ last item, used for validity checking */
85 
86 /* ---------------------------
87  And now, the sysparam's
88 --------------------------- */
89 
90 /* ====== Sysparams for what to trace === */
91 
92 #define TRACE_CONTEXT_DECISIONS_SYSPARAM 1
93 #define TRACE_PHASES_SYSPARAM 2
94 
95 /* --- Warning: these next four MUST be consecutive and in the order of the
96  production types defined above --- */
97 #define TRACE_FIRINGS_OF_USER_PRODS_SYSPARAM 3
98 #define TRACE_FIRINGS_OF_DEFAULT_PRODS_SYSPARAM 4
99 #define TRACE_FIRINGS_OF_CHUNKS_SYSPARAM 5
100 #define TRACE_FIRINGS_OF_JUSTIFICATIONS_SYSPARAM 6
101 #define TRACE_FIRINGS_OF_TEMPLATES_SYSPARAM 7
102 
103 #define TRACE_FIRINGS_WME_TRACE_TYPE_SYSPARAM 8
104 #define TRACE_FIRINGS_PREFERENCES_SYSPARAM 9
105 #define TRACE_WM_CHANGES_SYSPARAM 10
106 #define TRACE_CHUNK_NAMES_SYSPARAM 11
107 #define TRACE_JUSTIFICATION_NAMES_SYSPARAM 12
108 #define TRACE_CHUNKS_SYSPARAM 13
109 #define TRACE_JUSTIFICATIONS_SYSPARAM 14
110 #define TRACE_BACKTRACING_SYSPARAM 15
111 /* ===== watch loading flag ===== KJC 7/96 */
112 #define TRACE_LOADING_SYSPARAM 16
113 
114 /* ====== Max Elaborations === */
115 #define MAX_ELABORATIONS_SYSPARAM 17
116 
117 /* ====== Max Chunks === */
118 #define MAX_CHUNKS_SYSPARAM 18
119 
120 #define RESPOND_TO_LOAD_ERRORS_SYSPARAM 19
121 
122 /* ====== Sysparams for control of learning === */
123 #define LEARNING_ON_SYSPARAM 20
124 #define LEARNING_ONLY_SYSPARAM 21
125 #define LEARNING_EXCEPT_SYSPARAM 22
126 #define LEARNING_ALL_GOALS_SYSPARAM 23
127 
128 /* ====== User Select === */
129 #define USER_SELECT_MODE_SYSPARAM 24
130 
131 /* ====== Print Warnings === */
132 #define PRINT_WARNINGS_SYSPARAM 25
133 
134 /* AGR 627 begin */
135 /* ====== Whether to print out aliases as they're defined === */
136 #define PRINT_ALIAS_SYSPARAM 26
137 /* AGR 627 end */
138 
139 /* ===== explain_flag ===== KJC 7/96 */
140 #define EXPLAIN_SYSPARAM 27
141 
142 /* kjh(B14) */
143 #define USE_LONG_CHUNK_NAMES 28
144 
145 /* REW: 10.22.97 */
146 #define TRACE_OPERAND2_REMOVALS_SYSPARAM 29
147 
148 /* RMJ */
149 #define REAL_TIME_SYSPARAM 30
150 
151 /* RMJ */
152 #define ATTENTION_LAPSE_ON_SYSPARAM 31
153 
154 /* KJC 3/01 limit number of cycles in run_til_output */
155 #define MAX_NIL_OUTPUT_CYCLES_SYSPARAM 32
156 
157 #define TRACE_INDIFFERENT_SYSPARAM 33
158 
159 /* rmarinie 11/04 */
160 #define TIMERS_ENABLED 34
161 
162 #define MAX_GOAL_DEPTH 35
163 
164 /* KJC 8/06: generate warning and event if memory usage exceeds this value */
165 #define MAX_MEMORY_USAGE_SYSPARAM 36
166 
167 /* NLD: auto-reduction of exploration parameters */
168 #define USER_SELECT_REDUCE_SYSPARAM 37
169 
170 /* NLD: Soar-RL trace information */
171 #define TRACE_RL_SYSPARAM 38
172 
173 /* JRV: Bug 1087: Chunk through local negations */
174 #define CHUNK_THROUGH_LOCAL_NEGATIONS_SYSPARAM 39
175 
176 /* New waterfall model: trace waterfall events */
177 #define TRACE_WATERFALL_SYSPARAM 40
178 
179 /* NLD: WMA trace information */
180 #define TRACE_WMA_SYSPARAM 41
181 
182 /* NLD: EpMem trace information */
183 #define TRACE_EPMEM_SYSPARAM 42
184 
185 /* NLD: SMem trace information */
186 #define TRACE_SMEM_SYSPARAM 43
187 
188 /* JRV: GDS */
189 #define TRACE_GDS_SYSPARAM 44
190 
191 /* JRV: Break on long decision cycle time */
192 #define DECISION_CYCLE_MAX_USEC_INTERRUPT 45
193 
194 /* --- Warning: if you add sysparams, be sure to update the next line! --- */
195 #define HIGHEST_SYSPARAM_NUMBER 45
196 
197 /* -----------------------------------------
198  Sysparams[] stores the parameters; set_sysparam()
199  should be used to modify them.
200 ----------------------------------------- */
201 
202 extern void init_sysparams (agent* thisAgent);
203 extern void set_sysparam (agent* thisAgent, int param_number, int64_t new_value);
204 
205 #define kChunkNamePrefixMaxLength 64 /* kjh (B14) */
206 
207 #ifdef __cplusplus
208 //}
209 #endif
210 
211 #endif