This package contains classes that act as an extended "wrapper" around Bayesian Networks. An ExtendedBN encapsulates a CoreBN (and ExtendedNodes and ExtendedStates capture the information about CoreBNNodes and their states).

Typically, an ExtendedBN is created internally by a Model. It is either generated from a file that contains a CoreBN (.net or .cor) or initialised as empty and then populated using information loaded from a .mdl file. Using this latter method, new ExtendedBNs can be instantiated and populated within an application.

The following code illustrates how you might go about creating an ExtendedBN from a .net file, compiling it, entering evidence on one node and then querying the marginals on another node:

  ExtendedBN ebn = ExtendedBN.createExtendedBNFromNetFile("cancer.net");
  ebn.compile();
  ExtendedNode node = ebn.getExtendedNodes("A: Metastatic Cancer").get(0);
  node.enterHardEvidence(0, true); // enters evidence on first state and then propagates
  ExtendedNode node2 = ebn.getExtendedNodes("D: Coma").get(0);
  DataSet ds = node2.getMarginals();
  System.out.println("Marginals:");
  System.out.println(ds);