Genie Library

Revision as of 19:37, 14 November 2024 by BFilstrup (talk | contribs)

This library helps you import Genie files into Analytica and interact with Genie models to take advantage of features like diagnostic inference that are exclusive to Genie.

Download

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

Requirements

Analytica COM is used to interact with Genie models. 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 or File:SmileCOM32.txt (depending on x32 or x64 Analytica)
    • These are actually DLL files (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

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

SMILE_ReadFile

  • Reads the XDSL file from disk.

SMILE_UpdateBeliefs

  • 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

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

SMILE_GetNodeName

  • Returns the node name attribute.

SMILE_GetNodeType

  • Returns the node type attribute.

SMILE_ClearAllEvidence

  • Clears evidence for all nodes.

SMILE_ClearAllTargets

  • Clears targets for all nodes.

SMILE_SetEvidence

  • Sets the evidence for the selected node.

SMILE_GetEvidence

  • Returns the evidence from the selected node.

SMILE_IsEvidence

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

SMILE_ClearEvidence

  • Clears evidence (observation) from selected node.

SMILE_IsTarget

  • 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

  • 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

  • Returns Index elements tied to corresponding chance node.

SMILE_IsValueValid

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

SMILE_IsValueDiscretized

  • Tells you whether your results are samples or discretized.

SMILE_GetNodeValue

  • Returns the specified node's value.

SMILE_GetNodeMean

  • Returns the specified node's mean.

SMILE_GetNodeStdDev

  • Returns the specified node's standard deviation.

Belief Nets

Comments


You are not allowed to post comments.