BayesianNetworks
Class BayesNet

java.lang.Object
  |
  +--BayesianNetworks.BayesNet

public class BayesNet
extends java.lang.Object


Field Summary
static int INVALID_INDEX
           
protected  java.lang.String name
           
protected  DiscreteFunction[] probabilities
           
protected  DiscreteFunction utility
           
protected  DiscreteVariable[] variables
           
 
Constructor Summary
BayesNet()
          Default constructor for a BayesNet.
 
Method Summary
 void add(DiscreteFunction[] pfs)
          Add an array of DiscreteFunction objects to the BayesNet.
 void add(DiscreteVariable[] pvs)
          Add an array of DiscreteVariable objects to the BayesNet.
 java.lang.String[][] get_all_evidence()
          Get all the evidence contained in the network variables.
 DiscreteFunction get_function(DiscreteVariable p_v)
          Find the DiscreteFunction that corresponds to a given DiscreteVariable.
 java.lang.String get_name()
          Get the name of the network.
 DiscreteFunction[] get_probabilities()
          Get the probability functions.
 DiscreteFunction get_probability_function(int index)
          Get the probabilities function at a given index.
 DiscreteVariable get_probability_variable(int index)
          Get the probability variable at a given index.
 DiscreteVariable get_probability_variable(java.lang.String n_v)
          Get the probability variable given the name of the variable.
 DiscreteFunction get_utility()
          Get the utility function.
 DiscreteVariable[] get_variables()
          Get the probability variables.
 int index_of_variable(java.lang.String n_vb)
          Determine the position of a variable given its name.
 int number_probabilities()
          Get the number of distributions in the network.
 int number_variables()
          Get the number of variables in the network.
 void set_name(java.lang.String n)
          Set the name of the network.
 void set_probability_function(int index, DiscreteFunction p_f)
          Set a probability variable given its index.
 void set_probability_variable(int index, DiscreteVariable p_v)
          Set a probability variable given its index.
 void set_probability(DiscreteFunction[] pfs)
          Set the vector of probability functions.
 void set_variables(DiscreteVariable[] pvs)
          Set the vector of probability variables.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

variables

protected DiscreteVariable[] variables

probabilities

protected DiscreteFunction[] probabilities

utility

protected DiscreteFunction utility

INVALID_INDEX

public static final int INVALID_INDEX
Constructor Detail

BayesNet

public BayesNet()
Default constructor for a BayesNet.
Method Detail

add

public void add(DiscreteVariable[] pvs)
Add an array of DiscreteVariable objects to the BayesNet.

add

public void add(DiscreteFunction[] pfs)
Add an array of DiscreteFunction objects to the BayesNet.

get_function

public DiscreteFunction get_function(DiscreteVariable p_v)
Find the DiscreteFunction that corresponds to a given DiscreteVariable. Note: the index of a variable is used by the function, as it is the only reference to the variable that is guaranteed to identify the variable uniquely.

get_all_evidence

public java.lang.String[][] get_all_evidence()
Get all the evidence contained in the network variables.

index_of_variable

public int index_of_variable(java.lang.String n_vb)
Determine the position of a variable given its name.

get_name

public java.lang.String get_name()
Get the name of the network.

set_name

public void set_name(java.lang.String n)
Set the name of the network.

number_variables

public int number_variables()
Get the number of variables in the network.

number_probabilities

public int number_probabilities()
Get the number of distributions in the network.

get_probability_variable

public DiscreteVariable get_probability_variable(int index)
Get the probability variable at a given index.

get_probability_variable

public DiscreteVariable get_probability_variable(java.lang.String n_v)
Get the probability variable given the name of the variable.

get_probability_function

public DiscreteFunction get_probability_function(int index)
Get the probabilities function at a given index.

get_variables

public DiscreteVariable[] get_variables()
Get the probability variables.

get_probabilities

public DiscreteFunction[] get_probabilities()
Get the probability functions.

get_utility

public DiscreteFunction get_utility()
Get the utility function.

set_probability_variable

public void set_probability_variable(int index,
                                     DiscreteVariable p_v)
Set a probability variable given its index.

set_probability_function

public void set_probability_function(int index,
                                     DiscreteFunction p_f)
Set a probability variable given its index.

set_variables

public void set_variables(DiscreteVariable[] pvs)
Set the vector of probability variables.

set_probability

public void set_probability(DiscreteFunction[] pfs)
Set the vector of probability functions.