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