Soar Kernel  9.3.2 08-06-12
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Data Structures | Typedefs | Enumerations | Functions
soar_module Namespace Reference

Data Structures

class  accumulator
class  agent_predicate
class  bla_object_memory
class  boolean_param
class  btw_predicate
class  constant_param
class  database
class  f_predicate
class  gt_predicate
class  lt_predicate
class  named_object
class  object_container
class  object_memory
class  param
class  pooled_sqlite_statement
class  predicate
class  primitive_param
class  primitive_set_param
class  primitive_stat
class  soar_memory_pool_allocator
class  sqlite_database
class  sqlite_statement
class  sqlite_statement_container
class  sqlite_statement_pool
class  stat
class  stat_container
class  statement
class  statement_container
class  status_object
class  string_param
class  sym_set_param
struct  symbol_triple_struct
class  timer
class  timer_container

Typedefs

typedef primitive_param< double > decimal_param
typedef primitive_stat< double > decimal_stat
typedef primitive_set_param
< int64_t > 
int_set_param
typedef primitive_param< int64_t > integer_param
typedef primitive_stat< int64_t > integer_stat
typedef object_container< paramparam_container
typedef struct
soar_module::symbol_triple_struct 
symbol_triple
typedef std::list
< symbol_triple * > 
symbol_triple_list
typedef std::set< wme * > wme_set

Enumerations

enum  boolean
enum  db_status
enum  exec_result
enum  statement_action
enum  statement_status
enum  value_type

Functions

wmeadd_module_wme (agent *my_agent, Symbol *id, Symbol *attr, Symbol *value)
memory_poolget_memory_pool (agent *my_agent, size_t size)
instantiationmake_fake_instantiation (agent *my_agent, Symbol *state, wme_set *conditions, symbol_triple_list *actions)
void remove_module_wme (agent *my_agent, wme *w)

Typedef Documentation

Definition at line 326 of file soar_module.h.

Definition at line 805 of file soar_module.h.

Definition at line 488 of file soar_module.h.

Definition at line 325 of file soar_module.h.

Definition at line 804 of file soar_module.h.

Definition at line 733 of file soar_module.h.

Definition at line 51 of file soar_module.h.

typedef std::set< wme* > soar_module::wme_set

Definition at line 41 of file soar_module.h.

Enumeration Type Documentation

Enumerator:
off 
on 

Definition at line 717 of file soar_module.h.

{ off, on };
Enumerator:
disconnected 
connected 
problem 

Definition at line 36 of file soar_db.h.

Enumerator:
row 
ok 
err 

Definition at line 48 of file soar_db.h.

{ row, ok, err };
Enumerator:
op_none 
op_reinit 
op_clean 

Definition at line 42 of file soar_db.h.

Enumerator:
unprepared 
ready 

Definition at line 39 of file soar_db.h.

Enumerator:
null_t 
int_t 
double_t 
text_t 

Definition at line 45 of file soar_db.h.

Function Documentation

wme * soar_module::add_module_wme ( agent my_agent,
Symbol id,
Symbol attr,
Symbol value 
)

Definition at line 48 of file soar_module.cpp.

References add_wme_to_wm(), insert_at_head_of_dll, make_slot(), make_wme(), and slot_struct::wmes.

Referenced by create_new_impasse(), and epmem_new_episode().

{
slot *my_slot = make_slot( my_agent, id, attr );
wme *w = make_wme( my_agent, id, attr, value, false );
insert_at_head_of_dll( my_slot->wmes, w, next, prev );
add_wme_to_wm( my_agent, w );
return w;
}
memory_pool * soar_module::get_memory_pool ( agent my_agent,
size_t  size 
)

Definition at line 179 of file soar_module.cpp.

References agent_struct::dyn_memory_pools, and init_memory_pool().

Referenced by soar_module::soar_memory_pool_allocator< T >::allocate(), and soar_module::soar_memory_pool_allocator< T >::deallocate().

{
memory_pool* return_val = NULL;
std::map< size_t, memory_pool* >::iterator it = my_agent->dyn_memory_pools->find( size );
if ( it == my_agent->dyn_memory_pools->end() )
{
memory_pool* newbie = new memory_pool;
init_memory_pool( my_agent, newbie, size, "dynamic" );
my_agent->dyn_memory_pools->insert( std::make_pair< size_t, memory_pool* >( size, newbie ) );
return_val = newbie;
}
else
{
return_val = it->second;
}
return return_val;
}
instantiation * soar_module::make_fake_instantiation ( agent my_agent,
Symbol state,
wme_set *  conditions,
symbol_triple_list *  actions 
)

Definition at line 81 of file soar_module.cpp.

References ACCEPTABLE_PREFERENCE_TYPE, preference_struct::attr, three_field_tests_struct::attr_test, instantiation_struct::backtrace_number, instantiation_struct::bottom_of_instantiated_conditions, condition_struct::bt, agent_struct::condition_pool, condition_struct::data, FALSE, instantiation_struct::GDS_evaluated_already, 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, identifier_struct::level, bt_info_struct::level, make_equality_test(), make_preference(), instantiation_struct::match_goal, instantiation_struct::match_goal_level, instantiation_struct::next, condition_struct::next, NIL, instantiation_struct::nots, preference_struct::o_supported, POSITIVE_CONDITION, preference_add_ref(), 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, 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, condition_struct::type, preference_struct::value, three_field_tests_struct::value_test, bt_info_struct::wme_, and wme_add_ref().

Referenced by _epmem_process_buffered_wme_list(), and _smem_process_buffered_wme_list().

{
// make fake instantiation
allocate_with_pool( my_agent, &( my_agent->instantiation_pool ), &inst );
inst->prod = NULL;
inst->next = inst->prev = NULL;
inst->rete_token = NULL;
inst->rete_wme = NULL;
inst->match_goal = state;
inst->match_goal_level = state->id.level;
inst->reliable = true;
inst->backtrace_number = 0;
inst->in_ms = FALSE;
// create preferences
inst->preferences_generated = NULL;
{
preference* pref;
for ( symbol_triple_list::iterator a_it=actions->begin(); a_it!=actions->end(); a_it++ )
{
pref = make_preference( my_agent, ACCEPTABLE_PREFERENCE_TYPE, (*a_it)->id, (*a_it)->attr, (*a_it)->value, NIL );
pref->o_supported = true;
symbol_add_ref( pref->id );
symbol_add_ref( pref->attr );
pref->inst = inst;
pref->inst_next = pref->inst_prev = NULL;
insert_at_head_of_dll( inst->preferences_generated, pref, inst_next, inst_prev );
}
}
// create conditions
{
condition *cond = NULL;
condition *prev_cond = NULL;
for ( wme_set::iterator c_it=conditions->begin(); c_it!=conditions->end(); c_it++ )
{
// construct the condition
allocate_with_pool( my_agent, &( my_agent->condition_pool ), &cond );
cond->prev = prev_cond;
cond->next = NULL;
if ( prev_cond != NULL )
{
prev_cond->next = cond;
}
else
{
inst->nots = NULL;
}
cond->data.tests.id_test = make_equality_test( (*c_it)->id );
cond->data.tests.attr_test = make_equality_test( (*c_it)->attr );
cond->data.tests.value_test = make_equality_test( (*c_it)->value );
cond->test_for_acceptable_preference = (*c_it)->acceptable;
cond->bt.wme_ = (*c_it);
#ifndef DO_TOP_LEVEL_REF_CTS
#endif
{
wme_add_ref( (*c_it) );
}
cond->bt.level = (*c_it)->id->id.level;
cond->bt.trace = (*c_it)->preference;
if ( cond->bt.trace )
{
#ifndef DO_TOP_LEVEL_REF_CTS
#endif
{
}
}
cond->bt.prohibits = NULL;
prev_cond = cond;
}
}
return inst;
}
void soar_module::remove_module_wme ( agent my_agent,
wme w 
)

Definition at line 59 of file soar_module.cpp.

References wme_struct::attr, find_slot(), wme_struct::gds, gds_invalid_so_remove_goal(), gds_struct::goal, wme_struct::id, NIL, remove_from_dll, remove_wme_from_wm(), and slot_struct::wmes.

Referenced by epmem_new_episode().

{
slot *my_slot = find_slot( w->id, w->attr );
if ( my_slot )
{
remove_from_dll( my_slot->wmes, w, next, prev );
if ( w->gds )
{
if ( w->gds->goal != NIL )
{
/* NOTE: the call to remove_wme_from_wm will take care of checking if GDS should be removed */
}
}
remove_wme_from_wm( my_agent, w );
}
}