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