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

InstanceNodes are the key building block of object-oriented Bayesian networks and influence diagrams.

Inheritance
object
Node
InstanceNode
Implements
ICloneable
Inherited Members
Node.IsAlive()
Node.Delete()
Node.SetName(string)
Node.GetName()
Node.AddParent(Node)
Node.AddToInputs()
Node.AddToOutputs()
Node.Clone()
Node.EvidenceIsEntered()
Node.EvidenceIsPropagated()
Node.EvidenceToPropagate()
Node.GetAttribute(string)
Node.GetAttributes()
Node.GetChildren()
Node.GetEdgeConstraint(Node)
Node.GetHome()
Node.GetHomeClass()
Node.GetHomeDomain()
Node.GetInstance()
Node.GetJunctionTree()
Node.GetLabel()
Node.GetMaster()
Node.GetParents()
Node.GetPosition()
Node.SetPosition(Point)
Node.GetUserData()
Node.SetUserData(object)
Node.GetSource()
Node.LikelihoodIsEntered()
Node.LikelihoodIsPropagated()
Node.RemoveFromInputs()
Node.RemoveFromOutputs()
Node.RemoveParent(Node)
Node.ReverseEdge(Node)
Node.SetAttribute(string, string)
Node.SetAttributes(List<Attribute>)
Node.SetEdgeConstraint(Node, NetworkModel.Constraint)
Node.SetLabel(string)
Node.SwitchParent(Node, Node)
Node.GetModel()
Node.GetTable()
Node.CreateTemporalClone()
Node.GetTemporalClone()
Node.GetTemporalMaster()
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 InstanceNode : Node, ICloneable
Remarks

An InstanceNode represents an instance of a Class (i.e., a Bayesian network or an influence diagram). In other words, an instance node represents a subnetwork. The Class of which InstanceNodes exist in other Classes can itself contain InstanceNodes, whereby an object-oriented network can be viewed as a hierarchical description of a problem domain. Describing a network in a hierarchical fashion often makes the network much less cluttered, and thus provides a much better means of communicating ideas among knowledge engineers and users.

As systems often are composed of collections of identical or similar components, models of systems often contain repetitive patterns. The notion of InstanceNodes makes it very easy to construct multiple identical instances of a network fragment.

An InstanceNode is connected to other nodes via its interface nodes, which are the input Nodes and the output Nodes of the Class of which the InstanceNode is an instance. Chance nodes and decision nodes of the encapsulating Class (i.e., network) as well as output nodes of InstanceNodes of the encapsulating Class can be bound to input nodes of an InstanceNode.

As the output nodes of an InstanceNode can be parents of non-InstanceNodes, these output nodes are represented in the "home Class" of the InstanceNode as clones of the output nodes of the "instance Class" of the InstanceNode. Therefore, the output nodes of InstanceNodes are sometimes referred to as "output clones".

Constructors

InstanceNode(Class, Class)

Constructs a new InstanceNode. The InstanceNode is an instance of Class 'instanceOf' and is added to Class 'home'.

Declaration
public InstanceNode(Class home, Class instanceOf)
Parameters
Type Name Description
Class home

the home Class of the new InstanceNode.

Class instanceOf

the Class from which to instantiate the new InstanceNode.

Exceptions
Type Condition
ExceptionHugin

Methods

GetCategory()

Returns the Category of this Node.

Declaration
public override Node.Category GetCategory()
Returns
Type Description
Node.Category

H_CATEGORY_INSTANCE

Overrides
Node.GetCategory()

GetInput(Node)

Returns the actual input node bound to a formal input node for this InstanceNode.

Declaration
public Node GetInput(Node formalInput)
Parameters
Type Name Description
Node formalInput

The formal input node of this InstanceNode.

Returns
Type Description
Node

The actual input - the node bound to formalInput.

Remarks

If there is no actual input to which the given formal input is bound, null is returned.

Exceptions
Type Condition
ExceptionHugin

GetInstanceClass()

Returns the instance Class of this InstanceNode (i.e., the Class on which this InstanceNode is based).

Declaration
public Class GetInstanceClass()
Returns
Type Description
Class
Exceptions
Type Condition
ExceptionHugin

GetKind()

Returns the Kind of this Node.

Declaration
public override Node.Kind GetKind()
Returns
Type Description
Node.Kind

H_KIND_DISCRETE

Overrides
Node.GetKind()

GetOutput(Node)

Returns the output node of this InstanceNode that is a clone of a given output node of the Class from which this InstanceNode has been instantiated.

Declaration
public Node GetOutput(Node output)
Parameters
Type Name Description
Node output

the output node of the Class from which this InstanceNode has been instantiated.

Returns
Type Description
Node
Exceptions
Type Condition
ExceptionHugin

GetOutputs()

Returns the output nodes (i.e., output clones) of this InstanceNode.

Declaration
public NodeList GetOutputs()
Returns
Type Description
NodeList

NodeList containing the output Nodes of this InstanceNode.

Exceptions
Type Condition
ExceptionHugin

SetInput(Node, Node)

Binds a node to an input node of this InstanceNode.

Declaration
public void SetInput(Node formalInput, Node actualInput)
Parameters
Type Name Description
Node formalInput

the formal input node of this InstanceNode. This node is to be considered a placeholder for the 'actualInput'.

Node actualInput

the actual input node to be bound to 'formalInput'. This node must belong to the same Class as this InstanceNode.

Exceptions
Type Condition
ExceptionHugin

SubstituteClass(Class)

Replace the class that this instance node represents.

Declaration
public void SubstituteClass(Class newClass)
Parameters
Type Name Description
Class newClass

The class that the instance node should represent.

Remarks

The node itself is not deleted during this operation, nor are the input and output nodes. However, new output nodes may be created.

This operation is only allowed, if the interface of the original class is a subset of the interface of the given newClass argument.
Exceptions
Type Condition
ExceptionHugin

UnsetInput(Node)

Unbinds an input node of this InstanceNode.

Declaration
public void UnsetInput(Node formalInput)
Parameters
Type Name Description
Node formalInput

the input node to become unbound.

Exceptions
Type Condition
ExceptionHugin

Implements

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