HAPI.Table Class Module

Startpage
Overview
Index
HAPI
   |
   HAPI.Table

Properties

CGSize() [[As Long]] (R)
Holds the CG size of the Table.
Data(lIndex As Long) [[As Single]] (RW)
Accesses the table data at specified index for a Table.
IndexFromConfiguration(configuration As Collection) [[as long]] (R)
The table index corresponding to a given state configuration.
Mean(lIndex As Long, ndCGNode As Node) [[As Double]] (R)
Returns the mean of one of the constituent continuous nodes of the distribution function represented by this Table given a configuration of the discrete nodes of the Table.
Size() [[As Long]] (R)
Holds the size of the Table (Data is indexed from 0 to Size - 1).
Variance(lIndex As Long, ndCGNode As Node) [[As Double]] (R)
Returns the variance of one of the constituent distribution functions represented by this Table given a configuration of the discrete nodes of the Table. There is one constituent distribution function for each continuous nodes.
nodes() [[As Collection]] (R)
Holds a collection of the nodes of the Table.

Sub Procedures

Delete()
Delete this Table.
ReorderNodes(colNewOrder As Collection)
Reorder the nodes of this table.

Functions

GetConfigurationFromIndex (lIndex as Long) as Collection
Computes the state configuration corresponding to a given table index.
GetCovariance(lIndex As Long, ndCGNode1 As Node, ndCGNode2 As Node) As Double
Returns the covariance of the two continuous argument nodes given a particular configuration of the discrete nodes of this Table.

Description

Table objects are used within Hugin to represent conditional probability tables and utility tables for individual nodes. It is also used to represent the distribution function of a set of nodes (both discrete and continuous).

The Data property is the most important property when we have a table defined over only discrete nodes. This property accesses a one-dimensional array holding values corresponding to configurations of the discrete nodes (a configuration of a set of discrete nodes (C_1,C_2,...,C_n) is a tuple (s_1,s_2,...,s_n) specifying a specific state for each node). You map the configuration to an index in the one-dimensional array like this:

index = s_1 * F(2) + s_2 * F(3) + ... + s_(n-1) * F(n) + s_n

where:

Example: If you have a table with three discrete nodes in this order: (C1,C2,C3) each having two states (indexed 0 and 1), Data-indexes will correspond to configurations as shown below:

IndexConfiguration
0(C_1=0, C_2=0, C_3=0)
1(C_1=0, C_2=0, C_3=1)
2(C_1=0, C_2=1, C_3=0)
3(C_1=0, C_2=1, C_3=1)
4(C_1=1, C_2=0, C_3=0)
5(C_1=1, C_2=0, C_3=1)
6(C_1=1, C_2=1, C_3=0)
7(C_1=1, C_2=1, C_3=1)
If there are also continuous nodes in a table, these are listed last in the Nodes property and this must always be the case (when changing the order with ReorderNodes). Mean and Variance are used to access the mean and variance for a specific continuous node.

If a Table object represents the conditional probability table of a discrete chance node or the utility table of a utility node, this node should always be listed last.

For continuous chance nodes, the only purpose of the Table object is to be able to reorder the table nodes. The index used in both Alpha, Beta, and Gamma depends on this order (NOT the order of the parents in the Parents property).


HUGIN Expert A/S, 2008 - comments to activex@hugin.com