• 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
    • ExceptionCaseStateTooLarge
    • ExceptionCGEvidenceIncorporated
    • ExceptionCGLIMIDsNotSupported
    • ExceptionChainGraph
    • ExceptionCompressed
    • ExceptionComputationFailed
    • ExceptionCyclicFunctionalDependency
    • ExceptionCyclicInstanceHierarchy
    • ExceptionCyclicNetwork
    • ExceptionDemo
    • ExceptionDivisionByZero
    • ExceptionEnumeration
    • ExceptionError
    • ExceptionExpiredLicense
    • ExceptionFastRetraction
    • ExceptionFunctionalDependency
    • ExceptionHugin
    • ExceptionIllegalBinding
    • ExceptionInappropriateArguments
    • ExceptionInconsistencyOrUnderflow
    • ExceptionInsufficientStateRange
    • ExceptionInvalidEvidence
    • ExceptionInvalidExpression
    • ExceptionInvalidLicense
    • ExceptionInvalidName
    • ExceptionInvalidProbabilityPotential
    • ExceptionInvalidStateValues
    • ExceptionIO
    • ExceptionLocale
    • ExceptionLowDensity
    • ExceptionMemory
    • ExceptionNoEquilibrium
    • ExceptionNormalization
    • ExceptionNotCompiled
    • ExceptionNoValue
    • 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
    • Model
    • ModExpression
    • MultiplyExpression
    • NegateExpression
    • NegativeBinomialDistribution
    • NetworkModel
    • NetworkModel.Constraint
    • Node
    • Node.Category
    • Node.Kind
    • NodeExpression
    • NodeList
    • NoisyOrDistribution
    • NormalDistribution
    • NotEqualsExpression
    • NotExpression
    • NumberedDCNode
    • NumberedDDNode
    • NumberedDFNode
    • NumberExpression
    • NumericDiscreteNode
    • OrExpression
    • ParseListener
    • PERTDistribution
    • PoissonDistribution
    • PowerExpression
    • ProbabilityExpression
    • SinExpression
    • SinhExpression
    • SqrtExpression
    • StateIndexExpression
    • SubtractExpression
    • Table
    • TanExpression
    • TanhExpression
    • TriangularDistribution
    • TruncateExpression
    • UniformDistribution
    • UtilityNode
    • VarianceExpression
    • WeibullDistribution

Class ClassCollection

Classes are grouped into ClassCollections.

Inheritance
object
ClassCollection
Inherited Members
object.GetType()
object.MemberwiseClone()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: HAPI
Assembly: hugincs-9.4-netstandard2.0-x64.dll
Syntax
public class ClassCollection
Remarks

Each class must belong to exactly one ClassCollection. A ClassCollection can be considered a closed world of interdependent Classes (i.e., Bayesian networks and influence diagrams). That is, each Class may contain instances of other Classes of the ClassCollection, but not of Classes of other ClassCollections.

Different operations are supported for ClassCollections:
  • Creation and deletion
  • Addition of Class objects specified in NET files
  • Saving to a NET file
  • Retrieval of the list of Class objects
  • Retrieval of a Class object by its name

Constructors

ClassCollection()

Constructs a new (empty) ClassCollection.

Declaration
public ClassCollection()
Exceptions
Type Condition
ExceptionHugin

ClassCollection(string, string)

Constructs a class collection by loading the corresponding Hugin Knowledge Base (HKB) file. The HKB file must contain a class collection.

Declaration
public ClassCollection(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

ClassCollection(string)

Constructs a class collection by loading the corresponding Hugin Knowledge Base (HKB) file. The HKB file must contain a class collection.

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

the name of the HKB file.

Exceptions
Type Condition
ExceptionHugin

Methods

Delete()

Deletes this ClassCollection and all its Classs.

Declaration
public void Delete()
Exceptions
Type Condition
ExceptionHugin

GetClassByName(string)

Returns the Class of this ClassCollection that has the given name. If no such class exists, null is returned.

Declaration
public Class GetClassByName(string name)
Parameters
Type Name Description
string name

A string representing the name of a Class.

Returns
Type Description
Class
Exceptions
Type Condition
ExceptionHugin

GetMembers()

Returns a ClassList containing the Class members of this ClassCollection.

Declaration
public ClassList GetMembers()
Returns
Type Description
ClassList
Exceptions
Type Condition
ExceptionHugin

IsAlive()

Is this ClassCollection object alive?

Declaration
public bool IsAlive()
Returns
Type Description
bool

ParseClasses(string, ClassParseListener)

Constructs one or more classes from a NET file or a NET description given as a string.

Declaration
public void ParseClasses(string netStringOrFileName, ClassParseListener parseListener)
Parameters
Type Name Description
string netStringOrFileName

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

ClassParseListener parseListener

a ClassParseListener.

Exceptions
Type Condition
ExceptionHugin

ParseClasses(string)

Constructs one or more classes from a NET file or a NET description given as a string.

Declaration
public void ParseClasses(string netStringOrFileName)
Parameters
Type Name Description
string netStringOrFileName

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

Remarks

This method uses a DefaultClassParseListener.

Exceptions
Type Condition
ExceptionHugin

SaveAsKB(string, string)

Saves this ClassCollection 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.

Exceptions
Type Condition
ExceptionHugin

SaveAsKB(string)

Saves this ClassCollection 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.

Exceptions
Type Condition
ExceptionHugin

SaveAsNet(string)

Writes a NET description of the ClassCollection to a file.

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

a string containing the name of the file.

Exceptions
Type Condition
ExceptionHugin

ToNetString()

Creates a NET description of this ClassCollection.

Declaration
public string ToNetString()
Returns
Type Description
string

A string containing the NET description.

Exceptions
Type Condition
ExceptionHugin

ToString()

Returns a String of names of the member Classes of this ClassCollection.

Declaration
public string ToString()
Returns
Type Description
string
Exceptions
Type Condition
ExceptionHugin
In This Article
Back to top Copyright (C) 2019-2023 Hugin Expert A/S