diff --git a/src/Network.cc b/src/Network.cc index 391b8af..4c039b4 100644 --- a/src/Network.cc +++ b/src/Network.cc @@ -38,6 +38,14 @@ namespace bayesnet { { return classNumStates; } + int Network::getStates() + { + int result = 0; + for (auto node : nodes) { + result += node.second->getNumStates(); + } + return result; + } string Network::getClassName() { return className; diff --git a/src/Network.h b/src/Network.h index 78ce3ab..7db04f9 100644 --- a/src/Network.h +++ b/src/Network.h @@ -30,6 +30,7 @@ namespace bayesnet { void addEdge(const string, const string); map& getNodes(); vector getFeatures(); + int getStates(); int getClassNumStates(); string getClassName(); void fit(const vector>&, const vector&, const vector&, const string&);