COM.hugin.HAPI
Class Model

java.lang.Object
  extended by COM.hugin.HAPI.Model

public class Model
extends java.lang.Object

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.


Constructor Summary
Model(Node belongsTo, NodeList modelNodes)
          Constructs a Model for a Node given a list of Nodes.
 
Method Summary
 void delete()
          Deletes this Model.
 Expression getExpression(long index)
          Returns the Expression associated with a specific configuration of the Nodes of this Model.
 NodeList getNodes()
          Returns a NodeList containing the Nodes in this Model.
 long getNumberOfSamplesPerInterval()
          Returns the number of values per interval used when generating the conditional probability table for a node with interval parents.
 long getSize()
          Returns the number of configurations of the Nodes of this Model.
 java.lang.Object getUserData()
          Returns the value stored within the user data slot of this Model.
 boolean isAlive()
          Is this Model object alive?
 void setExpression(long index, Expression expression)
          Associates an Expression with a specific configuration of the Nodes of this Model.
 void setExpression(long index, java.lang.String expression, ParseListener parseListener)
          Associates an expression (specified as a String) with a specific configuration of the Nodes of this Model.
 void setNumberOfSamplesPerInterval(long count)
          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.
 void setUserData(java.lang.Object data)
          Sets the user data field of this Model.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Model

public Model(Node belongsTo,
             NodeList modelNodes)
      throws ExceptionHugin
Constructs a Model for a Node given a list of Nodes.

Throws:
ExceptionHugin
Method Detail

delete

public void delete()
            throws ExceptionHugin
Deletes this Model.

Throws:
ExceptionHugin

getNodes

public NodeList getNodes()
                  throws ExceptionHugin
Returns a NodeList containing the Nodes in this Model.

Throws:
ExceptionHugin

getSize

public long getSize()
             throws ExceptionHugin
Returns the number of configurations of the Nodes of this Model.

Throws:
ExceptionHugin

setExpression

public void setExpression(long index,
                          Expression expression)
                   throws ExceptionHugin
Associates an Expression with a specific configuration of the Nodes of this Model.

Throws:
ExceptionHugin

setExpression

public void setExpression(long index,
                          java.lang.String expression,
                          ParseListener parseListener)
                   throws ExceptionHugin
Associates an expression (specified as a String) with a specific configuration of the Nodes of this Model.

Throws:
ExceptionHugin

getExpression

public Expression getExpression(long index)
                         throws ExceptionHugin
Returns the Expression associated with a specific configuration of the Nodes of this Model.

Throws:
ExceptionHugin

setNumberOfSamplesPerInterval

public void setNumberOfSamplesPerInterval(long count)
                                   throws ExceptionHugin
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.

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.

Parameters:
count - the number of subintervals.
Throws:
ExceptionHugin

getNumberOfSamplesPerInterval

public long getNumberOfSamplesPerInterval()
                                   throws ExceptionHugin
Returns the number of values per interval used when generating the conditional probability table for a node with interval parents.

Returns:
An integer.
Throws:
ExceptionHugin

isAlive

public boolean isAlive()
Is this Model object alive?


getUserData

public java.lang.Object getUserData()
Returns the value stored within the user data slot of this Model. If the stored value is NULL, or if no value has been stored, NULL is returned.

Returns:
Object stored within the Model.

setUserData

public void setUserData(java.lang.Object data)
Sets the user data field of this Model. The Hugin API provides a slot within each Model for use exclusively by the user/application.

Parameters:
data - User-defined data associated with this Model.