COM.hugin.HAPI
Class Class

java.lang.Object
  extended byCOM.hugin.HAPI.NetworkModel
      extended byCOM.hugin.HAPI.Class

public class Class
extends NetworkModel

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.


Nested Class Summary
 
Nested classes inherited from class COM.hugin.HAPI.NetworkModel
NetworkModel.Category, NetworkModel.Constraint, NetworkModel.Endian, NetworkModel.Kind
 
Field Summary
 
Fields inherited from class COM.hugin.HAPI.NetworkModel
H_CATEGORY_CHANCE, H_CATEGORY_DECISION, H_CATEGORY_ERROR, H_CATEGORY_INSTANCE, H_CATEGORY_UTILITY, H_CONSTRAINT_BACKWARD_EDGE_FORBIDDEN, H_CONSTRAINT_BACKWARD_EDGE_REQUIRED, H_CONSTRAINT_EDGE_FORBIDDEN, H_CONSTRAINT_EDGE_REQUIRED, H_CONSTRAINT_ERROR, H_CONSTRAINT_FORWARD_EDGE_FORBIDDEN, H_CONSTRAINT_FORWARD_EDGE_REQUIRED, H_CONSTRAINT_NONE, H_ENDIAN_BIG, H_ENDIAN_HOST, H_ENDIAN_LITTLE, H_KIND_CONTINUOUS, H_KIND_DISCRETE, H_KIND_ERROR
 
Constructor Summary
Class(ClassCollection cc)
          Constructs a new Class in a ClassCollection.
Class(ClassCollection cc, java.lang.String name)
          Constructs a new named Class in a ClassCollection.
 
Method Summary
 Domain createDomain()
          Unfolds the Class to a Domain that can be compiled and used for inference, etc.
 void delete()
          Deletes this Class, including all Nodes belonging to it.
 ClassCollection getClassCollection()
          Returns the ClassCollection to which this Class belongs.
 NodeList getInputs()
          Returns a list of the input nodes defined for this Class.
 NodeList getInstances()
          Returns the list of InstanceNodes that are instances of this Class.
 java.lang.String getName()
          Gets the name of this Class.
 NodeList getOutputs()
          Returns a list of the output nodes defined for this Class.
 void setName(java.lang.String name)
          Sets the name of this Class.
 
Methods inherited from class COM.hugin.HAPI.NetworkModel
closeLogFile, generateTables, getAttribute, getAttributes, getFileName, getLogFile, getNodeByName, getNodes, getNodeSize, getUserData, INFINITY, openLogFile, openLogFile, parseNodes, saveAsNet, setAttribute, setNodeSize, setUserData
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Class

public Class(ClassCollection cc)
      throws ExceptionHugin
Constructs a new Class in a ClassCollection.

Parameters:
cc - the ClassCollection in which to add the new Class.

Class

public Class(ClassCollection cc,
             java.lang.String name)
      throws ExceptionHugin
Constructs a new named Class in a ClassCollection.

Parameters:
cc - the ClassCollection in which to add the new Class.
name - the name of the new Class (a String).
Method Detail

getClassCollection

public ClassCollection getClassCollection()
                                   throws ExceptionObjectNotAlive
Returns the ClassCollection to which this Class belongs.

Throws:
ExceptionObjectNotAlive

delete

public void delete()
            throws ExceptionHugin
Deletes this Class, including all Nodes belonging to it.

Specified by:
delete in class NetworkModel
Throws:
ExceptionHugin

setName

public void setName(java.lang.String name)
             throws ExceptionHugin
Sets the name of this Class.

Parameters:
name - A string containing the name of this Class.
Throws:
ExceptionHugin

getName

public java.lang.String getName()
                         throws ExceptionHugin
Gets the name of this Class.

Throws:
ExceptionHugin

getOutputs

public NodeList getOutputs()
                    throws ExceptionHugin
Returns a list of the output nodes defined for this Class.

Returns:
NodeList containing the output nodes of this Class.
Throws:
ExceptionHugin

getInputs

public NodeList getInputs()
                   throws ExceptionHugin
Returns a list of the input nodes defined for this Class.

Returns:
NodeList containing the input nodes of this Class.
Throws:
ExceptionHugin

createDomain

public Domain createDomain()
                    throws ExceptionHugin
Unfolds the Class to a Domain that can be compiled and used for inference, etc.

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.

Returns:
A Domain represented the unfolded object-oriented network represented by this Class.
Throws:
ExceptionHugin

getInstances

public NodeList getInstances()
                      throws ExceptionHugin
Returns the list of InstanceNodes that are instances of this Class.

Returns:
a NodeList of InstanceNodes.
Throws:
ExceptionHugin