Inheritance diagram for HAPI::Domain:
It is one of the principal structures in HUGIN. It must be constructed before any nodes belonging to the network.
Public Member Functions | |
Domain () | |
Construct a new, empty Domain object. | |
Domain (const std::string &filename) | |
Construct a domain by loading the corresponding Hugin Knowledge Base from file. | |
Domain (const std::string &filename, const std::string &password) | |
Construct a domain by loading the corresponding password protected Hugin Knowledge Base from file. | |
Domain (const std::string &filename, ParseListener *pl) | |
Construct a domain by reading a NET file description. | |
~Domain () throw () | |
Destruct a Domain object. | |
Domain * | clone () const |
Clone a Domain object. | |
void | adapt () |
Adapts this Domain according to the evidence entered. | |
double | approximate (double epsilon) |
Remove "near-zero" probabilities from the clique probability tables. | |
bool | cgEvidenceIsPropagated () const |
Test if CG evidence has been propagated for this Domain. | |
void | compile () |
Compile this Domain using the default triangulation method. | |
double | compress () |
Remove the zero entries from the clique and separator tables of the junction trees in this Domain. | |
bool | equilibriumIs (Equilibrium eq) const |
Test for Equilibrium type. | |
bool | evidenceIsPropagated () const |
Test if evidence has been propagated for this Domain. | |
bool | evidenceModeIs (EvidenceMode ev) const |
Test for evidence mode. | |
double | getApproximationConstant () const |
Return the approximation constant. | |
std::string | getAttribute (const std::string &key) const |
Return an attrubute value. | |
Number | getCaseCount (size_t config) const |
Retrieve the case count associated with the case config in this domain. | |
size_t | getConcurrencyLevel () const |
Get the current level of concurrency. | |
double | getConflict () const |
Return the conflict value. | |
NodeList | getEliminationOrder () const |
Return the triangulation order. | |
std::string | getFileName () const |
Return the file name most recently used for loading or saving this Domain. | |
size_t | getGrainSize () const |
Return the current value of the grain size parameter. | |
JunctionTreeList | getJunctionTrees () const |
Return the JunctionTrees of this Domain. | |
double | getLogLikelihood () const |
Get the log-likelihood of the domain. | |
double | getLogLikelihoodTolerance () const |
Get current setting of the log-likelihood tolerance in this domain. | |
double | getSignificanceLevel () const |
Get current setting of the significance level in this domain. | |
double | getLogNormalizationConstant () const |
Get the logarithm to the normalization constant. | |
Table * | getMarginal (const NodeList &nodes) const |
Compute the marginal distribution for the Nodes provided as arguments (which must all be chance nodes) with respect to the (imaginary) joint potential, determined by the current potentials on the junction tree (s) of this Domain. | |
size_t | getMaxNumberOfEMIterations () const |
Retrieve the current maximum number of iterations for the EM algorithm. | |
size_t | getMaxNumberOfSeparators () const |
Retrieve the current maximum number of separators allowed during triangulation. | |
Node * | getNodeByName (const std::string &name) const |
Locate a node in the domain by comparing the given string to the name of all the nodes. | |
NodeList | getNodes () const |
Return the Nodes of this Domain. | |
NodeList | parseNodes (const std::string &filename, ParseListener *errorHandler) |
std::pair< size_t, size_t > | getNodeSize () const |
Return the size of the displayed nodes. | |
double | getNormalizationConstant () const |
Retrieve the normalization constant from the most recent propagation. | |
size_t | getNumberOfCases () const |
Return the number of cases currently allocated for this domain. | |
bool | hasAttribute (const std::string &key) const |
Test if this Domain contains an attribute with the specified key. | |
bool | hasEvidenceToPropagate () const |
Test if evidence has been entered since last propagation. | |
bool | hasTablesToPropagate () const |
Test for new node tables. | |
void | initialize () |
Establish the initial values for all tables of this Domain (which must be compiled). | |
void | learnStructure () |
Learn the structure of a net from a text file. | |
bool | isCompiled () const |
Test whether this Domain is compiled. | |
bool | isCompressed () const |
Test whether this Domain is compressed. | |
void | learnTables () |
Learn the conditional probability tables for each node in this domain that has an experience table. | |
void | learnClassTables () |
Perform EM learning on an OOBN. | |
bool | likelihoodIsPropagated () const |
Test if likelihood eveidence has been propagated for this Domain. | |
size_t | newCase () |
Allocate storage within this domain to a new case. | |
void | propagate (Equilibrium eq=H_EQUILIBRIUM_SUM, EvidenceMode ev=H_MODE_NORMAL) |
Establish the specified equilibrium using the evidence mode indicated for incorporation of evidence on all junction trees in this Domain. | |
void | resetInferenceEngine () |
Establish the initial state of the inference engine.: sum-equilibrium with no evidence incorporated. | |
void | retractFindings () |
Retract (all) findings for all nodes in this Domain. | |
void | save (const std::string &filename, Endian format) |
This function is obsolete, since the format variable is no longer used. | |
void | saveAsKB (const std::string &filename) |
Save this Domain as a Hugin Knowledge Base to a file named by the parameter. | |
void | saveAsKB (const std::string &filename, const std::string &password) |
Save this domain as a password protected Hugin Knowledge Base file. | |
void | saveToMemory () |
Create a copy in memory of the belief and junction tree tables of this Domain (which must be compiled). | |
void | setAttribute (const std::string &key, const std::string &value) |
Insert the key/value pair in the attribute list for this Domain. | |
void | setCaseCount (size_t config, Number count) |
Set the case count for the configuration config to count. | |
void | setConcurrencyLevel (size_t level) |
Set the level of concurrency. | |
void | setGrainSize (size_t size) |
Set the grains size parameter. | |
void | setLogFile (FILE *log) |
Set the file to be used for logging by subsequent compilation and triangulation operations. | |
void | setLogLikelihoodTolerance (double tolerance) |
Specify the tolerance of the log-likelihood. | |
void | setSignificanceLevel (double significancelevel) |
Specify the Significance Level used for the structurel learning aglorithm. | |
void | setMaxNumberOfEMIterations (size_t iterations) |
Set the maximal number of iterations allowed for the EM algorithm. | |
void | setMaxNumberOfSeparators (size_t separators) |
Set the maximal number of separators allowed during triangulation. | |
void | setNodeSize (size_t width, size_t height) |
Set the size of the nodes. | |
void | setNumberOfCases (size_t number) |
Adjust the storage capacity for cases in this domain. | |
void | simulate () |
Sample a configuration for this Domain with respect to the current distribution.e The current distribution must be in sum-equilibrium and with evidence incorporated in normal mode. | |
void | triangulate (TriangulationMethod tm=H_TM_FILL_IN_WEIGHT) |
Transforms a network into a triangulated graph. | |
void | triangulateWithOrder (const NodeList &order) |
Transforms a network into a triangulated graph using a specified elimination order. | |
void | uncompile () |
Remove the data structures of this Domain. | |
void | saveAsNet (const std::string &filename) |
Write a NET description of the Domain to a file. | |
void | writeNet (const std::string &filename) |
Write a NET description of the Domain to a file. | |
void | generateTables () |
Generate tables for all applicable Nodes in this Domain. | |
void | seedRandom (unsigned long seed) |
The random number generator used by HUGIN, generates a set of numbers, which look random, but are in fact deterministic. | |
AttributeList | getAttributes () const |
getAttributes | |
void | saveCase (const std::string &filename) |
Saves all evidence entered in this Domain in a file with the given fileName (if the file exists, it is overwritten). | |
void | parseCase (const std::string &filename, ParseListener *pl) |
Parses the case stored in a file with the given filename and enters the associated findings into this Domain. | |
void | parseCases (const std::string &filename, ParseListener *pl) |
Parses a set of cases, stored in a file with the given filename. | |
void | saveCases (const std::string &filename, const NodeList &nodes, bool caseCounts, const std::string &separator, const std::string &missingData) |
Saves all cases entered in this Domain in a file with the given fileName. | |
void | saveCases (const std::string &filename, const NodeList &nodes, const std::vector< size_t > &cases, bool caseCounts, const std::string &separator, const std::string &missingData) |
Saves the specified cases entered in this Domain in a file with the given fileName. | |
void | saveCases (const std::string &filename, const NodeList *nodes, const int *cases, bool caseCounts, const std::string &separator, const std::string &missingData) |
Saves the specified cases entered in this Domain in a file with the given fileName. |
|
Construct a domain by loading the corresponding Hugin Knowledge Base from file.
|
|
Construct a domain by loading the corresponding password protected Hugin Knowledge Base from file. If the given password does not match, an exception is thrown.
|
|
Construct a domain by reading a NET file description.
|
|
Remove "near-zero" probabilities from the clique probability tables. For each Clique object in this domain, a value delta is computed such that the sum of all elements less than delta in the (discrete part) of the clique table is less than epsilon. These elements (less than delta) are then set to 0.
|
|
Test if CG evidence has been propagated for this Domain.
|
|
Clone a Domain object. This function returns a pointer to a copy of this domain. |
|
Compile this Domain using the default triangulation method. If the domain already is triangulated, nothing is changed. The domain must contain at least one chance or decision node. |
|
Remove the zero entries from the clique and separator tables of the junction trees in this Domain. Compression can only be applied to (compiled) ordinary belief networks. Continuous nodes are allowed, but compression only applies to configurations of states of the discrete nodes.
|
|
Test for Equilibrium type. If the equilibrium of all junction trees of this Domain is eq, return true.
|
|
Test if evidence has been propagated for this Domain.
|
|
Test for evidence mode. Test if the equilibrium of all junction trees of this Domain could have been obtained through a propagation using ev as the evidence incorporation mode.
|
|
Generate tables for all applicable Nodes in this Domain.
Implements HAPI::NetworkModel. |
|
Return the approximation constant. The number returned is based on the most recent (explicit or implicit) approximation operation. An implicit approximation takes place when you change some conditional probability tables of acompressed domain, and then perform a propagation operation. Since some (discree) state configurations have been removed from a compressed domain, the probability mass of the remaining configurations will typically be less than 1. This probability mass is returned by getApproximationConstant ().
|
|
Return an attrubute value. Return the value associated with key in the attribute list for this Domain.
Implements HAPI::NetworkModel. |
|
getAttributes
Implements HAPI::NetworkModel. |
|
Retrieve the case count associated with the case config in this domain.
|
|
Get the current level of concurrency.
|
|
Return the conflict value. The conflict value is valid for this Domain computed during the most recent propagation. If no propagation has been performed, 1 is returned.
|
|
Return the triangulation order. A NodeList containing a list of nodes in the order used to triangulate the network of this Domain is returned.
|
|
Return the file name most recently used for loading or saving this Domain.
Implements HAPI::NetworkModel. |
|
Return the current value of the grain size parameter.
|
|
Return the JunctionTrees of this Domain.
|
|
Compute the marginal distribution for the Nodes provided as arguments (which must all be chance nodes) with respect to the (imaginary) joint potential, determined by the current potentials on the junction tree (s) of this Domain. If nodes contains continuous nodes, they must be last in the list. This operation is not allowed on compressed domains.
|
|
Locate a node in the domain by comparing the given string to the name of all the nodes.
Implements HAPI::NetworkModel. |
|
Return the Nodes of this Domain. No ordering can be inferred by the user.
Implements HAPI::NetworkModel. |
|
Return the size of the displayed nodes.
Implements HAPI::NetworkModel. |
|
Retrieve the normalization constant from the most recent propagation. For sum-propagation, the normalization constant is equal to the probability of the evidence propagated. For max-propagation, the normalization constant is the probability of the most probable configuration with the evidence incorporated.
|
|
Test if this Domain contains an attribute with the specified key.
Implements HAPI::NetworkModel. |
|
Test if evidence has been entered since last propagation.
|
|
Test for new node tables. Are there any nodes in this Domain having (a conditional probability or utility) table that has changed since the most recent compilation or propagation.
|
|
Establish the initial values for all tables of this Domain (which must be compiled). Using this method will erase all evidence previously entered. |
|
Test whether this Domain is compiled.
|
|
Test whether this Domain is compressed.
|
|
Perform EM learning on an OOBN. This requires, that the data matches the domain created from the OOBN, and not the OOBN itself. |
|
Test if likelihood eveidence has been propagated for this Domain.
|
|
Allocate storage within this domain to a new case.
|
|
Parses the case stored in a file with the given filename and enters the associated findings into this Domain. All existing evidence in the Domain is retracted before entering the case findings.
|
|
Parses a set of cases, stored in a file with the given filename. The found cases are entered into the Domain.
|
|
Implements HAPI::NetworkModel. |
|
Establish the specified equilibrium using the evidence mode indicated for incorporation of evidence on all junction trees in this Domain. Also, revised beliefs will be computed for all nodes.
|
|
Establish the initial state of the inference engine.: sum-equilibrium with no evidence incorporated. Any propagated findings will thus be removed from the junction tree potentials, but entered findings will still be "registred" (i.e., they will be incorporated in the next propagation). |
|
This function is obsolete, since the format variable is no longer used. Please use the Domain::saveAsKB (const std::string& filename) function instead. Save this Domain as a Hugin Knowledge Base. to a file named by the parameter. The byte order of the Hugin KB is determined by the given format. If this domain is compiled, it can only be saved if the current equilibrium is "sum", and the current evidence incorporation mode is "normal".
|
|
Save this domain as a password protected Hugin Knowledge Base file.
|
|
Save this Domain as a Hugin Knowledge Base to a file named by the parameter. If this domain is compiled, it can only be saved if the current equilibrium is "sum", and the current evidence incorporation mode is "normal".
|
|
Write a NET description of the Domain to a file.
Implements HAPI::NetworkModel. |
|
Saves all evidence entered in this Domain in a file with the given fileName (if the file exists, it is overwritten).
|
|
Saves the specified cases entered in this Domain in a file with the given fileName. This form of the saveCases method is deprecated - use one of the other forms instead. |
|
Saves the specified cases entered in this Domain in a file with the given fileName.
|
|
Saves all cases entered in this Domain in a file with the given fileName.
|
|
Create a copy in memory of the belief and junction tree tables of this Domain (which must be compiled). This operation can only be performed if the current equilibrium is "sum", the current evidence mode is "normal", and no CG evidence has been incorporated. |
|
The random number generator used by HUGIN, generates a set of numbers, which look random, but are in fact deterministic. However, the set of numbers depend on the seed of the random generator. This can be set by this function.
|
|
Insert the key/value pair in the attribute list for this Domain. If the key is already defined, the value is updated. If no value is provided, the attribute is removed.
Implements HAPI::NetworkModel. |
|
Set the case count for the configuration config to count.
|
|
Set the level of concurrency. The level of concurrency specifies the maximum number of threads to create when performing a specific table operation. Setting the level of concurrency to 1 will cause all table operations to be performed sequentially. The initial parameter value is 1.
|
|
Set the grains size parameter. The grain size parameter specifies a lower limit of the tasks to be performed by each thread. The size of a task is approximately equal to the number of floating-point operations needed to perform the task (e.g., the number of elements to sum when performing a marginalization task). The initial value of the grain size parameter is 10000.
|
|
Set the file to be used for logging by subsequent compilation and triangulation operations.
Implements HAPI::NetworkModel. |
|
Specify the tolerance of the log-likelihood. Terminate the EM learning when the relative difference between the log-likelihood of two successive iterations becomes less than tolerance.
|
|
Set the maximal number of iterations allowed for the EM algorithm. The algorithm termnates when this number is reached or when the relative improvement becomes lower than the log-likelihood tolerance.
|
|
Set the maximal number of separators allowed during triangulation.
|
|
Set the size of the nodes.
Implements HAPI::NetworkModel. |
|
Adjust the storage capacity for cases in this domain.
|
|
Specify the Significance Level used for the structurel learning aglorithm.
|
|
Transforms a network into a triangulated graph. First, the network of this Domain is tranformed into its moral graph, and then this moral graph is triangulated using the triangulation method tm.
|
|
Transforms a network into a triangulated graph using a specified elimination order. First, the network of this Domain is transformed into its moral graph. Second, this moral graph is triangulated using the Nodes in the NodeList order as elimination sequence. order must contain each chance and decision node of this Domain exactly once and it must respect the restrictions for influence diagrams and networks containing continuous chance nodes.
|
|
Remove the data structures of this Domain. The data structures are produced by Domain::compile (), Domain::triangulate (), and Domain::triangulateWithOrder (). Note that any references to objects within the compiled structure (e.g., Clique and JunctionTree objects) are invalidated by a call to uncompile (). Also note that many of the editing functions automatically performs an uncompile () operation. When this happens, the domain must be compiled (using Domain::compile ()) before it can be used for inference. |
|
Write a NET description of the Domain to a file. This method is deprecated - use saveAsNet instead. |