Soar Kernel  9.3.2 08-06-12
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Data Fields
stats_statement_container Class Reference

#include <utilities.h>

Inherits soar_module::sqlite_statement_container.

Public Member Functions

 stats_statement_container (agent *new_agent)
- Public Member Functions inherited from soar_module::sqlite_statement_container
void add_structure (const char *new_structure)
 sqlite_statement_container (sqlite_database *new_db)
void structure ()
virtual ~sqlite_statement_container ()
- Public Member Functions inherited from soar_module::statement_container
void add (statement *new_statement)
void clean ()
void prepare ()
 statement_container ()
virtual ~statement_container ()

Data Fields

soar_module::sqlite_statementcache100
soar_module::sqlite_statementcache20
soar_module::sqlite_statementcache5
soar_module::sqlite_statementinsert
soar_module::sqlite_statementsel_dc_dec
soar_module::sqlite_statementsel_dc_inc
soar_module::sqlite_statementsel_firing_count_dec
soar_module::sqlite_statementsel_firing_count_inc
soar_module::sqlite_statementsel_time_dec
soar_module::sqlite_statementsel_time_inc
soar_module::sqlite_statementsel_wm_changes_dec
soar_module::sqlite_statementsel_wm_changes_inc

Additional Inherited Members

- Protected Attributes inherited from soar_module::sqlite_statement_container
sqlite_databasemy_db
std::list< const char * > * structures

Detailed Description

Definition at line 75 of file utilities.h.

Constructor & Destructor Documentation

stats_statement_container::stats_statement_container ( agent new_agent)

Definition at line 385 of file utilities.cpp.

References soar_module::statement_container::add(), soar_module::sqlite_statement_container::add_structure(), cache100, cache20, cache5, insert, sel_dc_dec, sel_dc_inc, sel_firing_count_dec, sel_firing_count_inc, sel_time_dec, sel_time_inc, sel_wm_changes_dec, sel_wm_changes_inc, and agent_struct::stats_db.

{
soar_module::sqlite_database *new_db = new_agent->stats_db;
//
add_structure( "CREATE TABLE IF NOT EXISTS stats (dc INTEGER PRIMARY KEY, time INTEGER, wm_changes INTEGER, firing_count INTEGER)" );
add_structure( "CREATE INDEX IF NOT EXISTS stats_time ON stats (time)" );
add_structure( "CREATE INDEX IF NOT EXISTS stats_wm_changes ON stats (wm_changes)" );
add_structure( "CREATE INDEX IF NOT EXISTS stats_firing_count ON stats (firing_count)" );
//
insert = new soar_module::sqlite_statement( new_db, "INSERT INTO stats (dc, time, wm_changes, firing_count) VALUES (?,?,?,?)" );
add( insert );
cache5 = new soar_module::sqlite_statement( new_db, "PRAGMA cache_size = 5000" );
add( cache5 );
cache20 = new soar_module::sqlite_statement( new_db, "PRAGMA cache_size = 20000" );
cache100 = new soar_module::sqlite_statement( new_db, "PRAGMA cache_size = 100000" );
sel_dc_inc = new soar_module::sqlite_statement( new_db, "SELECT * FROM stats ORDER BY dc" );
sel_dc_dec = new soar_module::sqlite_statement( new_db, "SELECT * FROM stats ORDER BY dc DESC" );
sel_time_inc = new soar_module::sqlite_statement( new_db, "SELECT * FROM stats ORDER BY time" );
sel_time_dec = new soar_module::sqlite_statement( new_db, "SELECT * FROM stats ORDER BY time DESC" );
sel_wm_changes_inc = new soar_module::sqlite_statement( new_db, "SELECT * FROM stats ORDER BY wm_changes" );
sel_wm_changes_dec = new soar_module::sqlite_statement( new_db, "SELECT * FROM stats ORDER BY wm_changes DESC" );
sel_firing_count_inc = new soar_module::sqlite_statement( new_db, "SELECT * FROM stats ORDER BY firing_count" );
sel_firing_count_dec = new soar_module::sqlite_statement( new_db, "SELECT * FROM stats ORDER BY firing_count DESC" );
}

Field Documentation

soar_module::sqlite_statement* stats_statement_container::cache100

Definition at line 82 of file utilities.h.

Referenced by stats_statement_container().

soar_module::sqlite_statement* stats_statement_container::cache20

Definition at line 81 of file utilities.h.

Referenced by stats_statement_container().

soar_module::sqlite_statement* stats_statement_container::cache5

Definition at line 80 of file utilities.h.

Referenced by stats_statement_container().

soar_module::sqlite_statement* stats_statement_container::insert

Definition at line 78 of file utilities.h.

Referenced by stats_db_store(), and stats_statement_container().

soar_module::sqlite_statement* stats_statement_container::sel_dc_dec

Definition at line 85 of file utilities.h.

Referenced by stats_statement_container().

soar_module::sqlite_statement* stats_statement_container::sel_dc_inc

Definition at line 84 of file utilities.h.

Referenced by stats_statement_container().

soar_module::sqlite_statement* stats_statement_container::sel_firing_count_dec

Definition at line 91 of file utilities.h.

Referenced by stats_statement_container().

soar_module::sqlite_statement* stats_statement_container::sel_firing_count_inc

Definition at line 90 of file utilities.h.

Referenced by stats_statement_container().

soar_module::sqlite_statement* stats_statement_container::sel_time_dec

Definition at line 87 of file utilities.h.

Referenced by stats_statement_container().

soar_module::sqlite_statement* stats_statement_container::sel_time_inc

Definition at line 86 of file utilities.h.

Referenced by stats_statement_container().

soar_module::sqlite_statement* stats_statement_container::sel_wm_changes_dec

Definition at line 89 of file utilities.h.

Referenced by stats_statement_container().

soar_module::sqlite_statement* stats_statement_container::sel_wm_changes_inc

Definition at line 88 of file utilities.h.

Referenced by stats_statement_container().


The documentation for this class was generated from the following files: