OpenCog Framework  Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
opencog::UREConfigReader Class Reference

#include <UREConfigReader.h>

+ Collaboration diagram for opencog::UREConfigReader:

Classes

class  RuleBaseParameters
 

Public Member Functions

 UREConfigReader (AtomSpace &as, Handle rbs)
 
const std::vector< Rule > & get_rules () const
 
std::vector< Rule > & get_rules ()
 
bool get_attention_allocation () const
 
int get_maximum_iterations () const
 
void set_attention_allocation (bool)
 
void set_maximum_iterations (int)
 

Static Public Attributes

static const std::string top_rbs_name = "URE"
 
static const std::string attention_alloc_name = "URE:attention-allocation"
 
static const std::string max_iter_name = "URE:maximum-iterations"
 

Private Member Functions

HandleSeq fetch_rules (Handle rbs)
 
HandleSeq fetch_execution_outputs (Handle schema, Handle input, Type type=ATOM)
 
double fetch_num_param (const std::string &schema_name, Handle input)
 
bool fetch_bool_param (const std::string &pred_name, Handle input)
 

Private Attributes

AtomSpace_as
 
RuleBaseParameters _rbparams
 

Detailed Description

Read the URE configuration in the AtomSpace as described in http://wiki.opencog.org/w/URE_Configuration_Format, and provide parameter accessors for all rule-based systems.

Todo:
: It doesn't support the hierarchical configuration structure described in http://wiki.opencog.org/w/URE_Configuration_Format#Rule-Based_System_Hierarchical_Structure, instead it assumes all parameters are duplicated for all systems and subsystems, for now.

Definition at line 44 of file UREConfigReader.h.

Constructor & Destructor Documentation

Member Function Documentation

bool UREConfigReader::fetch_bool_param ( const std::string &  pred_name,
Handle  input 
)
private

Definition at line 151 of file UREConfigReader.cc.

References _as, opencog::AtomSpace::add_link(), opencog::AtomSpace::add_node(), opencog::Atom::getTruthValue(), and tv.

+ Here is the caller graph for this function:

HandleSeq UREConfigReader::fetch_execution_outputs ( Handle  schema,
Handle  input,
Type  type = ATOM 
)
private
double UREConfigReader::fetch_num_param ( const std::string &  schema_name,
Handle  input 
)
private
HandleSeq UREConfigReader::fetch_rules ( Handle  rbs)
private

Definition at line 83 of file UREConfigReader.cc.

References _as, opencog::AtomSpace::add_link(), opencog::AtomSpace::add_node(), opencog::bindlink(), opencog::LinkCast(), and opencog::remove_hypergraph().

+ Here is the caller graph for this function:

bool UREConfigReader::get_attention_allocation ( ) const

Definition at line 63 of file UREConfigReader.cc.

References _rbparams, and opencog::UREConfigReader::RuleBaseParameters::attention_alloc.

+ Here is the caller graph for this function:

int UREConfigReader::get_maximum_iterations ( ) const

Definition at line 68 of file UREConfigReader.cc.

References _rbparams, and opencog::UREConfigReader::RuleBaseParameters::max_iter.

+ Here is the caller graph for this function:

const std::vector< Rule > & UREConfigReader::get_rules ( ) const

Definition at line 53 of file UREConfigReader.cc.

References _rbparams, and opencog::UREConfigReader::RuleBaseParameters::rules.

+ Here is the caller graph for this function:

std::vector< Rule > & UREConfigReader::get_rules ( )
void UREConfigReader::set_attention_allocation ( bool  aa)
void UREConfigReader::set_maximum_iterations ( int  mi)

Member Data Documentation

AtomSpace& opencog::UREConfigReader::_as
private

Definition at line 85 of file UREConfigReader.h.

RuleBaseParameters opencog::UREConfigReader::_rbparams
private

Definition at line 93 of file UREConfigReader.h.

const std::string UREConfigReader::attention_alloc_name = "URE:attention-allocation"
static

Definition at line 70 of file UREConfigReader.h.

const std::string UREConfigReader::max_iter_name = "URE:maximum-iterations"
static

Definition at line 74 of file UREConfigReader.h.

const std::string UREConfigReader::top_rbs_name = "URE"
static

Definition at line 66 of file UREConfigReader.h.


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