00001
00043 #ifndef _SOAR_CORE_API_H_
00044 #define _SOAR_CORE_API_H_
00045
00046 #include "soarkernel.h"
00047 #include "callback.h"
00048 #include "soarapi_datatypes.h"
00049
00050
00051
00052
00053
00054
00055
00067
00068
00069
00083 extern void soar_cInitializeSoar (void);
00084
00085
00086
00110 extern int soar_cReInitSoar (void);
00111
00112
00129 extern void soar_cCreateAgent (char * agent_name);
00130
00131
00165 extern int soar_cRun( long n, bool all, enum go_type_enum type,
00166 enum soar_apiSlotType slot);
00167
00168
00169
00170
00171
00180 extern void soar_cStopAllAgents( void );
00181
00193 extern void soar_cStopCurrentAgent( char *reason );
00194
00195
00216 extern int soar_cDestroyAgentByName( char *name );
00217
00218
00238 extern int soar_cDestroyAllAgentsWithName( char *name );
00239
00240
00241
00260 extern void soar_cDestroyAgentByAddress (psoar_agent delete_agent);
00261
00262
00263
00293 extern int soar_cDestroyAgentById (int agent_id);
00294
00295
00296
00313 extern void soar_cQuit ( void );
00314
00315
00319
00320
00321
00333
00334
00335
00360 extern int soar_cLoadReteNet( char *filename );
00361
00362
00363
00364
00365
00385 extern int soar_cSaveReteNet( char *filename );
00386
00387
00422 extern unsigned long soar_cAddWme( char *szId, char *szAttr, char *szValue,
00423 bool accept, psoar_wme *new_wme );
00424
00425
00426
00427
00428
00429
00448 extern int soar_cRemoveWmeUsingTimetag( int num );
00449
00450
00475 extern int soar_cRemoveWme( psoar_wme wme );
00476
00477
00478
00495 extern void soar_cExciseAllProductions (void);
00496
00497
00498
00514 extern void soar_cExciseAllTaskProductions (void);
00515
00516
00517
00539 extern void soar_cExciseAllProductionsOfType ( byte type );
00540
00541
00542
00561 extern int soar_cExciseProductionByName ( char *name );
00562
00566
00567
00568
00575
00576
00593 extern void soar_cSetSystemParameter( int param, long value );
00594
00595 #define soar_cGetInputPeriod() (soar_agent->input_period)
00596
00597 #define soar_cSetInputPeriod(p) ((p >= 0)?(soar_agent->input_period = p) : -1)
00598
00599 #define soar_cGetVerbosity() (soar_agent->soar_verbose_flag)
00600
00601 #define soar_cSetVerbosity(x) ((soar_agent->soar_verbose_flag) = (x))
00602
00603
00604 #ifndef NO_TIMING_STUFF
00605
00631 extern double soar_cDetermineTimerResolution( double *min, double *max);
00632 #endif
00633
00634
00635
00636
00637 #ifdef DC_HISTOGRAM
00638
00660 extern void soar_cInitializeDCHistogram( int size, int freq );
00661 #endif
00662
00663
00664 #ifdef KT_HISTOGRAM
00665
00686 extern void soar_cInitializeKTHistogram( int size );
00687 #endif
00688
00705 extern void soar_cSetChunkNameLong( bool truly );
00706
00707
00708
00734 extern int soar_cSetChunkNameCount( long count );
00735
00736
00737
00758 extern int soar_cSetChunkNamePrefix( char *prefix );
00759
00760
00761
00779 extern void soar_cSetLearning( enum soar_apiLearningSetting setting );
00780
00781
00782
00801 extern int soar_cSetOperand2( bool turnOn );
00802
00803
00817 extern void soar_cSetWaitSNC( bool wait );
00818
00819
00838 extern int soar_cMultiAttributes( char *attr, int value );
00839
00840
00841
00842
00843
00844
00870 extern int soar_cAttributePreferencesMode (int mode );
00871
00872
00877
00878
00879
00887
00888
00916 extern void soar_cAddInputFunction (agent * a, soar_callback_fn f,
00917 soar_callback_data cb_data,
00918 soar_callback_free_fn free_fn,
00919 char * name);
00920
00921
00922
00923
00924
00942 extern void soar_cRemoveInputFunction (agent * a, char * name);
00943
00944
00945
00975 extern void soar_cAddOutputFunction (agent * a, soar_callback_fn f,
00976 soar_callback_data cb_data,
00977 soar_callback_free_fn free_fn,
00978 char * output_link_name);
00979
00980
00981
00982
01001 extern void soar_cRemoveOutputFunction (agent * a, char * name);
01002
01003
01004
01005
01032 extern void soar_cPushCallback (soar_callback_agent a,
01033 SOAR_CALLBACK_TYPE type,
01034 soar_callback_fn fn,
01035 soar_callback_data data,
01036 soar_callback_free_fn free_fn );
01037
01038
01039
01066 extern void soar_cAddCallback (soar_callback_agent a,
01067 SOAR_CALLBACK_TYPE type,
01068 soar_callback_fn fn,
01069 soar_callback_data data,
01070 soar_callback_free_fn free_fn,
01071 soar_callback_id id);
01072
01073
01074
01075
01097 extern void soar_cPopCallback (soar_callback_agent a,
01098 SOAR_CALLBACK_TYPE type);
01099
01100
01101
01120 extern void soar_cRemoveCallback (soar_callback_agent a,
01121 SOAR_CALLBACK_TYPE type,
01122 soar_callback_id id);
01123
01124
01125
01126
01127
01154 extern void soar_cAddGlobalCallback( SOAR_GLOBAL_CALLBACK_TYPE type,
01155 soar_callback_fn fn,
01156 soar_callback_data data,
01157 soar_callback_free_fn free_fn,
01158 soar_callback_id id );
01159
01160
01161
01177 extern void soar_cRemoveGlobalCallback( SOAR_GLOBAL_CALLBACK_TYPE type,
01178 soar_callback_id id);
01179
01180
01181
01199 extern void soar_cListAllCallbacks (soar_callback_agent a,
01200 bool monitorable_only);
01201
01202
01217 extern void soar_cListAllCallbacksForEvent (soar_callback_agent agent,
01218 SOAR_CALLBACK_TYPE type);
01219
01234 extern void soar_cRemoveAllMonitorableCallbacks (soar_callback_agent agent);
01235
01236
01237
01253 extern void soar_cRemoveAllCallbacksForEvent (soar_callback_agent agent,
01254 SOAR_CALLBACK_TYPE type);
01255
01256
01274 extern void soar_cTestAllMonitorableCallbacks(soar_callback_agent the_agent);
01275
01276
01295 extern SOAR_CALLBACK_TYPE soar_cCallbackNameToEnum (char * name,
01296 bool monitor_only);
01297
01298
01299
01300
01301 extern void soar_cDefaultAskCallback( soar_callback_agent the_agent,
01302 soar_callback_data data,
01303 soar_call_data call_data );
01304
01305
01308
01309
01310
01320
01321
01353 extern char *soar_cGetWmeId( psoar_wme w, char *buff );
01354
01355
01356
01357
01385 extern char *soar_cGetWmeAttr( psoar_wme w, char *buff );
01386
01387
01388
01389
01390
01418 extern char *soar_cGetWmeValue( psoar_wme w, char *buff );
01419
01420
01421
01422
01423
01424
01425
01440 extern unsigned long soar_cGetWmeTimetag( psoar_wme w );
01441
01442
01443
01444
01471 extern unsigned long soar_cAddIntWme( char *szId, char *szAttr, int value,
01472 bool acceptable_preference,
01473 psoar_wme *new_wme );
01474
01475
01476
01477
01504 extern unsigned long soar_cAddFloatWme( char *szId, char *szAttr, float value,
01505 bool acceptable_preference,
01506 psoar_wme *new_wme );
01507
01508
01509
01531 extern void soar_cInitAgentIterator( soar_apiAgentIterator *ai );
01532
01533
01560 extern bool soar_cStepAgentIterator( soar_apiAgentIterator *ai );
01561
01562
01581 extern psoar_agent soar_cGetAgentByName( char *name );
01582
01583
01584
01601 int soar_cGetIdForAgentByName( char *name );
01602
01603
01618 bool soar_cSetCurrentAgentByName( char *name );
01619
01620
01621
01636 void soar_cSetCurrentAgent( psoar_agent agent );
01637
01638
01649 psoar_agent soar_cGetCurrentAgent( );
01650
01651
01652
01653
01679 char *soar_cGetAgentInputLinkId( psoar_agent a, char *buff );
01680
01681
01682
01708 char *soar_cGetAgentOutputLinkId( psoar_agent a, char *buff );
01709
01710
01726 int soar_cGetAgentId( psoar_agent a );
01727
01728
01744 #ifdef USE_STDARGS
01745 void print( char *format, ... );
01746 #else
01747 void print ();
01748 #endif
01749
01750
01751
01752
01755 #endif