knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
knowrob::QueryTree::Node Class Reference

#include <QueryTree.h>

Collaboration diagram for knowrob::QueryTree::Node:

Public Member Functions

 Node (Node *parent, FormulaPtr formula, bool isNegated)
 
int priority () const
 
 Node (Node *parent, FormulaPtr formula, bool isNegated)
 
int priority () const
 

Public Attributes

Nodeparent
 
const FormulaPtr formula
 
bool isNegated
 
bool isOpen
 
std::list< Node * > successors
 

Detailed Description

A node in a QueryTree.

Definition at line 55 of file QueryTree.h.

Constructor & Destructor Documentation

◆ Node() [1/2]

QueryTree::Node::Node ( Node parent,
FormulaPtr  formula,
bool  isNegated 
)

Definition at line 37 of file QueryTree.cpp.

38  : parent(parent),
39  formula(std::move(formula)),
41  isOpen(true) {
42 }
const FormulaPtr formula
Definition: QueryTree.h:60

◆ Node() [2/2]

knowrob::QueryTree::Node::Node ( Node parent,
FormulaPtr  formula,
bool  isNegated 
)

Member Function Documentation

◆ priority() [1/2]

int QueryTree::Node::priority ( ) const

Definition at line 44 of file QueryTree.cpp.

44  {
45  switch (formula->type()) {
46  case FormulaType::MODAL:
49  return 1;
51  return isNegated ? 0 : 1;
54  return isNegated ? 1 : 0;
55  }
56  return 0;
57 }

◆ priority() [2/2]

int knowrob::QueryTree::Node::priority ( ) const

Member Data Documentation

◆ formula

const FormulaPtr knowrob::QueryTree::Node::formula

Definition at line 60 of file QueryTree.h.

◆ isNegated

bool knowrob::QueryTree::Node::isNegated

Definition at line 61 of file QueryTree.h.

◆ isOpen

bool knowrob::QueryTree::Node::isOpen

Definition at line 62 of file QueryTree.h.

◆ parent

Node * knowrob::QueryTree::Node::parent

Definition at line 59 of file QueryTree.h.

◆ successors

std::list< Node * > knowrob::QueryTree::Node::successors

Definition at line 63 of file QueryTree.h.


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