Beispiel #1
0
 /** Compute and print a posterior marginal distribution for the InferenceGraph. */
 protected void print_marginal(PrintStream pstream, InferenceGraph ig, String queried_variable) {
   if (algorithm_type == ALGORITHM_VARIABLE_ELIMINATION)
     ig.print_marginal(pstream, queried_variable, false, what_to_show_bucket_tree_state);
   else if (algorithm_type == ALGORITHM_BUCKET_TREE)
     ig.print_marginal(pstream, queried_variable, true, what_to_show_bucket_tree_state);
   else return;
 }
Beispiel #2
0
  /** Save the network. */
  public boolean save(String filename) {
    InferenceGraph ig = get_inference_graph();

    if (filename == null) {
      jb.appendText("\n Filename invalid!");
      return (false);
    }

    if (ig == null) {
      jb.appendText("\n No Bayesian network to be saved.\n\n");
      return (false);
    }

    try {
      FileOutputStream fileout = new FileOutputStream(filename);
      PrintStream out = new PrintStream(fileout);
      switch (save_format) {
        case BIF_FORMAT:
          ig.save_bif(out);
          break;
        case XML_FORMAT:
          ig.save_xml(out);
          break;
        case BUGS_FORMAT:
          ig.save_bugs(out);
          break;
      }
      out.close();
      fileout.close();
    } catch (IOException e) {
      jb.appendText("Exception: " + e + "\n");
      return (false);
    }
    return (true);
  }
Beispiel #3
0
 /** Compute and print the metrics for sensitivity analysis of the InferenceGraph. */
 protected void print_sensitivity_analysis(PrintStream pstream, InferenceGraph ig) {
   ig.print_sensitivity_analysis(pstream);
 }
Beispiel #4
0
 /** Compute and print a full explanation for the InferenceGraph. */
 protected void print_full_explanation(PrintStream pstream, InferenceGraph ig) {
   ig.print_full_explanation(pstream, what_to_show_bucket_tree_state);
 }
Beispiel #5
0
 /** Print the QuasiBayesNet in the InferenceGraph. */
 protected void print_bayes_net(PrintStream pstream, InferenceGraph ig) {
   ig.print_bayes_net(pstream);
 }