Genie Library

Revision as of 19:54, 19 February 2025 by BFilstrup (talk | contribs)


Note: This guide is currently only for Lumina developers.

Genie is a powerful Bayesian network modeling tool designed for probabilistic reasoning and decision analysis, making it invaluable for diagnosing complex systems, predicting outcomes, and updating beliefs as new data emerges. What makes Genie particularly interesting is its ability to perform diagnostic inference, meaning it can intelligently infer causes from observed effects—something widely used in fields like risk assessment, medical diagnosis, and predictive maintenance. However, while Genie excels at probabilistic reasoning, it lacks Analytica’s strengths in structured decision modeling, cost-benefit analysis, and multi-dimensional scenario exploration. By integrating Genie with Analytica through the SMILE COM library, users can seamlessly combine probabilistic inference with powerful risk assessment and optimization tools. This connection enables, for instance, a pipeline risk management system where Genie predicts the probability of failure based on inspection data, while Analytica evaluates mitigation strategies and cost-effectiveness. Another example is equipment failure diagnostics, where Genie helps determine likely causes of a system failure, and Analytica models different response strategies to minimize downtime and costs. By linking these two tools, analysts can enhance decision-making with both predictive insights and strategic planning—creating a best-of-both-worlds solution.

Genie to Analytica.png

Download

You can download the Genie library here: Genie library.ana

Requirements

Analytica COM is used to pass data between Analytica and a Genie model and requires Enterprise or above. If you simply want to read and recreate a Genie model in Analytica then you do not need to enable COM calls. To enable this functionality, users will need to do the following:

1) Acquire a SMILE License key:


2) Download files for COM installation:

  • File:SmileCOM64.txt
    • This is actually a DLL file (change the file extension from .txt to .dll) that will need to be registered (instructions below).
  • File:SmileCOM.idl
    • The .idl file contains the SmileNetwork and SmileLicense interface definitions supported by BayesFusion.


3) Register the DLLs to your Windows Registry.

  1. Open up the command prompt.
  2. Navigate to the folder the downloaded DLL is stored.
  3. Use the command 'regsvr32' to register your DLL file.


Overview

The library is capable of importing and communicating with Genie models.

Importing

The import process reads the underlying XML-based format so that COM set up is not required. To import a Genie model:

1. Ensure the Genie model(s) you wish to import are located within the same folder as your Analytica model. 2. Use the 'File to Read' dropdown to select the desired Genie model. 3. Click 'Import selected model'

Genie Import Controls.png

Communicating

To communicate with a Genie model, you must set up COM interactions (see the Requirements section above). The library supports all 20 functions supported by the SMILE COM wrapper. Included in the library are basic controls to help target your Genie models and select individual nodes in those models to interact with.

Genie Communication Controls.png

Functions

SMILE_Initialize(Smile_License_COM_Object, license_key, variant_array)

  • Validates SMILE licensing key to create SMILE COM objects and use the SMILE COM functions.

SMILE_ReadFile(Smile_Network_COM_Object; XDSL_File_Path)

  • Reads the XDSL file from disk.

SMILE_UpdateBeliefs(Smile_Network_COM_Object)

  • Updates the network (the model being read from) with any new evidence set. Related functions:
    • SMILE_SetEvidence
    • SMILE_GetEvidence
    • SMILE_IsEvidence
    • SMILE_ClearEvidence

SMILE_GetAllNodeIds(Smile_Network_COM_Object)

  • Returns an array of all node handles (identifiers).

SMILE_GetNodeName(Smile_Network_COM_Object, Node_ID)

  • Returns the node name attribute.

SMILE_GetNodeType(Smile_Network_COM_Object, Node_ID)

  • Returns the node type attribute.

SMILE_ClearAllEvidence(Smile_Network_COM_Object)

  • Clears evidence for all nodes.

SMILE_ClearAllTargets(Smile_Network_COM_Object)

  • Clears targets for all nodes.

SMILE_SetEvidence(Smile_Network_COM_Object, Node_ID, Evidence)

  • Sets the evidence for the selected node.

SMILE_GetEvidence(Smile_Network_COM_Object, Node_ID)

  • Returns the evidence from the selected node.

SMILE_IsEvidence(Smile_Network_COM_Object, Node_ID)

  • Checks to see if evidence (obervation) is set.

SMILE_ClearEvidence(Smile_Network_COM_Object, Node_ID)

  • Clears evidence (observation) from selected node.

SMILE_IsTarget(Smile_Network_COM_Object, Node_ID)

  • Returns if the selected node is set as a target. More information on target nodes below:
  • Target nodes are always guaranteed to be updated by the inference algorithm. Other nodes, i.e., nodes that are not designated as targets, may be updated or not, depending on the internals of the algorithm used, but are not guaranteed to be updated. Focusing inference on the target nodes can reduce time and memory required to complete the calculation. When no targets are specified, SMILE assumes that all nodes are of interest to the user.

SMILE_SetTarget(Smile_Network_COM_Object, Node_ID, Bool)

  • Sets selected node to either True (target) or False (not a target). More information on target nodes below:
  • Target nodes are always guaranteed to be updated by the inference algorithm. Other nodes, i.e., nodes that are not designated as targets, may be updated or not, depending on the internals of the algorithm used, but are not guaranteed to be updated. Focusing inference on the target nodes can reduce time and memory required to complete the calculation. When no targets are specified, SMILE assumes that all nodes are of interest to the user.

SMILE_GetOutcomeIds(Smile_Network_COM_Object, Node_ID)

  • Returns Index elements tied to corresponding chance node.

SMILE_IsValueValid(Smile_Network_COM_Object, Node_ID)

  • Validity status; a flag set to true by the inference algorithm after it succesfully completes the calculations for the given node.

SMILE_IsValueDiscretized(Smile_Network_COM_Object, Node_ID)

  • Tells you whether your results are samples or discretized.

SMILE_GetNodeValue(Smile_Network_COM_Object, Node_ID)

  • Returns the specified node's value.

SMILE_GetNodeMean(Smile_Network_COM_Object, Node_ID)

  • Returns the specified node's mean.

SMILE_GetNodeStdDev(Smile_Network_COM_Object, Node_ID)

  • Returns the specified node's standard deviation.


Belief Nets

https://docs.analytica.com/index.php/Bayes_nets_and_probabilistic_belief_networks

Comments


You are not allowed to post comments.