#ifndef NODE_H #define NODE_H #include #include #include namespace bayesnet { using namespace std; class Node { private: static int next_id; const int id; string name; vector parents; vector children; int numStates; torch::Tensor cpt; public: Node(const std::string&, int); void addParent(Node*); void addChild(Node*); void removeParent(Node*); void removeChild(Node*); string getName() const; vector& getParents(); vector& getChildren(); torch::Tensor& getCPT(); void setCPT(const torch::Tensor&); int getNumStates() const; int getId() const { return id; } string getCPDKey(const Node*) const; }; } #endif