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

Instances of the Class class represent object-oriented Bayesian networks and influence diagrams.

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
Class
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 Class : NetworkModel
Remarks

Instances of the Class class represent object-oriented Bayesian networks and influence diagrams. Such an instance can contain nodes representing instances of other network classes and so on. To use an instance (i.e., propagate evidence and calculate updated beliefs and expected utilities), it must first be unfolded to a plain Bayesian network or influence diagram. The CreateDomain() method handles this.

Constructors

Class(ClassCollection)

Constructs a new Class in a ClassCollection.

Declaration
public Class(ClassCollection cc)
Parameters
Type Name Description
ClassCollection cc

the ClassCollection in which to add the new Class.

Exceptions
Type Condition
ExceptionHugin

Class(ClassCollection, string)

Constructs a new named Class in a ClassCollection.

Declaration
public Class(ClassCollection cc, string name)
Parameters
Type Name Description
ClassCollection cc

the ClassCollection in which to add the new Class.

string name

the name of the new Class.

Exceptions
Type Condition
ExceptionHugin

Methods

CreateDBNDomain(ulong)

Creates a DBN runtime domain from this 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 CreateDBNDomain(ulong numberOfSlices)
Parameters
Type Name Description
ulong numberOfSlices

The number of time slices.

Returns
Type Description
Domain

A Domain represented the unfolded object-oriented network represented by this Class.

Remarks

Please note that the Nodes of the created Domain do not have names. This implies that GetNodeByName(string) returns null. It is the responsibility of the application programmer to set the names these nodes. One obvious way of doing that would be to compose the names from the names of the Nodes returned by the GetSource() method.

Generic declaration: public Domain CreateDBNDomain (size_t numberOfSlices)

Exceptions
Type Condition
ExceptionHugin

CreateDomain()

Unfolds the Class to a Domain that can be compiled and used for inference, etc.

Declaration
public Domain CreateDomain()
Returns
Type Description
Domain

A Domain representing the unfolded object-oriented network represented by this Class.

Remarks

Please note that the Nodes of the created Domain do not have names. This implies that GetNodeByName(string) returns null. It is the responsibility of the application programmer to set the names these nodes. One obvious way of doing that would be to compose the names from the names of the Nodes returned by the GetSource() method.

Exceptions
Type Condition
ExceptionHugin

Delete()

Deletes this Class, including all Nodes belonging to it.

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

GetClassCollection()

Returns the ClassCollection to which this Class belongs.

Declaration
public ClassCollection GetClassCollection()
Returns
Type Description
ClassCollection

The ClassCollection to which this Class belongs.

Exceptions
Type Condition
ExceptionHugin

GetInputs()

Returns a list of the input nodes defined for this Class.

Declaration
public NodeList GetInputs()
Returns
Type Description
NodeList

A NodeList containing the input nodes of this Class.

Exceptions
Type Condition
ExceptionHugin

GetInstances()

Returns the list of InstanceNodes that are instances of this Class.

Declaration
public NodeList GetInstances()
Returns
Type Description
NodeList

A NodeList of InstanceNodes.

Exceptions
Type Condition
ExceptionHugin

GetName()

Returns the name of this Class.

Declaration
public string GetName()
Returns
Type Description
string
Exceptions
Type Condition
ExceptionHugin

GetOutputs()

Returns a list of the output nodes defined for this Class.

Declaration
public NodeList GetOutputs()
Returns
Type Description
NodeList

A NodeList containing the output nodes of this Class.

Exceptions
Type Condition
ExceptionHugin

SetName(string)

Sets the name of this Class.

Declaration
public void SetName(string name)
Parameters
Type Name Description
string name
Exceptions
Type Condition
ExceptionHugin
In this article
Back to top Copyright (C) 2019-2025 Hugin Expert A/S