pt.tumba.ngram.bayes
Class BucketTree

java.lang.Object
  extended by pt.tumba.ngram.bayes.BucketTree

public class BucketTree
extends java.lang.Object


Field Summary
private  int active_bucket
           
(package private)  int[] backward_pointers
           
(package private)  BayesNet bn
           
(package private)  Bucket[] bucket_tree
           
(package private)  boolean do_produce_clusters
           
(package private)  int explanation_status
           
(package private) static int MAX_OUT
           
(package private)  Ordering ordering
           
(package private) static int SUM_OUT
           
(package private)  DiscreteFunction unnormalized_result
           
 
Constructor Summary
BucketTree(Ordering ord)
          Simple constructor for BucketTree.
BucketTree(Ordering ord, boolean dpc)
          Constructor for BucketTree.
 
Method Summary
private  int[] backward_maximization()
           
private  int build_evidence_markers(ProbabilityFunction pf, boolean[] markers)
           
private  void check_evidence_loop(ProbabilityFunction new_pf, ProbabilityFunction pf)
           
private  ProbabilityFunction check_evidence(ProbabilityFunction pf)
           
 boolean distribute()
          Distribute evidence in the BucketTree.
 ProbabilityFunction get_normalized_result()
          Get the normalized result for the BucketTree.
 DiscreteFunction get_unnormalized_result()
          Get the unnormalized_result for the BucketTree.
private  void insert(Bucket buck)
           
private  void insert(DiscreteFunction df)
           
private  void insert(DiscreteFunction df, boolean was_first_variable_cancelled_by_evidence)
           
 void print()
          Print method for BucketTree.
 void print(java.io.PrintStream out)
          Print method for BucketTree.
 void reduce()
          Variable elimination in the BucketTree.
private  ProbabilityFunction transform_to_probability_function(BayesNet bn, ProbabilityVariable pv)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bucket_tree

Bucket[] bucket_tree

bn

BayesNet bn

backward_pointers

int[] backward_pointers

unnormalized_result

DiscreteFunction unnormalized_result

ordering

Ordering ordering

explanation_status

int explanation_status

do_produce_clusters

boolean do_produce_clusters

active_bucket

private int active_bucket

MAX_OUT

static final int MAX_OUT
See Also:
Constant Field Values

SUM_OUT

static final int SUM_OUT
See Also:
Constant Field Values
Constructor Detail

BucketTree

public BucketTree(Ordering ord)
Simple constructor for BucketTree.


BucketTree

public BucketTree(Ordering ord,
                  boolean dpc)
Constructor for BucketTree. Does the whole initialization; it should be the only method that deals with symbolic names for variables.

Method Detail

transform_to_probability_function

private ProbabilityFunction transform_to_probability_function(BayesNet bn,
                                                              ProbabilityVariable pv)

check_evidence

private ProbabilityFunction check_evidence(ProbabilityFunction pf)

build_evidence_markers

private int build_evidence_markers(ProbabilityFunction pf,
                                   boolean[] markers)

check_evidence_loop

private void check_evidence_loop(ProbabilityFunction new_pf,
                                 ProbabilityFunction pf)

reduce

public void reduce()
Variable elimination in the BucketTree.


distribute

public boolean distribute()
Distribute evidence in the BucketTree.

Returns:
true if successful; false if not.

backward_maximization

private int[] backward_maximization()

insert

private void insert(Bucket buck)

insert

private void insert(DiscreteFunction df)

insert

private void insert(DiscreteFunction df,
                    boolean was_first_variable_cancelled_by_evidence)

print

public void print()
Print method for BucketTree.


print

public void print(java.io.PrintStream out)
Print method for BucketTree.


get_normalized_result

public ProbabilityFunction get_normalized_result()
Get the normalized result for the BucketTree.


get_unnormalized_result

public DiscreteFunction get_unnormalized_result()
Get the unnormalized_result for the BucketTree.