Inter4ql  5.2
Public Member Functions | List of all members
Inter4ql::ModuleProblem Class Reference

Implementation of ModuleAction for modules with reasoning. More...

#include <ModuleProblem.h>

Inheritance diagram for Inter4ql::ModuleProblem:
Inter4ql::ModuleGeneric

Public Member Functions

 ModuleProblem (std::string _name, std::vector< std::string > *_beliefs, std::vector< std::string > *_actions, Expression *_goal, int _max_depth, std::vector< std::string > *_heuristics)
 constructor More...
 
 ~ModuleProblem ()
 destructor More...
 
std::string get_name () const
 getter for a name of module More...
 
std::string print ()
 function that returns string with module information More...
 
module_type::type get_module_type () const
 getter for module type More...
 
void reason ()
 performs reasoning More...
 
Result ask_for_result (Fact *term) const
 provides valuations matching given Fact More...
 
std::vector< std::string > * get_beliefs ()
 getter for a beliefs in this Problem More...
 
std::vector< std::string > * get_actions ()
 getter for a actions in this Problem More...
 
Expressionget_goal ()
 getter for a goal in this Problem More...
 
int get_max_depth ()
 getter for a actions in this Problem More...
 
void add_belief_module (ModuleGeneric *module)
 adds Belief's Module object to the Problem More...
 
std::vector< ModuleGeneric * > * get_belief_modules ()
 getter for a beliefs in this Problem More...
 
void add_action_module (ModuleGeneric *module)
 adds Action's Module object to the Problem More...
 
std::vector< ModuleGeneric * > * get_action_modules ()
 getter for a actions in this Problem More...
 
void replace_actions (std::vector< std::string > *actions)
 setter for whole action list in the Problem More...
 
bool contains_action (std::string action_name)
 checks whether give actions is used in the Problem More...
 
- Public Member Functions inherited from Inter4ql::ModuleGeneric
 ModuleGeneric ()
 default constructor
 
virtual ~ModuleGeneric ()
 default destructor
 
virtual Relationget_relation (std::string s) const
 getter for a relation More...
 
virtual std::vector< Relation * > * get_relations () const
 getter for module relations More...
 
virtual void reason_with_rules (std::vector< Rule *> *rules)
 performs reasing with additional Rules added More...
 
virtual Result evaluate_expression (Expression *expr) const
 provides valuations matching given Expression More...
 
virtual Result evaluate_expression_bf (Expression *expr) const
 provides bel-free valuations matching given Expression More...
 
virtual std::vector< std::string > get_references (Fact *term)
 provides a list of Module references is term (useful when e.g. term is a shadowed Bel) More...
 
virtual void set_modules (std::vector< ModuleGeneric *> *_modules)
 setter for modules needed in this module More...
 
virtual Constraintsget_constraints () const
 getter for constraints More...
 
virtual std::vector< Domain * > * get_domains () const
 getter for domains More...
 
virtual bool contains_domain (Domain *d) const
 check if module contains domain More...
 
virtual bool contains_relation (Relation *d) const
 check if module contains relation (ignoring module name) More...
 
virtual void set_disable_constraints (bool value) const
 allows for disabling constraints check More...
 
virtual bool check_constraints_local (bool check_rigid, bool check_flexible) const
 evaluates constraints locally, in current module More...
 
virtual database * get_wsm_database ()
 fetches a database of facts from well-supported model (for summing purposes) More...
 
virtual database * get_add_database ()
 fetches a database of facts which were added by actions to this module More...
 
virtual database * get_remove_database ()
 fetches a database of facts which were removed by actions from this module More...
 
virtual void set_add_database (database *db)
 overrides a database of facts which were added by actions to this module More...
 
virtual void set_remove_database (database *db)
 overrides a database of facts which were removed by actions from this module More...
 
virtual bool constraints_violated ()
 checks whether constraints are violated More...
 

Additional Inherited Members

- Protected Attributes inherited from Inter4ql::ModuleGeneric
Inter4ql::database * database_to_add
 
Inter4ql::database * database_to_remove
 

Detailed Description

Implementation of ModuleAction for modules with reasoning.

Constructor & Destructor Documentation

◆ ModuleProblem()

Inter4ql::ModuleProblem::ModuleProblem ( std::string  _name,
std::vector< std::string > *  _beliefs,
std::vector< std::string > *  _actions,
Expression _goal,
int  _max_depth,
std::vector< std::string > *  _heuristics 
)

constructor

Parameters
_namename of a module
_constraintsinitial list of constraints
_memberslist of members

◆ ~ModuleProblem()

Inter4ql::ModuleProblem::~ModuleProblem ( )

destructor

Member Function Documentation

◆ add_action_module()

void Inter4ql::ModuleProblem::add_action_module ( ModuleGeneric module)

adds Action's Module object to the Problem

Parameters
moduleobject to be added

◆ add_belief_module()

void Inter4ql::ModuleProblem::add_belief_module ( ModuleGeneric module)

adds Belief's Module object to the Problem

Parameters
moduleobject to be added

◆ ask_for_result()

Result Inter4ql::ModuleProblem::ask_for_result ( Fact term) const
virtual

provides valuations matching given Fact

Parameters
termquery to find in database
Returns
possible valuations of term

Implements Inter4ql::ModuleGeneric.

◆ contains_action()

bool Inter4ql::ModuleProblem::contains_action ( std::string  action_name)

checks whether give actions is used in the Problem

Returns
true if action is used, false otherwise

◆ get_action_modules()

std::vector< ModuleGeneric * > * Inter4ql::ModuleProblem::get_action_modules ( )

getter for a actions in this Problem

Returns
action list (Module object list)

◆ get_actions()

std::vector< std::string > * Inter4ql::ModuleProblem::get_actions ( )

getter for a actions in this Problem

Returns
action list (string list)

◆ get_belief_modules()

std::vector< ModuleGeneric * > * Inter4ql::ModuleProblem::get_belief_modules ( )

getter for a beliefs in this Problem

Returns
belief list (Module object list)

◆ get_beliefs()

std::vector< std::string > * Inter4ql::ModuleProblem::get_beliefs ( )

getter for a beliefs in this Problem

Returns
belief list (string list)

◆ get_goal()

Expression * Inter4ql::ModuleProblem::get_goal ( )

getter for a goal in this Problem

Returns
goal Expression

◆ get_max_depth()

int Inter4ql::ModuleProblem::get_max_depth ( )

getter for a actions in this Problem

Returns
action list

◆ get_module_type()

module_type::type Inter4ql::ModuleProblem::get_module_type ( ) const
virtual

getter for module type

Returns
module type

Reimplemented from Inter4ql::ModuleGeneric.

◆ get_name()

std::string Inter4ql::ModuleProblem::get_name ( ) const
virtual

getter for a name of module

Returns
module name

Reimplemented from Inter4ql::ModuleGeneric.

◆ print()

std::string Inter4ql::ModuleProblem::print ( )
virtual

function that returns string with module information

Returns
module information packed in a std::string

Reimplemented from Inter4ql::ModuleGeneric.

◆ reason()

void Inter4ql::ModuleProblem::reason ( )
virtual

performs reasoning

Implements Inter4ql::ModuleGeneric.

◆ replace_actions()

void Inter4ql::ModuleProblem::replace_actions ( std::vector< std::string > *  actions)

setter for whole action list in the Problem

Parameters
actionsa new list of actions (list of strings)

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