Add some tests

This commit is contained in:
2023-07-18 13:44:08 +02:00
parent 57dab6d709
commit 1a21015492
6 changed files with 86 additions and 55 deletions

View File

@@ -21,6 +21,9 @@ namespace bayesnet {
}
void Network::addNode(string name, int numStates)
{
if (find(features.begin(), features.end(), name) == features.end()) {
features.push_back(name);
}
if (nodes.find(name) != nodes.end()) {
// if node exists update its number of states
nodes[name]->setNumStates(numStates);