Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

HAPI::Class Class Reference

Inheritance diagram for HAPI::Class:

HAPI::NetworkModel List of all members.

Detailed Description

The Class class is one of the principal structures in HUGIN.

When using the Object Oriented features of HUGIN, Classes must be used for creating the networks. Furthermore, all Classes which are to be used as instances in a given Class must be contained in the same ClassCollection as this.

Classes cannot, however, be used for inference. For this purpose, it is necessary to instantiate the Class into a Domain, which can be used for performing inference.

See also:
ClassCollection

Domain

Node


Public Member Functions

 Class (ClassCollection *cColl)
 Create a new Class object, contained in the given ClassCollection.

 ~Class () throw ()
 Destruct a Class object.

void saveAsNet (const std::string &filename)
std::string getAttribute (const std::string &key) const
std::string getFileName () const
NodeList getNodes () const
NodegetNodeByName (const std::string &name) const
NodeList parseNodes (const std::string &filename, ParseListener *errorHandler)
void setAttribute (const std::string &key, const std::string &value)
void setLogFile (FILE *log)
bool hasAttribute (const std::string &key) const
std::pair< size_t, size_t > getNodeSize () const
void setNodeSize (size_t width, size_t height)
AttributeList getAttributes () const
void generateTables ()
void setName (const std::string &name)
 Set the name of this Class.

void setName (const char *name)
 Set the name of this Class.

std::string getName ()
 Retrieve the name of this Class.

NodeList getInputs () const
 Get a list of all Nodes in this Class, which have been added to the inputs of the Class.

NodeList getOutputs () const
 Get a list of all Nodes in this Class, which have been added to the outputs of the Class.

NodeList getInstances () const
 Get a list of all InstanceNodes created from this Class.

DomaincreateDomain () const
 Instantiate this Class to a Domain.

ClassCollectiongetClassCollection () const
 Return the ClassCollection, in which this Class is contained.


Constructor & Destructor Documentation

HAPI::Class::Class ClassCollection cColl  )  [explicit]
 

Create a new Class object, contained in the given ClassCollection.

Parameters:
cColl A pointer to the ClassCollection in which the newly constructed Class should be placed.


Member Function Documentation

Domain* HAPI::Class::createDomain  )  const
 

Instantiate this Class to a Domain.

This is required before any inference can be made. This operation will "unfold" the object oriented parts of the network, so that the Domain will be a standard HUGIN Domain.

Note: The Nodes in the Domain will not be immediately identifiable as the Nodes from the Class (i.e., they will not have meaningfull names). To determine what Node in the Class a given domain-node is derived from, you should use Node::getSource ().

See also:
Node::getSource
Returns:
The newly constructed Domain.

void HAPI::Class::generateTables  )  [virtual]
 

See also:
NetworkModel::generateTables

Implements HAPI::NetworkModel.

std::string HAPI::Class::getAttribute const std::string &  key  )  const [virtual]
 

See also:
NetworkModel::getAttribute

Implements HAPI::NetworkModel.

AttributeList HAPI::Class::getAttributes  )  const [virtual]
 

See also:
NetworkModel::getAttributes

Implements HAPI::NetworkModel.

ClassCollection* HAPI::Class::getClassCollection  )  const
 

Return the ClassCollection, in which this Class is contained.

A Class can only be contained in a single ClassCollection, so if a given Class definition is needed in more than one ClassCollection, a copy of the Class must be created in each ClassCollection, and changes to one version of the Class will not be reflected in the others.

Returns:
The ClassCollection containing this Class

std::string HAPI::Class::getFileName  )  const [virtual]
 

See also:
NetworkModel::getFileName

Implements HAPI::NetworkModel.

NodeList HAPI::Class::getInputs  )  const
 

Get a list of all Nodes in this Class, which have been added to the inputs of the Class.

Returns:
A NodeList containing all input nodes for the Class.
See also:
Node::addToInputs

NodeList HAPI::Class::getInstances  )  const
 

Get a list of all InstanceNodes created from this Class.

Returns:
A NodeList containing the instances
See also:
InstanceNode

std::string HAPI::Class::getName  ) 
 

Retrieve the name of this Class.

If no name has been assigned to the Class, one will be automatically generated by HUGIN.

Returns:
The name of this Class

Node* HAPI::Class::getNodeByName const std::string &  name  )  const [virtual]
 

See also:
NetworkModel::getNodeByName

Implements HAPI::NetworkModel.

NodeList HAPI::Class::getNodes  )  const [virtual]
 

See also:
NetworkModel::getNodes

Implements HAPI::NetworkModel.

std::pair<size_t, size_t> HAPI::Class::getNodeSize  )  const [virtual]
 

See also:
NetworkModel::getNodeSize

Implements HAPI::NetworkModel.

NodeList HAPI::Class::getOutputs  )  const
 

Get a list of all Nodes in this Class, which have been added to the outputs of the Class.

Returns:
A NodeList containing all output nodes for the Class.
See also:
Node::addToOutputs

bool HAPI::Class::hasAttribute const std::string &  key  )  const [virtual]
 

See also:
NetworkModel::hasAttribute

Implements HAPI::NetworkModel.

NodeList HAPI::Class::parseNodes const std::string &  filename,
ParseListener errorHandler
[virtual]
 

See also:
NetworkModel::parseNodes

Implements HAPI::NetworkModel.

void HAPI::Class::saveAsNet const std::string &  filename  )  [virtual]
 

See also:
NetworkModel::saveAsNet

Implements HAPI::NetworkModel.

void HAPI::Class::setAttribute const std::string &  key,
const std::string &  value
[virtual]
 

See also:
NetworkModel::setAttribute

Implements HAPI::NetworkModel.

void HAPI::Class::setLogFile FILE *  log  )  [virtual]
 

See also:
NetworkModel::setLogFile

Implements HAPI::NetworkModel.

void HAPI::Class::setName const char *  name  ) 
 

Set the name of this Class.

Parameters:
name The name which is given to this Class

void HAPI::Class::setName const std::string &  name  ) 
 

Set the name of this Class.

Parameters:
name The name which is given to this Class

void HAPI::Class::setNodeSize size_t  width,
size_t  height
[virtual]
 

See also:
NetworkModel::setNodeSize

Implements HAPI::NetworkModel.


Copyright Hugin Expert A/S 1993-2004