• Manual
  • HAPI Namespace
Show / Hide Table of Contents
  • HAPI
    • AbsExpression
    • AddExpression
    • AggregateExpression
    • AndExpression
    • Attribute
    • BetaDistribution
    • BinomialDistribution
    • BooleanDCNode
    • BooleanDDNode
    • BooleanDFNode
    • BooleanExpression
    • CeilExpression
    • Class
    • ClassCollection
    • ClassList
    • ClassParseListener
    • Clique
    • CliqueList
    • CompositeExpression
    • ConstantExpression
    • ContinuousChanceNode
    • CosExpression
    • CoshExpression
    • DataSet
    • DefaultClassParseListener
    • DiscreteChanceNode
    • DiscreteDecisionNode
    • DiscreteFunctionNode
    • DiscreteNode
    • DistributionDistribution
    • DivideExpression
    • Domain
    • Domain.Equilibrium
    • Domain.EvidenceMode
    • Domain.TriangulationMethod
    • EqualsExpression
    • ExceptionArgumentNotAlive
    • ExceptionBadKBFormat
    • ExceptionBadKBPassword
    • ExceptionBadKBVersion
    • ExceptionCGEvidenceIncorporated
    • ExceptionCGLIMIDsNotSupported
    • ExceptionCaseStateTooLarge
    • ExceptionChainGraph
    • ExceptionCompressed
    • ExceptionComputationFailed
    • ExceptionCyclicFunctionalDependency
    • ExceptionCyclicInstanceHierarchy
    • ExceptionCyclicNetwork
    • ExceptionDemo
    • ExceptionDivisionByZero
    • ExceptionEnumeration
    • ExceptionError
    • ExceptionExpiredLicense
    • ExceptionFastRetraction
    • ExceptionFunctionalDependency
    • ExceptionHugin
    • ExceptionIO
    • ExceptionIllegalBinding
    • ExceptionInappropriateArguments
    • ExceptionInconsistencyOrUnderflow
    • ExceptionInsufficientStateRange
    • ExceptionInvalidEvidence
    • ExceptionInvalidExpression
    • ExceptionInvalidLicense
    • ExceptionInvalidName
    • ExceptionInvalidProbabilityPotential
    • ExceptionInvalidStateValues
    • ExceptionLocale
    • ExceptionLowDensity
    • ExceptionMemory
    • ExceptionNoEquilibrium
    • ExceptionNoValue
    • ExceptionNormalization
    • ExceptionNotCompiled
    • ExceptionObjectNotAlive
    • ExceptionOverflow
    • ExceptionParse
    • ExceptionRounding
    • ExceptionSizeTooLarge
    • ExceptionSyntax
    • ExceptionTableTooLarge
    • ExceptionTwice
    • ExceptionUsage
    • ExceptionZeroVariance
    • ExpExpression
    • ExponentialDistribution
    • Expression
    • Expression.Operator
    • ExpressionList
    • FloorExpression
    • FunctionNode
    • GammaDistribution
    • GeometricDistribution
    • GreaterThanExpression
    • GreaterThanOrEqualsExpression
    • IfExpression
    • InstanceNode
    • IntervalDCNode
    • IntervalDDNode
    • IntervalDFNode
    • JunctionTree
    • JunctionTreeList
    • LabelExpression
    • LabelledDCNode
    • LabelledDDNode
    • LabelledDFNode
    • LessThanExpression
    • LessThanOrEqualsExpression
    • Log10Expression
    • Log2Expression
    • LogExpression
    • LogNormalDistribution
    • MaxExpression
    • MinExpression
    • ModExpression
    • Model
    • MultiplyExpression
    • NegateExpression
    • NegativeBinomialDistribution
    • NetworkModel
    • NetworkModel.Constraint
    • Node
    • Node.Category
    • Node.Kind
    • NodeExpression
    • NodeList
    • NoisyOrDistribution
    • NormalDistribution
    • NotEqualsExpression
    • NotExpression
    • NumberExpression
    • NumberedDCNode
    • NumberedDDNode
    • NumberedDFNode
    • NumericDiscreteNode
    • OrExpression
    • PERTDistribution
    • ParseListener
    • PoissonDistribution
    • PowerExpression
    • ProbabilityExpression
    • QuantileExpression
    • SinExpression
    • SinhExpression
    • SqrtExpression
    • StateIndexExpression
    • SubtractExpression
    • Table
    • TanExpression
    • TanhExpression
    • TriangularDistribution
    • TruncateExpression
    • UniformDistribution
    • UtilityNode
    • VarianceExpression
    • WeibullDistribution

Class Domain

Instances of the Domain class represent Bayesian networks and influence diagrams in which you can propagate evidence and calculate updated beliefs and expected utilities.

Note: Return and argument types for methods in this class vary depending on the particular API DLL (x86/x64 platform, single/double precision) being used. Please read the section Using the Hugin C#/.NET Core/.NET 5/.NET 6 API.

Inheritance
object
NetworkModel
Domain
Implements
ICloneable
Inherited Members
NetworkModel.IsAlive()
NetworkModel.GetNodes()
NetworkModel.CloseLogFile()
NetworkModel.GenerateTables()
NetworkModel.GetAttributes()
NetworkModel.GetAttribute(string)
NetworkModel.GetFileName()
NetworkModel.OpenLogFile(string)
NetworkModel.OpenLogFile(string, bool)
NetworkModel.GetLogFile()
NetworkModel.GetNodeByName(string)
NetworkModel.GetNodeSize()
NetworkModel.SetNodeSize(Size)
NetworkModel.GetUserData()
NetworkModel.SetUserData(object)
NetworkModel.SetAttribute(string, string)
NetworkModel.SetAttributes(List<Attribute>)
NetworkModel.SaveAsNet(string)
NetworkModel.ToNetString()
NetworkModel.ParseNodes(string, ParseListener)
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: HAPI
Assembly: hugincs-9.7-netstandard2.0-x64.dll
Syntax
public class Domain : NetworkModel, ICloneable

Constructors

Domain()

Constructs a new empty Domain.

Declaration
public Domain()
Exceptions
Type Condition
ExceptionHugin

Domain(Class)

Constructs a runtime domain from a Class object.

Declaration
public Domain(Class cls)
Parameters
Type Name Description
Class cls

the Class object to instantiate.

Exceptions
Type Condition
ExceptionHugin

Domain(Class, ulong)

Constructs a DBN runtime domain from a Class object. The domain is formed by linking (through temporal clones) the specified number of instances (called time slices) of the class.

Declaration
public Domain(Class cls, ulong numberOfSlices)
Parameters
Type Name Description
Class cls

The Class object to instantiate.

ulong numberOfSlices

The number of time slices.

Remarks

Generic declaration: public Domain (Class cls, size_t numberOfSlices)

Exceptions
Type Condition
ExceptionHugin

Domain(string)

Constructs a domain by loading the corresponding Hugin Knowledge Base (HKB) file.

Declaration
public Domain(string hkbFileName)
Parameters
Type Name Description
string hkbFileName

the name of the HKB file.

Exceptions
Type Condition
ExceptionHugin

Domain(string, ParseListener)

Constructs a domain from a NET file or a NET description given as a string.

Declaration
public Domain(string netStringOrFileName, ParseListener parseListener)
Parameters
Type Name Description
string netStringOrFileName

a string containing a NET description or the name of a NET file

ParseListener parseListener

the ParseListener used for handling parse errors.

Exceptions
Type Condition
ExceptionHugin

Domain(string, string)

Constructs a domain by loading the corresponding Hugin Knowledge Base (HKB) file.

Declaration
public Domain(string hkbFileName, string password)
Parameters
Type Name Description
string hkbFileName

the name of the HKB file.

string password

a password needed to load the file.

Exceptions
Type Condition
ExceptionHugin

Methods

Adapt()

Adapts this Domain according to the evidence entered.

Declaration
public void Adapt()
Exceptions
Type Condition
ExceptionHugin

AdaptClassTablesUsingFractionalUpdate()

Adapts the tables of the nodes in the class with the evidence propagated in this runtime Domain.

Declaration
public void AdaptClassTablesUsingFractionalUpdate()
Remarks

This method must be called on a runtime domain. The evidence propagated in this domain is used to adapt the tables of the class from which this domain was created. The updated tables are copied back to the nodes of the runtime domain.

Exceptions
Type Condition
ExceptionHugin

AdaptClassTablesUsingOnlineEM(double)

Adapts (using the Online EM algorithm) the tables of the nodes in the class with the evidence propagated in this runtime Domain.

Declaration
public void AdaptClassTablesUsingOnlineEM(double alpha)
Parameters
Type Name Description
double alpha
Exceptions
Type Condition
ExceptionHugin

AddCases(DataSet)

Adds all rows of the data set to this Domain as cases.

Declaration
public void AddCases(DataSet dataSet)
Parameters
Type Name Description
DataSet dataSet

The specified dataset.

Exceptions
Type Condition
ExceptionHugin

AddCases(DataSet, ulong, ulong)

Adds the specified range of rows of the data set to this Domain as cases.

Declaration
public void AddCases(DataSet dataSet, ulong start, ulong count)
Parameters
Type Name Description
DataSet dataSet

The specified dataset.

ulong start

The index of the first row to transfer.

ulong count

The number of rows to transfer.

Remarks

Generic declaration: public void AddCases (DataSet dataSet, size_t start, size_t count)

Exceptions
Type Condition
ExceptionHugin

Approximate(double)

Removes "near-zero" probabilities from the clique probability tables.

Declaration
public double Approximate(double epsilon)
Parameters
Type Name Description
double epsilon

The threshold value. Maximal probability mass to eradicate from each clique.

Returns
Type Description
double

The probability mass remaining in the entire Domain, letting you know how much precision you have "lost". Note that this is not the same as 1 - e, as the e value is relative to each clique. Typically, the amount of probability mass removed will be somewhat larger than e.

Remarks

Removes "near-zero" probabilities from the clique probability tables. For each Clique in this domain, a value delta is computed such that the sum of all elements less than delta in the (discrete part) of the clique table is less than epsilon. These elements (less than delta) are then set to 0.

Exceptions
Type Condition
ExceptionHugin

CgEvidenceIsPropagated()

Returns true if the evidence on CG nodes has been propagated; otherwise, returns false.

Declaration
public bool CgEvidenceIsPropagated()
Returns
Type Description
bool
Exceptions
Type Condition
ExceptionHugin

Clone()

Clones this Domain.

Declaration
public object Clone()
Returns
Type Description
object
Exceptions
Type Condition
ExceptionHugin

Compile()

Compiles this Domain (which must not already be compiled).

Declaration
public void Compile()
Remarks

Compiles this Domain (which must not already be compiled). The default triangulation method is used, unless the Domain has already been triangulated (using Triangulate(TriangulationMethod) or Triangulate(NodeList)) in which case the given triangulation is used. The Domain must contain at least one chance or decision node.

Exceptions
Type Condition
ExceptionHugin

Compile(TriangulationMethod)

Compiles this Domain (which must not be compiled or triangulated already) using the given triangulation method.

Declaration
public void Compile(Domain.TriangulationMethod method)
Parameters
Type Name Description
Domain.TriangulationMethod method

the triangulation method used.

Remarks

Compiles this Domain (which must not be compiled or triangulated already) using the given triangulation method. The Domain must contain at least one chance or decision node.

Exceptions
Type Condition
ExceptionHugin

Compress()

Removes the zero entries from the clique and separator tables of the JunctionTrees in this Domain.

Declaration
public double Compress()
Returns
Type Description
double

A double value which indicates a measure of compression achieved. The measure should be less than 1, indicating that the compressed Domain requires less space than the uncompressed Domain. An output greater than 1 means that the "compressed" Domain requires more space than the uncompressed Domain.

Remarks

Compression can only be applied to (compiled) ordinary Bayesian networks. Continuous nodes are allowed, but compression only applies to configurations of states of the discrete nodes.

Exceptions
Type Condition
ExceptionHugin

ComputeDBNPredictions(ulong)

Computes predictions for numberOfTimePoints time slices beyond the current time window.

Declaration
public void ComputeDBNPredictions(ulong numberOfTimePoints)
Parameters
Type Name Description
ulong numberOfTimePoints

the number of time slices to compute predictions for.

Remarks

This Domain must have been produced by CreateDBNDomain(ulong), and it must have been triangulated using TriangulateDBN(TriangulationMethod). The predictions are accessed using GetPredictedBelief(ulong, ulong). GetPredictedMean(ulong). GetPredictedVariance(ulong). GetPredictedValue(ulong).

Generic declaration: public void ComputeDBNPredictions (size_t numberOfTimePoints)

Exceptions
Type Condition
ExceptionHugin

ComputeSensitivityData(NodeList, ulong[])

Computes the constants of the sensitivity functions for the specified output probabilities and all CPT parameters in the network.

Declaration
public void ComputeSensitivityData(NodeList nodes, ulong[] states)
Parameters
Type Name Description
NodeList nodes

The list of (output) nodes.

ulong[] states

A list of states of the nodes in the nodes list.

Remarks

The output probabilities are specified using a list of nodes and a list of corresponding states.

Generic declaration: public void ComputeSensitivityData (NodeList nodes, size_t[] states)

Exceptions
Type Condition
ExceptionHugin

Delete()

Delete this Domain object.

Declaration
public override void Delete()
Overrides
NetworkModel.Delete()
Exceptions
Type Condition
ExceptionHugin

EnterCase(ulong)

Enters a case as evidence.

Declaration
public void EnterCase(ulong caseIndex)
Parameters
Type Name Description
ulong caseIndex

The case to enter.

Remarks

Generic declaration: public void EnterCase (size_t caseIndex)

Exceptions
Type Condition
ExceptionHugin

EquilibriumIs(Equilibrium)

Tests for Equilibrium type.

Declaration
public bool EquilibriumIs(Domain.Equilibrium equilibrium)
Parameters
Type Name Description
Domain.Equilibrium equilibrium

The type of Equilibrium to test for.

Returns
Type Description
bool

Returns true if the equilibrium states of all JunctionTrees of this Domain are identical to equilibrium.

Exceptions
Type Condition
ExceptionHugin

EvidenceIsPropagated()

Tests if evidence has been propagated for this Domain.

Declaration
public bool EvidenceIsPropagated()
Returns
Type Description
bool

Returns true if it has; otherwise, returns false.

Exceptions
Type Condition
ExceptionHugin

EvidenceModeIs(EvidenceMode)

Tests for evidence mode.

Declaration
public bool EvidenceModeIs(Domain.EvidenceMode evidenceMode)
Parameters
Type Name Description
Domain.EvidenceMode evidenceMode

The type of EvidenceMode to test for.

Returns
Type Description
bool

Returns true if the equilibrium states of all JunctionTrees of this Domain could have been obtained through a propagation using evidenceMode as the evidence incorporation mode. Otherwise, returns false.

Exceptions
Type Condition
ExceptionHugin

EvidenceToPropagate()

Tests if evidence has been entered since the last propagation.

Declaration
public bool EvidenceToPropagate()
Returns
Type Description
bool

Returns true if it has; otherwise, returns false.

Exceptions
Type Condition
ExceptionHugin

FindMAPConfigurations(NodeList, double)

Finds all configurations of nodes with probability at least minProbability.

Declaration
public void FindMAPConfigurations(NodeList nodes, double minProbability)
Parameters
Type Name Description
NodeList nodes

A NodeList containing the DiscreteNodes for which to find configurations.

double minProbability

Configurations with a lower probability than this are ignored.

Remarks

This method uses a Monte Carlo algorithm to solve a generalized version of the maximum a posteriori (MAP) configuration problem: The MAP configuration problem is the problem of finding the most probable configuration of a set of nodes given evidence on some of the remaining nodes.

The results of this method are provided by GetNumberOfMAPConfigurations(), GetMAPConfiguration(ulong) and GetProbabilityOfMAPConfiguration(ulong).

This operation requires a compiled domain, and the junction tree potentials must be up to date with respect to the available evidence, tables, and models. In the current implementation, no evidence must be specified for the nodes in the nodes argument.

LIMID networks are not supported in the current implementation.

Exceptions
Type Condition
ExceptionHugin

FineTuneNBTables(Node)

Fine-tunes a Naive Bayes (NB) model using training data.

Declaration
public void FineTuneNBTables(Node target)
Parameters
Type Name Description
Node target

The class variable of the Naive Bayes model.

Remarks

The method makes small adjustments to the conditional probabilities of the attribute nodes in order to obtain more correct classifications. If these adjustments do not result in a better model, the original model is preserved.

The domain must represent a Naive Bayes model with initial conditional probability tables (for example, estimated using the EM algorithm). The network must contain only discrete chance nodes. Case data must be specified in advance.

Exceptions
Type Condition
ExceptionHugin

GetAIC()

Computes the AIC score (Akaike's Information Criterion) of the case data.

Declaration
public double GetAIC()
Returns
Type Description
double
Exceptions
Type Condition
ExceptionHugin

GetApproximationConstant()

Returns the approximation constant.

Declaration
public double GetApproximationConstant()
Returns
Type Description
double

A double expressing the probability mass remaining in the approximated domain.

Remarks

The number returned is based on the most recent (explicit or implicit) approximation operation. An implicit approximation takes place when you change some conditional probability tables of acompressed domain, and then perform a propagation operation. Since some (discrete) state configurations have been removed from a compressed domain, the probability mass of the remaining configurations will typically be less than 1. This probability mass is returned by GetApproximationConstant().

Exceptions
Type Condition
ExceptionHugin

GetBIC()

Computes the BIC score (Bayesian Information Criterion) of the case data.

Declaration
public double GetBIC()
Returns
Type Description
double
Exceptions
Type Condition
ExceptionHugin

GetCaseCount(ulong)

Returns case count for a case.

Declaration
public float GetCaseCount(ulong caseIndex)
Parameters
Type Name Description
ulong caseIndex

The case for which to get the count.

Returns
Type Description
float

The multiplicity of case c.

Remarks

Generic declaration: public h_number_t GetCaseCount (size_t caseIndex)

Exceptions
Type Condition
ExceptionHugin

GetConcurrencyLevel()

Gets the current level of concurrency.

Declaration
public ulong GetConcurrencyLevel()
Returns
Type Description
ulong

The current level of concurrency.

Remarks

Generic declaration: public size_t GetConcurrencyLevel ()

Exceptions
Type Condition
ExceptionHugin

GetConflict()

Returns the conflict value.

Declaration
public double GetConflict()
Returns
Type Description
double

A double-precision real value expressing the conflict measure in the domain.

Remarks

The conflict value is valid for this Domain computed during the most recent propagation. If no propagation has been performed, 1 is returned.

Exceptions
Type Condition
ExceptionHugin

GetDBNWindowOffset()

Returns the total number of time steps that the time window of this DBN runtime domain has been moved.

Declaration
public ulong GetDBNWindowOffset()
Returns
Type Description
ulong
Remarks

Generic declaration: public size_t GetDBNWindowOffset ()

Exceptions
Type Condition
ExceptionHugin

GetDConnectedNodes(NodeList, NodeList)

Performs a d-separation test and returns a list of d-connected nodes.

Declaration
public NodeList GetDConnectedNodes(NodeList source, NodeList hard)
Parameters
Type Name Description
NodeList source

List of source nodes.

NodeList hard

List of nodes assumed to be instantiated.

Returns
Type Description
NodeList

The list of d-connected nodes.

Remarks

Performs a d-separation test and returns a list of d-connected nodes. Assuming evidence on the specified evidence nodes, this method returns the list of nodes that are d-connected to the specified list of source nodes.

Exceptions
Type Condition
ExceptionHugin

GetDConnectedNodes(NodeList, NodeList, NodeList)

Performs a d-separation test and returns a list of d-connected nodes.

Declaration
public NodeList GetDConnectedNodes(NodeList source, NodeList hard, NodeList soft)
Parameters
Type Name Description
NodeList source

List of source nodes.

NodeList hard

List of nodes assumed to be instantiated.

NodeList soft

List of nodes assumed to have multi-state or likelihood evidence.

Returns
Type Description
NodeList

The list of d-connected nodes.

Remarks

Performs a d-separation test and returns a list of d-connected nodes. Assuming evidence on the specified evidence nodes, this method returns the list of nodes that are d-connected to the specified list of source nodes.

Exceptions
Type Condition
ExceptionHugin

GetDSeparatedNodes(NodeList, NodeList)

Performs a d-separation test and returns a list of d-separated nodes.

Declaration
public NodeList GetDSeparatedNodes(NodeList source, NodeList hard)
Parameters
Type Name Description
NodeList source

List of source nodes.

NodeList hard

List of nodes assumed to be instantiated.

Returns
Type Description
NodeList

The list of d-separated nodes.

Remarks

Performs a d-separation test and returns a list of d-separated nodes. Assuming evidence on the specified evidence nodes, this method returns the list of nodes that are d-separated to the specified list of source nodes.

Exceptions
Type Condition
ExceptionHugin

GetDSeparatedNodes(NodeList, NodeList, NodeList)

Performs a d-separation test and returns a list of d-separated nodes.

Declaration
public NodeList GetDSeparatedNodes(NodeList source, NodeList hard, NodeList soft)
Parameters
Type Name Description
NodeList source

List of source nodes.

NodeList hard

List of nodes assumed to be instantiated.

NodeList soft

List of nodes assumed to have multi-state or likelihood evidence.

Returns
Type Description
NodeList

The list of d-separated nodes.

Remarks

Performs a d-separation test and returns a list of d-separated nodes. Assuming evidence on the specified evidence nodes, this method returns the list of nodes that are d-separated to the specified list of source nodes.

Exceptions
Type Condition
ExceptionHugin

GetEMConcurrencyLevel()

Returns the number of threads to be created by the EM algorithm.

Declaration
public ulong GetEMConcurrencyLevel()
Returns
Type Description
ulong

The current level of concurrency.

Remarks

Generic declaration: public size_t GetEMConcurrencyLevel ()

Exceptions
Type Condition
ExceptionHugin

GetEliminationOrder()

Returns the triangulation order.

Declaration
public NodeList GetEliminationOrder()
Returns
Type Description
NodeList

A NodeList containing Nodes representing the elimination order used.

Exceptions
Type Condition
ExceptionHugin

GetExpectedUtility()

Returns the total expected utility associated with this Domain.

Declaration
public float GetExpectedUtility()
Returns
Type Description
float

Total expected utility associated with this Domain.

Remarks

Generic declaration: public h_number_t GetExpectedUtility ()

Exceptions
Type Condition
ExceptionHugin

GetExplanation(ulong)

Returns the explanation subset with rank rank computed by the most recent call to ComputeExplanationData(ulong, DiscreteNode, ulong, ulong).

Declaration
public NodeList GetExplanation(ulong rank)
Parameters
Type Name Description
ulong rank

Specifies that the rankth best explanation should be retrieved (the best explanation has rank 0, the second best has rank 1, etc.).

Returns
Type Description
NodeList

Explanation subset.

Remarks

Generic declaration: public NodeList GetExplanation (size_t rank)

Exceptions
Type Condition
ExceptionHugin

GetExplanationScore(ulong)

Returns the explanation score of the specified evidence subset.

Declaration
public float GetExplanationScore(ulong index)
Parameters
Type Name Description
ulong index

The index of the subset.

Returns
Type Description
float

The likelihood ratio of the specified subset.

Remarks

This method returns the likelihood ratio of the subset returned by GetExplanation(ulong).

Generic declaration: public h_number_t GetExplanationScore (size_t index)

Exceptions
Type Condition
ExceptionHugin

GetGrainSize()

Returns the current value of the grain size parameter.

Declaration
public ulong GetGrainSize()
Returns
Type Description
ulong

The current value of the grain size parameter.

Remarks

Generic declaration: public size_t GetGrainSize ()

Exceptions
Type Condition
ExceptionHugin

GetJunctionTrees()

Returns the JunctionTrees of this Domain.

Declaration
public JunctionTreeList GetJunctionTrees()
Returns
Type Description
JunctionTreeList

A JunctionTreeList.

Exceptions
Type Condition
ExceptionHugin

GetLogLikelihood()

Computes the log-likelihood of the case data.

Declaration
public double GetLogLikelihood()
Returns
Type Description
double
Exceptions
Type Condition
ExceptionHugin

GetLogLikelihoodTolerance()

Returns the log-likelihood tolerance for this Domain.

Declaration
public double GetLogLikelihoodTolerance()
Returns
Type Description
double
Exceptions
Type Condition
ExceptionHugin

GetLogNormalizationConstant()

Returns the log of the normalization constant.

Declaration
public double GetLogNormalizationConstant()
Returns
Type Description
double
Exceptions
Type Condition
ExceptionHugin

GetMAPConfiguration(ulong)

Returns one of the MAP configurations.

Declaration
public ulong[] GetMAPConfiguration(ulong index)
Parameters
Type Name Description
ulong index

Specifies the desired configuration.

Returns
Type Description
ulong[]

An array of state indexes forming the configuration.

Remarks

This method returns one of the configurations computed by the most recent call to FindMAPConfigurations(NodeList, double). The argument index (a nonnegative integer less than count, where count is the number of configurations found) specifies the desired configuration. 0 requests the most probable configuration, 1 the second-most probable configuration, etc.

Generic declaration: public size_t[] GetMAPConfiguration (size_t index)

Exceptions
Type Condition
ExceptionHugin

GetMarginal(NodeList)

Computes the marginal distribution for the Nodes provided as argument with respect to the (imaginary) joint potential, determined by the current potentials on the JunctionTree(s) of this Domain.

Declaration
public Table GetMarginal(NodeList nodes)
Parameters
Type Name Description
NodeList nodes

A NodeList containing the Nodes over which to compute the marginal.

Returns
Type Description
Table

A Table containing the marginal distribution over the Nodes in nodes.

Remarks

If nodes contains continuous nodes, they must be last in the list. This operation is not allowed on compressed Domains.

Exceptions
Type Condition
ExceptionHugin

GetMaxNumberOfEMIterations()

Returns the maximum number of iterations allowed for the EM algorithm.

Declaration
public ulong GetMaxNumberOfEMIterations()
Returns
Type Description
ulong
Remarks

Generic declaration: public size_t GetMaxNumberOfEMIterations ()

Exceptions
Type Condition
ExceptionHugin

GetMaxNumberOfSeparators()

Returns the maximum number of separators allowed when using the H_TM_TOTAL_WEIGHT triangulation method.

Declaration
public ulong GetMaxNumberOfSeparators()
Returns
Type Description
ulong
Remarks

Generic declaration: public size_t GetMaxNumberOfSeparators ()

Exceptions
Type Condition
ExceptionHugin

GetMaxSeparatorSize()

Returns the maximum separator size allowed when using the H_TM_TOTAL_WEIGHT triangulation method.

Declaration
public ulong GetMaxSeparatorSize()
Returns
Type Description
ulong
Remarks

Generic declaration: public size_t GetMaxSeparatorSize ()

Exceptions
Type Condition
ExceptionHugin

GetNBFineTuneIterationsLimit()

Returns the limit for the number of consecutive failed iterations of the Naive Bayes (NB) fine-tuning algorithm.

Declaration
public ulong GetNBFineTuneIterationsLimit()
Returns
Type Description
ulong
Remarks

Generic declaration: public size_t GetNBFineTuneIterationsLimit ()

Exceptions
Type Condition
ExceptionHugin

GetNBFineTuneLearningRate()

Returns the learning rate of the Naive Bayes (NB) fine-tuning algorithm.

Declaration
public double GetNBFineTuneLearningRate()
Returns
Type Description
double
Remarks

The default value is 0.01.

Exceptions
Type Condition
ExceptionHugin

GetNormalDeviate(double, double)

Use the pseudo-random number generator for this Domain to sample a real number from a normal (aka Gaussian) distribution.

Declaration
public double GetNormalDeviate(double mean, double variance)
Parameters
Type Name Description
double mean

The mean of the distribution.

double variance

The variance of the distribution.

Returns
Type Description
double
Exceptions
Type Condition
ExceptionHugin

GetNormalizationConstant()

Retrieves the normalization constant for the most recent propagation.

Declaration
public double GetNormalizationConstant()
Returns
Type Description
double

A double-precision real number.

Remarks

For sum-propagation, the normalization constant is equal to the probability of the evidence propagated. For max-propagation, the normalization constant is the probability of the most probable configuration with the evidence incorporated.

Exceptions
Type Condition
ExceptionHugin

GetNumberOfCases()

Returns the number of data cases.

Declaration
public ulong GetNumberOfCases()
Returns
Type Description
ulong
Remarks

Generic declaration: public size_t GetNumberOfCases ()

Exceptions
Type Condition
ExceptionHugin

GetNumberOfExplanations()

Returns the number of evidence subsets.

Declaration
public ulong GetNumberOfExplanations()
Returns
Type Description
ulong

The number of evidence subsets.

Remarks

This method returns the number of subsets found by the most recent successful call to ComputeExplanationData(ulong, DiscreteNode, ulong, ulong).

Generic declaration: public size_t GetNumberOfExplanations ()

Exceptions
Type Condition
ExceptionHugin

GetNumberOfMAPConfigurations()

Returns the number of MAP configurations.

Declaration
public ulong GetNumberOfMAPConfigurations()
Returns
Type Description
ulong

The number of MAP configurations found by the most recent call to FindMAPConfigurations(NodeList, double).

Remarks

Generic declaration: public size_t GetNumberOfMAPConfigurations ()

Exceptions
Type Condition
ExceptionHugin

GetProbabilityOfMAPConfiguration(ulong)

Returns the probability of the specified MAP configuration.

Declaration
public double GetProbabilityOfMAPConfiguration(ulong index)
Parameters
Type Name Description
ulong index

Specifies the desired configuration.

Returns
Type Description
double

Probability of the specified configuration.

Remarks

This method returns the probability of one of the configurations computed by a previous call to FindMAPConfigurations(NodeList, double). The argument index (a nonnegative integer less than count, where count is the number of configurations found) specifies the desired configuration. 0 requests the probability of the most probable configuration, 1 the probability of the second-most probable configuration, etc.

Generic declaration: public double GetProbabilityOfMAPConfiguration (size_t index)

Exceptions
Type Condition
ExceptionHugin

GetSensitivitySet()

Returns the sensitivity set computed by the most recent call to ComputeSensitivityData(ulong).

Declaration
public NodeList GetSensitivitySet()
Returns
Type Description
NodeList
Remarks

If the results produced by that call have been invalidated, a usage exception is thrown.

Exceptions
Type Condition
ExceptionHugin

GetSensitivitySet(ulong)

Returns the sensitivity set computed by the most recent call to ComputeSensitivityData(ulong).

Declaration
public NodeList GetSensitivitySet(ulong output)
Parameters
Type Name Description
ulong output

Identifies one of the output probabilities specified in the call to ComputeSensitivityData(ulong).

Returns
Type Description
NodeList
Remarks

If the results produced by that call have been invalidated, a usage exception is thrown.

Generic declaration: public NodeList GetSensitivitySet (size_t output)

Exceptions
Type Condition
ExceptionHugin

GetSignificanceLevel()

Returns the significance level of the dependency tests performed during structure learning using the PC-algorithm. The default value is 0.05.

Declaration
public double GetSignificanceLevel()
Returns
Type Description
double

A positive real number.

Exceptions
Type Condition
ExceptionHugin

GetUniformDeviate()

Use the pseudo-random number generator for this Domain to sample a real number from the uniform distribution over the interval [0,1).

Declaration
public double GetUniformDeviate()
Returns
Type Description
double
Exceptions
Type Condition
ExceptionHugin

Initialize()

Establishes the initial values for all tables of this Domain (which must be compiled).

Declaration
public void Initialize()
Remarks

This method erases all evidence previously entered.

Exceptions
Type Condition
ExceptionHugin

InitializeDBNWindow()

Moves the time window of this DBN back to its initial position, and removes all evidence.

Declaration
public void InitializeDBNWindow()
Remarks

This Domain must have been produced by CreateDBNDomain(ulong), and it must have been triangulated using TriangulateDBN(TriangulationMethod).

Exceptions
Type Condition
ExceptionHugin

IsCompiled()

Tests whether this Domain is compiled.

Declaration
public bool IsCompiled()
Returns
Type Description
bool

Returns true if it is; otherwise, returns false.

Exceptions
Type Condition
ExceptionHugin

IsCompressed()

Tests whether this Domain is compressed.

Declaration
public bool IsCompressed()
Returns
Type Description
bool

Returns true if it is; otherwise, returns false.

Exceptions
Type Condition
ExceptionHugin

IsTriangulated()

Tests whether this Domain is triangulated.

Declaration
public bool IsTriangulated()
Returns
Type Description
bool
Remarks

Being "triangulated" means that the junction forest has been created, but not the associated tables.

Exceptions
Type Condition
ExceptionHugin

IsTriangulatedForBK()

Tests whether this Domain is triangulated for Boyen-Koller approximate inference. That is, has this Domain been triangulated using TriangulateDBNForBK(TriangulationMethod).

Declaration
public bool IsTriangulatedForBK()
Returns
Type Description
bool
Exceptions
Type Condition
ExceptionHugin

LearnClassTables()

Learns the conditional probability tables of the class nodes, from which the domain is created, from data using the EM algorithm.

Declaration
public void LearnClassTables()
Exceptions
Type Condition
ExceptionHugin

LearnHNBStructure(Node)

Learns a Hierarchical Naive Bayes (HNB) model from data.

Declaration
public void LearnHNBStructure(Node target)
Parameters
Type Name Description
Node target

The class variable of the HNB model.

Remarks

The domain must contain only chance nodes (but continuous nodes are ignored by the HNB algorithm) and no edges. The target variable must be a discrete node. Case data must be specified in advance.

Exceptions
Type Condition
ExceptionHugin

LearnStructure()

Learn the structure (graph) of the Bayesian network from data using the PC algorithm.

Declaration
public void LearnStructure()
Remarks

The domain must contain only chance nodes and no edges. Case data must be specified in advance.

Exceptions
Type Condition
ExceptionHugin

LearnTables()

Learns the conditional probability tables from data using the EM algorithm.

Declaration
public void LearnTables()
Exceptions
Type Condition
ExceptionHugin

LearnTreeStructure()

Learns a tree-structured network model from data. This method uses the Rebane-Pearl algorithm for learning a polytree model.

Declaration
public void LearnTreeStructure()
Remarks

The domain must contain only discrete chance nodes and no edges. Case data must be specified in advance.

Exceptions
Type Condition
ExceptionHugin

LearnTreeStructure(Node)

Learns a tree-structured network model from data. This method uses the Chow-Liu algorithm for learning a tree model with all edges directed away from root.

Declaration
public void LearnTreeStructure(Node root)
Parameters
Type Name Description
Node root

all edges of the tree will be directed away from root.

Remarks

The domain must contain only chance nodes and no edges. Case data must be specified in advance.

Exceptions
Type Condition
ExceptionHugin

LearnTreeStructure(Node, Node)

Learns a tree-structured network model from data. This method constructs a Tree-Augmented Naive (TAN) Bayes model for classification.

Declaration
public void LearnTreeStructure(Node root, Node target)
Parameters
Type Name Description
Node root

All edges of the Chow-Liu tree will be directed away from root.

Node target

The class variable of the TAN model.

Remarks

First, a Chow-Liu tree model with root as root is learned. This tree is turned into a TAN model by adding target as parent of all other nodes of this Domain.

The domain must contain only chance nodes and no edges. Case data must be specified in advance.

Exceptions
Type Condition
ExceptionHugin

MoveDBNWindow(ulong)

Slides the time window of this DBN delta steps into the future.

Declaration
public void MoveDBNWindow(ulong delta)
Parameters
Type Name Description
ulong delta

The number of time steps to slide the time window.

Remarks

This Domain must have been produced by CreateDBNDomain(ulong), and it must have been triangulated using TriangulateDBN(TriangulationMethod).

Generic declaration: public void MoveDBNWindow (size_t delta)

Exceptions
Type Condition
ExceptionHugin

NewCase()

Creates a new case.

Declaration
public ulong NewCase()
Returns
Type Description
ulong

The case index of the new case.

Remarks

Generic declaration: public size_t NewCase ()

Exceptions
Type Condition
ExceptionHugin

ParseCase(string, ParseListener)

Parses the case stored in file fileName and enters the associated findings into this Domain.

Declaration
public void ParseCase(string fileName, ParseListener parseListener)
Parameters
Type Name Description
string fileName

The name of the file containing the case.

ParseListener parseListener

The ParseListener used for handling parse errors.

Remarks

All existing evidence in the Domain is retracted before entering the case findings.

Exceptions
Type Condition
ExceptionHugin

ParseCases(string, ParseListener)

Parses the cases stored in file fileName and enters the cases into this Domain.

Declaration
public void ParseCases(string fileName, ParseListener parseListener)
Parameters
Type Name Description
string fileName

The name of the file containing the cases.

ParseListener parseListener

The ParseListener used for handling parse errors.

Exceptions
Type Condition
ExceptionHugin

Propagate(Equilibrium, EvidenceMode)

Establishes the specified equilibrium using the evidence mode indicated for incorporation of evidence on all JunctionTrees of this Domain.

Declaration
public void Propagate(Domain.Equilibrium equilibrium = Equilibrium.H_EQUILIBRIUM_SUM, Domain.EvidenceMode evidenceMode = EvidenceMode.H_EVIDENCE_MODE_NORMAL)
Parameters
Type Name Description
Domain.Equilibrium equilibrium

Equilibrium type. The normal Equilibrium type is H_EQUILIBRIUM_SUM.

Domain.EvidenceMode evidenceMode

EvidenceMode type. The normal EvidenceMode type is H_EVIDENCE_MODE_NORMAL.

Remarks

Also, revised beliefs will be computed for all nodes.

Exceptions
Type Condition
ExceptionHugin

ResetInferenceEngine()

Establishes the initial state of the inference engine, which is sum-equilibrium with no evidence incorporated.

Declaration
public void ResetInferenceEngine()
Remarks

Any propagated evidence will thus be removed from the JunctionTree potentials, but entered evidence will still be "registered" (i.e., they will be incorporated in the next propagation).

Exceptions
Type Condition
ExceptionHugin

RetractFindings()

Retracts (all) evidence for all nodes in this Domain.

Declaration
public void RetractFindings()
Exceptions
Type Condition
ExceptionHugin

SaveAsKB(string)

Saves this Domain as a Hugin Knowledge Base (HKB) to a file.

Declaration
public void SaveAsKB(string fileName)
Parameters
Type Name Description
string fileName

The name of the file to which the HKB is saved.

Remarks

The HKB file will not be password protected. If the Domain is compiled, it can only be saved if the current equilibrium equals H_EQUILIBRIUM_SUM, and the current evidence incorporation mode equals H_EVIDENCE_MODE_NORMAL.

Exceptions
Type Condition
ExceptionHugin

SaveAsKB(string, string)

Saves this Domain as a Hugin Knowledge Base (HKB) to a file.

Declaration
public void SaveAsKB(string fileName, string password)
Parameters
Type Name Description
string fileName

The name of the file to which the HKB is saved.

string password

Which, if non-null, will be needed upon reloading the file.

Remarks

If password is non-null, the file will be password protected. This password will have to be used whenever the file is to be reloaded. If the Domain is compiled, it can only be saved if the current equilibrium equals H_EQUILIBRIUM_SUM, and the current evidence incorporation mode equals H_EVIDENCE_MODE_NORMAL.

Exceptions
Type Condition
ExceptionHugin

SaveCase(string)

Saves all evidence entered in this Domain in file fileName (if the file exists, it is overwritten).

Declaration
public void SaveCase(string fileName)
Parameters
Type Name Description
string fileName

The name of the file in which the case is going to be saved.

Exceptions
Type Condition
ExceptionHugin

SaveCases(string, NodeList, ulong[], bool, string, string)

Saves all cases entered in this Domain in a file with the given file name (if the file exists, it is overwritten).

Declaration
public void SaveCases(string fileName, NodeList nodes, ulong[] cases, bool caseCounts, string separator, string missingData)
Parameters
Type Name Description
string fileName

The name of the file in which the case is going to be saved.

NodeList nodes

A list of all nodes which are to be included in the file.

ulong[] cases

A boolean array specifying for each case whether the case is to be included in the file. Giving null will include all cases.

bool caseCounts

If true, include case counts in the data file. If false>, only include case counts if they are present in the domain.

string separator

The string used to separate the items in the file.

string missingData

The string used to represent missing data.

Remarks

Generic declaration: public void SaveCases (String fileName, NodeList nodes, size_t[] cases, bool caseCounts, String separator, String missingData)

Exceptions
Type Condition
ExceptionHugin

SaveToMemory()

Creates a copy in memory of the belief and JunctionTree tables of this Domain (which must be compiled).

Declaration
public void SaveToMemory()
Remarks

This operation can only be performed if the current equilibrium equals H_EQUILIBRIUM_SUM, the current evidence mode equals H_EVIDENCE_MODE_NORMAL, and no CG evidence has been incorporated.

Exceptions
Type Condition
ExceptionHugin

SeedRandom(uint)

Seeds the pseudo-random number generator for this Domain.

Declaration
public void SeedRandom(uint seed)
Parameters
Type Name Description
uint seed

The seed value.

Remarks

The configurations generated by simulate are not really random. They are generated using a pseudo-random number generator producing a sequence of numbers that although it appears random is actually completely deterministic. To change the starting point for the generator, use this method.

Exceptions
Type Condition
ExceptionHugin

SetCaseCount(ulong, float)

Sets case count for a case.

Declaration
public void SetCaseCount(ulong caseIndex, float caseCount)
Parameters
Type Name Description
ulong caseIndex

The case for which to set the count.

float caseCount

The multiplicity of caseIndex.

Remarks

Generic declaration: public void SetCaseCount (size_t caseIndex, h_number_t caseCount)

Exceptions
Type Condition
ExceptionHugin

SetConcurrencyLevel(ulong)

Sets the level of concurrency.

Declaration
public void SetConcurrencyLevel(ulong level)
Parameters
Type Name Description
ulong level

the level of concurrency.

Remarks

The level of concurrency specifies the maximum number of threads to create when performing a specific table operation. Setting the level of concurrency to 1 will cause all table operations to be performed sequentially. The initial parameter value is 1.

Generic declaration: public void SetConcurrencyLevel (size_t level)

Exceptions
Type Condition
ExceptionHugin

SetEMConcurrencyLevel(ulong)

Sets the number of threads to be created by the EM algorithm.

Declaration
public void SetEMConcurrencyLevel(ulong level)
Parameters
Type Name Description
ulong level

the level of concurrency.

Remarks

The EM algorithm exploits concurrency by partitioning the set of cases into subsets of approximately equal size. Each subset is then processed by a thread that has a copy of the (compiled) domain, enabling the threads to perform inference in parallel. Setting this parameter to 1 causes the EM algorithm to execute single-threaded. The initial value of this parameter is 1.

Generic declaration: public void SetEMConcurrencyLevel (size_t level)

Exceptions
Type Condition
ExceptionHugin

SetGrainSize(ulong)

Sets the grain size parameter.

Declaration
public void SetGrainSize(ulong size)
Parameters
Type Name Description
ulong size

The grain size.

Remarks

The grain size parameter specifies a lower limit of the tasks to be performed by each thread. The size of a task is approximately equal to the number of floating-point operations needed to perform the task (e.g., the number of elements to sum when performing a marginalization task).

Generic declaration: public void SetGrainSize (size_t size)

Exceptions
Type Condition
ExceptionHugin

SetIJTNodes(NodeList)

Specify the set of nodes to be instantiated when using the IJT (Instantiated Junction Trees) algorithm.

Declaration
public void SetIJTNodes(NodeList IJTnodes)
Parameters
Type Name Description
NodeList IJTnodes

a NodeList containing the IJT nodes.

Remarks

Specify the set of nodes to be instantiated when using the IJT (Instantiated Junction Trees) algorithm.

Exceptions
Type Condition
ExceptionHugin

SetInitialTriangulation(NodeList)

Sets an initial triangulation for this Domain.

Declaration
public void SetInitialTriangulation(NodeList order)
Parameters
Type Name Description
NodeList order

List of nodes of the network in the order of elimination.

Remarks

This triangulation is used by the H_TM_TOTAL_WEIGHT triangulation method. The purpose is to (1) improve the generated triangulation, and (2) to reduce the run-time of the algorithm. The triangulation must be specified in the form of an elimination sequence.

Exceptions
Type Condition
ExceptionHugin

SetLogLikelihoodTolerance(double)

Sets the log-likelihood tolerance for this Domain.

Declaration
public void SetLogLikelihoodTolerance(double tolerance)
Parameters
Type Name Description
double tolerance
Exceptions
Type Condition
ExceptionHugin

SetMaxNumberOfEMIterations(ulong)

Sets the maximum number of iterations allowed for the EM algorithm.

Declaration
public void SetMaxNumberOfEMIterations(ulong count)
Parameters
Type Name Description
ulong count
Remarks

Generic declaration: public void SetMaxNumberOfEMIterations (size_t count)

Exceptions
Type Condition
ExceptionHugin

SetMaxNumberOfSeparators(ulong)

Sets the maximum number of separators allowed when using the H_TM_TOTAL_WEIGHT triangulation method.

Declaration
public void SetMaxNumberOfSeparators(ulong count)
Parameters
Type Name Description
ulong count
Remarks

Generic declaration: public void SetMaxNumberOfSeparators (size_t count)

Exceptions
Type Condition
ExceptionHugin

SetMaxSeparatorSize(ulong)

Sets the maximum separator size for the H_TM_TOTAL_WEIGHT triangulation method.

Declaration
public void SetMaxSeparatorSize(ulong size)
Parameters
Type Name Description
ulong size
Remarks

If a positive maximum separator size is specified, then separators larger than the specified size will be discarded by the separator generation algorithm. However, separators implied by the initial triangulation will be retained (regardless of size). This feature can be used to triangulate much larger graphs (without splitting them into smaller subgraphs). But notice that not all separators up to the specified limit are necessarily generated.

An initial triangulation is required in order to use this feature, see SetInitialTriangulation(NodeList). If zero is specified for the maximum separator size, then no separators will be discarded.

Generic declaration: public void SetMaxSeparatorSize (size_t size)

Exceptions
Type Condition
ExceptionHugin

SetNBFineTuneIterationsLimit(ulong)

Sets the limit for the number of consecutive failed iterations of the Naive Bayes (NB) fine-tuning algorithm.

Declaration
public void SetNBFineTuneIterationsLimit(ulong limit)
Parameters
Type Name Description
ulong limit

A positive integer.

Remarks

When limit iterations over the training data, showing no improvements of the classification accuracy, have been performed, the algorithm terminates.

The default value is 1.

Generic declaration: public void SetNBFineTuneIterationsLimit (size_t limit)

Exceptions
Type Condition
ExceptionHugin

SetNBFineTuneLearningRate(double)

Sets the learning rate of the Naive Bayes (NB) fine-tuning algorithm.

Declaration
public void SetNBFineTuneLearningRate(double learningRate)
Parameters
Type Name Description
double learningRate

A number between 0 and 1.

Remarks

The default value is 0.01.

Exceptions
Type Condition
ExceptionHugin

SetNumberOfCases(ulong)

Sets the number of cases.

Declaration
public void SetNumberOfCases(ulong count)
Parameters
Type Name Description
ulong count
Remarks

Generic declaration: public void SetNumberOfCases (size_t count)

Exceptions
Type Condition
ExceptionHugin

SetSignificanceLevel(double)

Sets the significance level of the dependency tests performed during structure learning using the PC-algorithm.

Declaration
public void SetSignificanceLevel(double probability)
Parameters
Type Name Description
double probability

The significance level.

Remarks

The default value is 0.05.

Exceptions
Type Condition
ExceptionHugin

Simulate()

If the domain is compiled, generates a sample configuration from the joint distribution represented by the JunctionTree(s) of this Domain - else if the domain is not compiled generates a sample configuration determined by the tables associated with the nodes of the domain.

Declaration
public void Simulate()
Remarks

Given evidence, we may be interested in generating (sampling) configurations (i.e., vectors of values over the set of variables in the network) with respect to the conditional distribution for the evidence. If the Domain is compiled, a configuration is sampled with respect to the current distribution represented by the JunctionTree(s). This distribution must be in sum-equilibrium with evidence incorporated in normal mode.

If domain is not compiled, sample a configuration with respect to the distribution determined by the tables associated with the nodes of domain. All uninstantiated chance and decision nodes must have valid tables, and the set of nodes with evidence must form an ancestral set of instantiated nodes (i.e., no likelihood evidence, and if a chance node is instantiated, so are all of its parents). Tables that are not up-to-date with respect to their models are not regenerated.

Exceptions
Type Condition
ExceptionHugin

TablesToPropagate()

Tests for new node tables.

Declaration
public bool TablesToPropagate()
Returns
Type Description
bool

Returns true if there are any nodes in this Domain having (a conditional probability or utility) table that has changed since the most recent compilation or propagation; otherwise, returns false.

Exceptions
Type Condition
ExceptionHugin

Triangulate()

Transforms the graph of this Domain into a triangulated graph.

Declaration
public void Triangulate()
Remarks

Triangulates the graph of this Domain using the default triangulation method (which is the H_TM_FILL_IN_WEIGHT triangulation method).

Exceptions
Type Condition
ExceptionHugin

Triangulate(TriangulationMethod)

Transforms the graph of this Domain into a triangulated graph.

Declaration
public void Triangulate(Domain.TriangulationMethod method)
Parameters
Type Name Description
Domain.TriangulationMethod method

the TriangulationMethod to use.

Exceptions
Type Condition
ExceptionHugin

Triangulate(NodeList)

Transforms a network into a triangulated graph using a specified elimination order.

Declaration
public void Triangulate(NodeList order)
Parameters
Type Name Description
NodeList order

a NodeList containing the Nodes of the network in the order of elimination.

Remarks

Triangulates the graph of this Domain using the specified elimination order. The elimination order must contain each chance and decision node of this Domain exactly once, and continuous nodes must appear before discrete nodes.

Exceptions
Type Condition
ExceptionHugin

TriangulateDBN(TriangulationMethod)

Triangulates a Domain produced by CreateDBNDomain(ulong) such that MoveDBNWindow(ulong) can be used.

Declaration
public void TriangulateDBN(Domain.TriangulationMethod method)
Parameters
Type Name Description
Domain.TriangulationMethod method

The TriangulationMethod used.

Exceptions
Type Condition
ExceptionHugin

TriangulateDBNForBK(TriangulationMethod)

Triangulates a Domain produced by CreateDBNDomain(ulong) such that MoveDBNWindow(ulong) can be used. Boyen-Koller approximations between time slices within the window are applied.

Declaration
public void TriangulateDBNForBK(Domain.TriangulationMethod method)
Parameters
Type Name Description
Domain.TriangulationMethod method

The TriangulationMethod used.

Exceptions
Type Condition
ExceptionHugin

Uncompile()

Uncompiles this Domain.

Declaration
public void Uncompile()
Remarks

Removes the data structures of the Domain that were produced by Compile(), Triangulate(TriangulationMethod), and Triangulate(NodeList). Note that references to objects within the compiled structure (e.g., Cliques and JunctionTrees) are invalidated by a call to Uncompile(). Also note that many of the editing functions automatically performs an Uncompile() operation. When this happens, the domain must be compiled (using Compile() or Compile(TriangulationMethod)) before it can be used for inference.

Exceptions
Type Condition
ExceptionHugin

UpdatePolicies()

Updates the policy tables of the domain.

Declaration
public void UpdatePolicies()
Remarks

The policies of all unmade decisions are updated. The new policies maximize the overall expected utility.

Exceptions
Type Condition
ExceptionHugin

Implements

ICloneable
In this article
Back to top Copyright (C) 2019-2025 Hugin Expert A/S