Represents a node with one or more variables in a Bayesian network.

Namespace:  BayesServer
Assembly:  BayesServer (in BayesServer.dll)
Version: 2.2.0.0 (2.2.0.0)

Syntax

C#
public sealed class Node
Visual Basic (Declaration)
Public NotInheritable Class Node
Visual C++
public ref class Node sealed

Remarks

Note that node names must be unique per network, and are case sensitive.

To specify a distribution for a node, see the Distribution property.

To add a directed link between two nodes, it must be added through the Links property.

Examples

CopyC#
using System;
using System.Collections.Generic;
using System.Text;

namespace BayesServer.HelpSamples
{
    public static class NodeExample
    {
        public static void Main()
        {
            Network network = new Network();

            // the following examples show different ways to construct a new Node

            Variable variableA = new Variable("a");
            Node nodeA = new Node(variableA);
            variableA.States.Add(new State("True"));
            variableA.States.Add(new State("False"));

            network.Nodes.Add(nodeA);

            Node nodeB = new Node("b", 2);    // this automatically creates a variable for you
            Variable variableB = nodeB.Variables[0];
            variableB.States[0].Name = "True";
            variableB.States[1].Name = "False";

            network.Nodes.Add(nodeB);

            Node c = new Node("c", 2);
            network.Nodes.Add(c);

            Node d = new Node("d", new string[] { "True", "False" });
            network.Nodes.Add(d);

        }
    }
}

Inheritance Hierarchy

System..::.Object
  BayesServer..::.Node

See Also