You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get a NullPointerException for the following line of MessagePassingAlgorithm::SetEFModel: node.setParents(node.getPDist().getConditioningVariables().stream().map(this::getNodeOfVar).collect(Collectors.toList()));
It looks like the issue is with the call to map(). The getNodeOfVar() function is iterating over this.variablesToNode. But should this map() call be iterating over variablesToNode instead?
Thanks!
The text was updated successfully, but these errors were encountered:
In the code you send, you create an unconnected DAG. You have to specify the links by adding nodes to the parent sets of each node. For that, use the methods DAG::getParentSet(Variable var) and ParentSet::addParent(Variable var). In the link below you have an example of DAG definition.
When defining the the DAG, make sure that it has no cycles and all the nodes are connected.
Another problem that I see in your code, is that you try to build a BN over 9 nodes but you only specify 3 probability distributions. When you call the constructor new BayesianNetwork(modelDAG, modelConditionalDistributions), the list modelConditionalDistributions should contain a distribution for each node in the DAG. As you are working with discrete domains, for nodes without parents you define an object of class Multinomial. For nodes with parents, use Multinomial_MultinomialParents instead.
Let me know if fixing these problems your code works.
I'm using version 0.6.
I get a NullPointerException for the following line of MessagePassingAlgorithm::SetEFModel:
node.setParents(node.getPDist().getConditioningVariables().stream().map(this::getNodeOfVar).collect(Collectors.toList()));
It looks like the issue is with the call to map(). The getNodeOfVar() function is iterating over this.variablesToNode. But should this map() call be iterating over variablesToNode instead?
Thanks!
The text was updated successfully, but these errors were encountered: