• 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 Model

A Model is a compact description of a table. A model consists of a list of discrete nodes and a set of expressions (one expression per configuration of states of the nodes).

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
Model
Inherited Members
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 Model

Constructors

Model(Node, NodeList)

Constructs a model for a node given a list of Nodes.

Declaration
public Model(Node belongsTo, NodeList modelNodes)
Parameters
Type Name Description
Node belongsTo
NodeList modelNodes
Exceptions
Type Condition
ExceptionHugin

Methods

Delete()

Deletes this Model.

Declaration
public void Delete()
Exceptions
Type Condition
ExceptionHugin

GetExpression(ulong)

Returns the Expression associated with a pecific configuration of the Nodes of this Model.

Declaration
public Expression GetExpression(ulong index)
Parameters
Type Name Description
ulong index
Returns
Type Description
Expression
Remarks

Generic declaration: public Expression GetExpression (size_t index)

Exceptions
Type Condition
ExceptionHugin

GetNodes()

Returns a NodeList conxbtaining the Nodes in this Model.

Declaration
public NodeList GetNodes()
Returns
Type Description
NodeList
Exceptions
Type Condition
ExceptionHugin

GetNumberOfSamplesPerInterval()

Returns the number of values per interval used when generating the conditional probability table for a node with interval parents.

Declaration
public ulong GetNumberOfSamplesPerInterval()
Returns
Type Description
ulong

The number of values per interval.

Remarks

Generic declaration: public size_t GetNumberOfSamplesPerInterval ()

Exceptions
Type Condition
ExceptionHugin

GetSize()

Returns the number of configurations of the Nodes of this Model.

Declaration
public ulong GetSize()
Returns
Type Description
ulong
Remarks

Generic declaration: public size_t GetSize ()

Exceptions
Type Condition
ExceptionHugin

IsAlive()

Is this Model object alive?

Declaration
public bool IsAlive()
Returns
Type Description
bool

SetExpression(ulong, Expression)

Associates an Expression with a specific configuration of the Nodes of this Model.

Declaration
public void SetExpression(ulong index, Expression expression)
Parameters
Type Name Description
ulong index
Expression expression
Remarks

Generic declaration: public void SetExpression (size_t index, Expression expression)

Exceptions
Type Condition
ExceptionHugin

SetExpression(ulong, string, ParseListener)

Associates an expression (specified as a String) with a specific configuration of the Nodes of this Model.

Declaration
public void SetExpression(ulong index, string expression, ParseListener parseListener)
Parameters
Type Name Description
ulong index
string expression
ParseListener parseListener
Remarks

Generic declaration: public void SetExpression (size_t index, String expression, ParseListener parseListener)

Exceptions
Type Condition
ExceptionHugin

SetNumberOfSamplesPerInterval(ulong)

Sets the number of values taken within each bounded interval of an interval parent when generating the conditional probability table for a node with interval parents.

Declaration
public void SetNumberOfSamplesPerInterval(ulong count)
Parameters
Type Name Description
ulong count

The number of subintervals.

Remarks

When generating the conditional probability table for a node with interval nodes as parents, a number of values are taken within each bounded interval of an interval parent. By default, the interval is divided into 25 subintervals, and the midpoints of these subintervals are then used in the computation of the value of the child.

Generic declaration: public void SetNumberOfSamplesPerInterval (size_t count)

Exceptions
Type Condition
ExceptionHugin
In this article
Back to top Copyright (C) 2019-2025 Hugin Expert A/S