class CBNSNetwork

This class is the public interface class that should be used by the programmer to create the network

Public Fields

static int m_nCounter
This variable is used to check for the memory leak in the program

Public Methods

void PrintNodeProbabilities ()
Prints the node probabilities to the console
void PrintProbability ()
Prints the functional form of the Joint probability distribution of the network to the console

Public

Constructors and Destructor
CBNSNetwork ()
Default Construtor
CBNSNetwork (const CBNSNetwork& net)
Copy Constructor
CBNSNetwork (const string &xbn_network_file)
Network created from a file
~CBNSNetwork ()
Destructor
Out Functions
int GetNumberOfNodes ()
Returns the number of nodes in the network
int GetNumberOfLinks ()
Returns the number of links in the network
string GetFileName () const
Returns the name of the file from which the network is built
CBNSNode* GetNode (int index)
Returns a pointer to the node, this function should actually take the name of the node as a parameter instead of index
CBNSSet <CBNSNode*> & GetNodes ()
Returns the Set of nodes in the network
CBNSSet <CBNSLink*> & GetLinks ()
Returns the Set of links in the network
Network from files
void Load (const string &domain_file)
Loads the network from the domain_file
void Create ()
Creates the network ???
void Save (const string &file_name)
Saves the network to a file
Network Functions
void Init ()
Initializes the network
void Compile ()
Compiles the network
void UnCompile ()
Uncompiles the network
bool IsCompiled ()
Returns true if the network is compiled
bool IsPropagated ()
Returns true if the network is propagated
bool NeedsPropagation ()
Returns true if the network needs propagated
bool IsLink (CBNSNode *pNode1, CBNSNode *pNode2)
Returns true if a link exists between pNode1 and pNode2
bool IsSingleNetwork ()
Returns false if the network is a forest
bool IsDAG ()
Returns true if the network is a Directed Acyclic Graph
void Initialize ()
Initializes the network
void AddNode (CBNSNode* pNode)
Adds a node to the network
void RemoveNode (CBNSNode* pNode)
Removes a node from the network
void AddLink (CBNSLink* link, bool bUpdateNodeTable = true)
Adds a link to the network and updates the node tables connected to the link if bUpdateNodeTable is true
void RemoveLink (CBNSLink* link, bool bUpdateNodeTable = true)
Removes a link from the network and updates the node tables connected to the link if bUpdateNodeTable is true
void UpdateTablesSize ()
Updates teh Table sizes of the nodes
void SetEvidence (CBNSNode* pNode, int nStateIndex)
Sets the Evidence for a Node to a particular state
void Propagate (eBNSPropagationMethod method = PROPAGATION_DEFAULT)
Propagates the Evidence
Junction Tree Functions
void CreateJunctionTree ()
Creates the Junction Tree
void SetJunctionTree (CBNSJunctionTree &cJunctionTree)
Sets the Junction Tree to cJunctionTree
CBNSJunctionTree GetJunctionTree ()
Returns the Junction Tree
Overloaded Operators
CBNSNetwork& operator= (const CBNSNetwork& net)
Assignment operator
Friend Functions
friend ostream& operator << (ostream& o, CBNSNetwork &nw)
Stream insertion operator

Private

Private Member Variables
bool m_bIsCompiled
This variable is true if the network is compiled
bool m_bInitialized
This variable is true if the network is initialized
bool m_bNeedsPropagation
This variable is true if the network needs propagation
CBNSJunctionTree m_cJunctionTree
Junction Tree
CBNSSet <CBNSNode*> m_cNodesSet
Set of Nodes
CBNSSet <CBNSLink*> m_cLinksSet
Set of Links

Documentation

This class is the public interface class that should be used by the programmer to create the network. The nodes and links are added to the network, and this class creates the junction tree for the given set of nodes and links after compilation.
static int m_nCounter
This variable is used to check for the memory leak in the program

Constructors and Destructor

CBNSNetwork()
Default Construtor

CBNSNetwork(const CBNSNetwork& net)
Copy Constructor
Parameters:
net - a reference to CBNSNetwork object

CBNSNetwork(const string &xbn_network_file)
Network created from a file
Parameters:
xbn_network_file - the name of the file

~CBNSNetwork()
Destructor

Out Functions

int GetNumberOfNodes()
Returns the number of nodes in the network
Returns:
int

int GetNumberOfLinks()
Returns the number of links in the network
Returns:
int

string GetFileName() const
Returns the name of the file from which the network is built
Returns:
string

CBNSNode* GetNode(int index)
Returns a pointer to the node, this function should actually take the name of the node as a parameter instead of index
Returns:
CBNSNode*
Parameters:
index - index of the node

CBNSSet <CBNSNode*> & GetNodes()
Returns the Set of nodes in the network
Returns:
reference to CBNSSet

CBNSSet <CBNSLink*> & GetLinks()
Returns the Set of links in the network
Returns:
reference to CBNSSet

Network from files

void Load(const string &domain_file)
Loads the network from the domain_file
Parameters:
domain_file - name of the file

void Create()
Creates the network ???

void Save(const string &file_name)
Saves the network to a file
Parameters:
file_name - name of the file

Network Functions

void Init()
Initializes the network

void Compile()
Compiles the network

void UnCompile()
Uncompiles the network

bool IsCompiled()
Returns true if the network is compiled
Returns:
bool

bool IsPropagated()
Returns true if the network is propagated
Returns:
bool

bool NeedsPropagation()
Returns true if the network needs propagated
Returns:
bool

bool IsLink(CBNSNode *pNode1, CBNSNode *pNode2)
Returns true if a link exists between pNode1 and pNode2
Returns:
bool
Parameters:
pNode1 - a pointer to CBNSNode
pNode2 - a pointer to CBNSNode

bool IsSingleNetwork()
Returns false if the network is a forest
Returns:
bool

bool IsDAG()
Returns true if the network is a Directed Acyclic Graph
Returns:
bool

void Initialize()
Initializes the network

void AddNode(CBNSNode* pNode)
Adds a node to the network
Parameters:
pNode - a pointer to CBNSNode object

void RemoveNode(CBNSNode* pNode)
Removes a node from the network
Parameters:
pNode - a pointer to CBNSNode object

void AddLink(CBNSLink* link, bool bUpdateNodeTable = true)
Adds a link to the network and updates the node tables connected to the link if bUpdateNodeTable is true
Parameters:
pLink - a pointer to CBNSLink object
bUpdateNodeTable - updates the table of the child node of the link

void RemoveLink(CBNSLink* link, bool bUpdateNodeTable = true)
Removes a link from the network and updates the node tables connected to the link if bUpdateNodeTable is true
Parameters:
pLink - a pointer to CBNSLink object
bUpdateNodeTable - updates the table of the child node of the link

void UpdateTablesSize()
Updates teh Table sizes of the nodes

void SetEvidence(CBNSNode* pNode, int nStateIndex)
Sets the Evidence for a Node to a particular state
Parameters:
pNode - a pointer to a node for which the evidence is set
nStateIndex - the probability of state nStateIndex is set to 1

void Propagate(eBNSPropagationMethod method = PROPAGATION_DEFAULT)
Propagates the Evidence
Parameters:
method - a default propagation scheme is used now, further implementation should include other propagation schemes

Junction Tree Functions

void CreateJunctionTree()
Creates the Junction Tree

void SetJunctionTree(CBNSJunctionTree &cJunctionTree)
Sets the Junction Tree to cJunctionTree
Parameters:
cJunctionTree - a reference to a CBNSJunctionTree object

CBNSJunctionTree GetJunctionTree()
Returns the Junction Tree
Returns:
CBNSJunctionTree

void PrintNodeProbabilities()
Prints the node probabilities to the console

void PrintProbability()
Prints the functional form of the Joint probability distribution of the network to the console

Overloaded Operators

CBNSNetwork& operator=(const CBNSNetwork& net)
Assignment operator
Parameters:
net - a reference to CBNSNetwork object

Friend Functions

friend ostream& operator << (ostream& o, CBNSNetwork &nw)
Stream insertion operator
Parameters:
o - reference to ostream object
nw - reference to CBNSNetwork object

Private Member Variables

bool m_bIsCompiled
This variable is true if the network is compiled

bool m_bInitialized
This variable is true if the network is initialized

bool m_bNeedsPropagation
This variable is true if the network needs propagation

CBNSJunctionTree m_cJunctionTree
Junction Tree

CBNSSet <CBNSNode*> m_cNodesSet
Set of Nodes

CBNSSet <CBNSLink*> m_cLinksSet
Set of Links


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de