AIMA.Core.Probability.BayesNet.markovBlanket C# (CSharp) Метод

markovBlanket() приватный Метод

private markovBlanket ( BayesNetNode node, List soFar ) : List
node BayesNetNode
soFar List
Результат List
        private List<BayesNetNode> markovBlanket(BayesNetNode node,
                List<BayesNetNode> soFar)
        {
            // parents
            List<BayesNetNode> parents = node.getParents();
            foreach (BayesNetNode parent in parents)
            {
                if (!soFar.Contains(parent))
                {
                    soFar.Add(parent);
                }
            }
            // children
            List<BayesNetNode> children = node.getChildren();
            foreach (BayesNetNode child in children)
            {
                if (!soFar.Contains(child))
                {
                    soFar.Add(child);
                    List<BayesNetNode> childsParents = child.getParents();
                    foreach (BayesNetNode childsParent in childsParents)
                    {
                        ;
                        if ((!soFar.Contains(childsParent))
                                && (!(childsParent.Equals(node))))
                        {
                            soFar.Add(childsParent);
                        }
                    }// childsParents
                }// end contains child

            }// end child

            return soFar;
        }

Same methods

BayesNet::markovBlanket ( BayesNetNode node ) : List