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

#include <DependencyGraph.h>

Public Member Functions

 DependencyNode (const FirstOrderLiteralPtr &literal)
 
const std::set< std::string_view > & variables () const
 
auto numVariables () const
 
auto numNeighbors () const
 
const auto & neighbors () const
 
void addDependency (const std::shared_ptr< DependencyNode > &other)
 
const auto & literal () const
 
 DependencyNode (const FirstOrderLiteralPtr &literal)
 
const std::set< std::string_view > & variables () const
 
auto numVariables () const
 
auto numNeighbors () const
 
const auto & neighbors () const
 
void addDependency (const std::shared_ptr< DependencyNode > &other)
 
const auto & literal () const
 

Protected Attributes

std::list< std::shared_ptr< DependencyNode > > neighbors_
 
const FirstOrderLiteralPtr literal_
 

Friends

class DependencyGraph
 

Detailed Description

A node in a dependency graph labeled with a literal.

Definition at line 16 of file DependencyGraph.h.

Constructor & Destructor Documentation

◆ DependencyNode() [1/2]

DependencyNode::DependencyNode ( const FirstOrderLiteralPtr literal)
explicit

Definition at line 91 of file DependencyGraph.cpp.

92  : literal_(literal)
93 {
94 }
const FirstOrderLiteralPtr literal_
const auto & literal() const

◆ DependencyNode() [2/2]

knowrob::DependencyNode::DependencyNode ( const FirstOrderLiteralPtr literal)
explicit

Member Function Documentation

◆ addDependency() [1/2]

void DependencyNode::addDependency ( const std::shared_ptr< DependencyNode > &  other)

Definition at line 96 of file DependencyGraph.cpp.

97 {
98  neighbors_.push_back(other);
99 }
std::list< std::shared_ptr< DependencyNode > > neighbors_

◆ addDependency() [2/2]

void knowrob::DependencyNode::addDependency ( const std::shared_ptr< DependencyNode > &  other)

◆ literal() [1/2]

const auto& knowrob::DependencyNode::literal ( ) const
inline
Returns
the literal associated to this node.

Definition at line 45 of file DependencyGraph.h.

45 { return literal_; }

◆ literal() [2/2]

const auto& knowrob::DependencyNode::literal ( ) const
inline
Returns
the literal associated to this node.

Definition at line 45 of file DependencyGraph.h.

45 { return literal_; }

◆ neighbors() [1/2]

const auto& knowrob::DependencyNode::neighbors ( ) const
inline
Returns
nodes with free variables shared with this node.

Definition at line 38 of file DependencyGraph.h.

38 { return neighbors_; }

◆ neighbors() [2/2]

const auto& knowrob::DependencyNode::neighbors ( ) const
inline
Returns
nodes with free variables shared with this node.

Definition at line 38 of file DependencyGraph.h.

38 { return neighbors_; }

◆ numNeighbors() [1/2]

auto knowrob::DependencyNode::numNeighbors ( ) const
inline
Returns
number of modal nodes with shared free variables.

Definition at line 33 of file DependencyGraph.h.

33 { return neighbors_.size(); }

◆ numNeighbors() [2/2]

auto knowrob::DependencyNode::numNeighbors ( ) const
inline
Returns
number of modal nodes with shared free variables.

Definition at line 33 of file DependencyGraph.h.

33 { return neighbors_.size(); }

◆ numVariables() [1/2]

auto knowrob::DependencyNode::numVariables ( ) const
inline
Returns
number of free variables in this node.

Definition at line 28 of file DependencyGraph.h.

28 { return variables().size(); }
const std::set< std::string_view > & variables() const

◆ numVariables() [2/2]

auto knowrob::DependencyNode::numVariables ( ) const
inline
Returns
number of free variables in this node.

Definition at line 28 of file DependencyGraph.h.

28 { return variables().size(); }

◆ variables() [1/2]

const std::set<std::string_view>& knowrob::DependencyNode::variables ( ) const
inline
Returns
the set of variables appearing in literal nodes.

Definition at line 23 of file DependencyGraph.h.

23 { return literal_->predicate()->variables(); }

◆ variables() [2/2]

const std::set<std::string_view>& knowrob::DependencyNode::variables ( ) const
inline
Returns
the set of variables appearing in literal nodes.

Definition at line 23 of file DependencyGraph.h.

23 { return literal_->predicate()->variables(); }

Friends And Related Function Documentation

◆ DependencyGraph

Definition at line 51 of file DependencyGraph.h.

Member Data Documentation

◆ literal_

const FirstOrderLiteralPtr knowrob::DependencyNode::literal_
protected

Definition at line 49 of file DependencyGraph.h.

◆ neighbors_

std::list< std::shared_ptr< DependencyNode > > knowrob::DependencyNode::neighbors_
protected

Definition at line 48 of file DependencyGraph.h.


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